Repository navigation
fix(api): make BugSource tolerant of unknown backend values - #274
Closed
sachiniyer wants to merge 1 commit into
Closed
sachiniyer wants to merge 1 commit into
sachiniyer wants to merge 1 commit into
Conversation
0.2.0 hard-broke `bugs list/show` for any review carrying a `source` the vendored openapi.json hadn't seen yet (`github_issue`, `bug_fix_check`). #255 patched the spec reactively, but the next time the backend adds a value, every released CLI in the wild will hit the same wall. Drop the `enum` constraint from `BugSource` in our vendored openapi.json so progenitor generates a plain `String` instead of a strict enum — unknown values now deserialize fine. The CLI never inspects the field, so the lost type safety costs nothing. Teach `cargo xtask {generate,check}-openapi` to apply the same override after fetching upstream, so future regenerations don't re-introduce the brittleness and CI's check-openapi stays green. Adds a regression test in `src/api/types.rs` that deserializes a Bug with an invented `review.source`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sachiniyer
temporarily deployed
to
integration-tests
May 5, 2026 18:07 — with
GitHub Actions
Inactive
Contributor
Author
|
Closing — fix landed upstream, CLI doesn't need a change after all. |
This branch was previously 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.
Summary
bugs list/showwhenever a review'ssourcefield carried a backend value our vendoredopenapi.jsonhadn't seen yet (github_issue,bug_fix_check). fix: vendor updated openapi.json so BugSource accepts new backend variants #255 patched the spec reactively — but the next new value will break every released CLI in the wild the same way.enumconstraint fromBugSourcein the vendoredopenapi.jsonso progenitor generates a plainStringfor the field; unknown values now deserialize fine. The CLI never inspects this field, so the lost type safety costs nothing.cargo xtask {generate,check}-openapito apply the same override after fetching upstream so future regenerations stay tolerant and CI'scheck-openapistays green.src/api/types.rsthat deserializes a Bug with an inventedreview.source.Test plan
cargo test --lib— newbug_with_unknown_review_source_deserializestest passescargo clippy -- -D warningscleancargo fmt --checkcleancargo build— progenitor regeneratesBugReviewwithsource: Option<String>cargo xtask check-openapiagainst the live upstream (needs network)cargo xtask generate-openapithengit diff openapi.jsonshows no enum reintroduction🤖 Generated with Claude Code