Repository navigation
feat(apidocs): Read the report card from exceptions.json and add --compare - #131407
Conversation
046d814 to
a12f01b
Compare
33040d8 to
63ac012
Compare
a12f01b to
6e1eba7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6e1eba7. Configure here.
51eb0a8 to
dd79ed5
Compare
63ac012 to
da903bf
Compare
dd79ed5 to
a65c5d9
Compare
147e306 to
c9f8fcd
Compare
a65c5d9 to
94af43e
Compare
Sentry Snapshot Testing
|
94af43e to
c380a3a
Compare
5179580 to
eeccb23
Compare
eeccb23 to
4e4b438
Compare
DominikB2014
left a comment
There was a problem hiding this comment.
The changes make sense to me. One case to consider, i think this pr would make the owners frozen right? if a owner changes on an api, we aren't running django on the diff so we can't get the latest owner?
we discussed this async, in this PR owners are frozen at whatever |
Refs #131073 Our OpenAPI docs drift from what endpoints actually return, and nothing catches it. This compares the responses tests get from **public** operations with the schema drf-spectacular generates from the code: - **S036**: the status isn't in the operation's `responses` - **S037**: the JSON body doesn't match that status's schema 304, 429 and 5xx are exempt: a 304 only answers a conditional request, the rate limiter can return a 429 from any endpoint, and a 5xx is a bug rather than part of the contract. S035 is taken by #130924. This stands alone and doesn't touch the API guidelines work in #131117 → #131088 → #131135 → #131407. Findings use the same signature (endpoint file, `EndpointClass.method`, `status:<code>`, owner) and entry shape as that stack's `exceptions.json`, which is where the baseline goes once the stack lands. The pytest plugin is opt-in, with two modes. Report mode records findings and annotates endpoints whose findings aren't baselined. Strict mode also fails the test that got one. The schema is generated while xdist workers start, so it always matches the code and doesn't need node. A new baseline tool adds a run's findings to a baseline file. It only touches the endpoint methods that run called, and keeps reviewed statuses. Backend CI runs in report mode, so nothing blocks merges. CI moves to strict mode together with the baseline. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A3bcd89ea85721d16b9af505e --> -- [View Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A3bcd89ea85721d16b9af505e) [[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A3bcd89ea85721d16b9af505e/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>

Linear issue
The report card now reads
exceptions.jsoninstead of scanningsrc/every time, so it's instant and doesn't need the owner map or Redis (this PR is stacked on #131135)--compare older.jsonshows what's new, fixed, or changed count since an olderexceptiuons.json, grouped by teamexceptions.jsonnow has agenerateddate at the top, so the report card can say when the file is from and what it's comparing againstdiff_entries,merge_entries,describe_entry) intoentries.pyso the generator and the report card share them