Repository navigation
ci: lint the OpenAPI spec and fail on breaking API changes - #249
Open
ndbroadbent wants to merge 1 commit into
Open
ndbroadbent wants to merge 1 commit into
ndbroadbent wants to merge 1 commit into
Conversation
task lint:openapi (scripts/check_openapi.sh) runs in the repo-checks job: - Redocly lints web/src/api/openapi.json with its recommended rules (redocly.yaml). Public routes are listed as security-defined exceptions, and the login redirects and the health check have their reasons in .redocly.lint-ignore.yaml. - oasdiff compares the spec with the base commit's and fails on a breaking change, unless a commit message says why with [breaking-api]: people run CLIs older than their gateway, and the phone app updates on its own. To pass the lint, every operation now has an @id: orval's own method-plus- path name, so the generated client is unchanged. Authenticated routes that listed no client error now list 401 (and 403 when they need a permission), the login redirects list the rate limiter's 429, and the spec names its Apache-2.0 licence. [breaking-api] PUT /auth/mfa/methods/{methodID} and GET /integrations/slack now document the session they have always required (@Security). The routes themselves don't change, so no client breaks.
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Dec 5, 2026 7:22a.m. | Review ↗ | |
| Go | Dec 5, 2026 7:22a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
This branch has not been deployed
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.
Nothing linted the OpenAPI spec, and an API change that breaks older clients (a CLI older than its gateway, the phone app) showed up only as type errors in the web client, if at all.
task lint:openapi(scripts/check_openapi.sh), in the repo-checks job against the PR's base or the push's previous commit:web/src/api/openapi.jsonwith its recommended rules (redocly.yaml). The public routes (health, logins, logouts) aresecurity-definedexceptions. The login redirects (no 2xx) and the health check (no 4xx) are in.redocly.lint-ignore.yamlwith their reasons.[breaking-api].Both are pinned in
mise.toml; the job checks out withfetch-depth: 0for the base commit and its messages.Spec fixes so the lint passes
@ID: orval's own method-plus-path name, soweb/src/api/generated.tsis unchanged.task generateonly renames one shared request body component in the spec.PUT /auth/mfa/methods/{methodID}andGET /integrations/slackwere documented without@Security, though both always required a session. oasdiff rates documenting that as breaking, so the commit carries[breaking-api]with the reason; no client changes.Found, not fixed here: some routes have no swag annotations, so they're missing from the spec: the Slack integration's OAuth, channels and alerts routes, and
POST /auth/cli/mfa. The spec also has no scheme for theAuthorization: Bearersession and API tokens that the CLI and CI use. Both are for a follow-up.Tested locally: the lint passes with the 6 documented exceptions; removing
POST /api-tokensfrom the spec fails the diff; this branch's own change passes only because of its[breaking-api]commit.task generateleavesgenerated.tsunchanged.This conflicts with #247 and #248 on the same lines of
ci.yml,Taskfile.yml,mise.tomlandAGENTS.md; I'll rebase once they're merged.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.