feat(api): expose server features endpoint for CIRA tab toggle#1032
Draft
madhavilosetty-intel wants to merge 1 commit into
Draft
feat(api): expose server features endpoint for CIRA tab toggle#1032madhavilosetty-intel wants to merge 1 commit into
madhavilosetty-intel wants to merge 1 commit into
Conversation
Add GET /api/v1/server/features returning an extensible capabilities object so clients (e.g. the Sample Web UI) can adapt their UI to how Console was started. The first flag, ciraEnabled, is derived from the existing APP_DISABLE_CIRA setting and lets the UI show or hide the CIRA tab. Updates the Gin handler, the Fuego/OpenAPI declaration, and the MPS Postman collection in lock-step.
There was a problem hiding this comment.
Pull request overview
Adds a new protected v1 endpoint that exposes server capability flags so clients can conditionally enable UI features (initially, toggling the CIRA tab based on APP_DISABLE_CIRA).
Changes:
- Introduces
GET /api/v1/server/featuresin the Gin v1 router, returning{ ciraEnabled: boolean }. - Adds the corresponding DTO (
dto.ServerFeatures) and OpenAPI (Fuego) route declaration. - Updates the MPS Postman collection and adds a focused Gin handler test.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/entity/dto/v1/server.go | Adds ServerFeatures DTO with ciraEnabled JSON field. |
| internal/controller/openapi/server.go | Declares /api/v1/server/features in the OpenAPI (Fuego) adapter. |
| internal/controller/openapi/adapter.go | Registers the new Server OpenAPI routes during spec generation. |
| internal/controller/httpapi/v1/server.go | Implements the Gin handler returning ciraEnabled derived from config. |
| internal/controller/httpapi/v1/server_test.go | Tests ciraEnabled behavior for both enabled/disabled cases. |
| internal/controller/httpapi/router.go | Wires the new server routes into the protected /api/v1 group. |
| integration-test/collections/console_mps_apis.postman_collection.json | Adds a “Get Server Features” request with basic response assertions. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1032 +/- ##
=======================================
Coverage 41.66% 41.66%
=======================================
Files 135 137 +2
Lines 12433 12452 +19
=======================================
+ Hits 5180 5188 +8
- Misses 6698 6709 +11
Partials 555 555 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add GET /api/v1/server/features returning an extensible capabilities object so clients (e.g. the Sample Web UI) can adapt their UI to how Console was started. The first flag, ciraEnabled, is derived from the existing APP_DISABLE_CIRA setting and lets the UI show or hide the CIRA tab.
Updates the Gin handler, the Fuego/OpenAPI declaration, and the MPS Postman collection in lock-step.