Repository navigation
feat: add a chart value for the Swagger UI - #245
Merged
Merged
Conversation
tesk-api 1.2.0 serves the Swagger UI only if TESK_API_SWAGGER_UI_ENABLED is true, and stops on anything but true or false. Add tesk.swaggerUi.enabled (default false), passed on unless null, and fail the rendering on non-boolean values. Document it in the configuration reference, the deployment docs and the upgrade notes. Closes #243 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fail on a non-map tesk.swaggerUi, accept true and false as strings (in any case) for tools that set only strings, and keep the OIDC client paragraph in the auth section. Name the API description and the Swagger UI as public endpoints with auth, and say that upgrading the chart alone changes nothing before tesk-api 1.2.0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reflow the upgrade note, and give the Swagger UI's path as the root path of the deployment (ingress.path) in the reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Reviewer's GuideAdds the opt-in Sequence diagram for conditional Swagger UI configurationsequenceDiagram
participant User as Helm user
participant Helm as Helm renderer
participant API as tesk-api
User->>Helm: helm install or helm upgrade
alt valid true or false value
Helm->>Helm: Render tesk-deployment.yaml
Helm->>API: Set TESK_API_SWAGGER_UI_ENABLED
API-->>Helm: Start with Swagger UI setting
else null value
Helm->>Helm: Render without environment variable
Helm->>API: Start with default Swagger UI setting
else invalid value
Helm-->>User: Rendering fails before deployment
end
Flow diagram for Swagger UI Helm value validationflowchart TD
A[Helm values: tesk.swaggerUi] --> B{tesk.swaggerUi is null or a map?}
B -- No --> X[Helm rendering fails]
B -- Yes --> C{enabled is null?}
C -- Yes --> D[Omit TESK_API_SWAGGER_UI_ENABLED]
C -- No --> E{Boolean or string true/false?}
E -- No --> X
E -- Yes --> F[Set TESK_API_SWAGGER_UI_ENABLED]
D --> G[Deploy tesk-api]
F --> G
G --> H{API value is true?}
H -- Yes --> I[Serve Swagger UI publicly]
H -- No --> J[Swagger UI remains off]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #245 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 199 199
=========================================
Hits 199 199 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
November 6, 2026 16:23
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Linked issues
#243 feat: add a chart value for the Swagger UI · 3 of 3 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add a chart value for the Swagger UI, off by default, and pass it to the API as TESK_API_SWAGGER_UI_ENABLED. | ✅ Met | The chart defines tesk.swaggerUi.enabled as false and conditionally renders the environment variable; tests cover the default, explicit values, and null. |
| 2 | Reject values other than true and false when rendering. | ✅ Met | The template validates the value and fails rendering for invalid values, with tests covering invalid settings. |
| 3 | Document the setting in the configuration reference, deployment docs, and upgrade notes, including that enabling it serves the Swagger UI publicly and it should be enabled only where needed. | ✅ Met | All three requested docs are updated with the public-exposure warning. |
Sourcery assessment
Approved.
11 tasks done
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.
Summary
tesk-api now serves the Swagger UI only if
TESK_API_SWAGGER_UI_ENABLEDistrue(elixir-cloud-aai/tesk-api#80, from tesk-api 1.2.0), and stops at startup on anything buttrueorfalse. This adds the chart valuetesk.swaggerUi.enabled, defaultfalse:TESK_API_SWAGGER_UI_ENABLED; null (for the value ortesk.swaggerUi) leaves the variable out, so tesk-api's default (off) applies.trueorfalse(booleans, or strings in any case, lowercased, for tools that set only strings) and on a non-maptesk.swaggerUi, rather than the API failing at startup.enabledtoggle), like the planned renames of refactor: follow the Helm conventions in the chart #228; no existing value or resource changes.tesk.imageis 1.1.0). Wording: turning it on serves the Swagger UI publicly; enable it only where needed.Closes #243
Verification
REQUIRE_HELM=1 coverage run -m pytest(helm 3.22.1): 79 passed; coverage 100%. The new tests failed before the template change.helm lint --strict charts/tesk: passes.mkdocs build --strict: passes.Review
Full review (chart logic):
adversarial-reviewerandquality-reviewer, two rounds. Fixed: non-maptesk.swaggerUisilently ignored or failing with an unclear error; strings"true"/"false"now accepted; auth docs didn't name/v2/api-docsand the Swagger UI as public; OIDC paragraph had moved out of the auth section; upgrade note title and wording; Swagger UI path given as absolute instead of underingress.path.Declined review findings
_helpers.tplhelper orvalues.schema.json: the chart has neither yet (refactor: follow the Helm conventions in the chart #228); one inline block is clearer until a second value needs the same check.tesk.imagemoves to 1.2.0.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Add an opt-in Helm setting for serving the Swagger UI with early validation and comprehensive documentation.
New Features:
tesk.swaggerUi.enabledHelm value to control whether the API serves Swagger UI, defaulting to disabled.Bug Fixes:
Enhancements:
Documentation:
Tests: