Repository navigation
feat(coverage): body variants, reviewed auth cases, accurate gap codes and CI quality gates - #15
Merged
Merged
Conversation
…s and CI quality gates - Positive request-body variants for create / update of a confirmed chain: only the required fields, and every other oneOf / anyOf branch with a valid sample. Each is checked with ajv before a test is written; cleanup in finally. - Reviewed auth cases from a deps "auth" section (environment variable names only): 403 for the operations named, 401 with an expired credential; skipped with the reason when the variable is unset; INVALID_REVIEWED_CONFIG when the section does not match the spec. - Unchecked-status codes state the actual reason (MISSING_CLEANUP for an operation nothing is sent to, the success call's blocking reason for its status). - Case ID vocabulary v4: optional-omitted, variant, expired-credentials. - CI quality gates (scripts/coverage-summary.ts, src/report/quality-gates.ts): reviewed baselines of active case IDs and exact gaps, TS/Python parity, guaranteed cleanup of write tests, per-operation coverage summary artifact. - Demo API: documented 403 on GET /me, fixed expired / suspended sessions, fault modes require-optional, accept-expired, ignore-suspension. Demo: 86 -> 90 active case IDs, documented statuses checked 16/21 -> 17/22, fault injection 9/9 in TS and Python (previous generator 7/9 on the same spec). Kitchen sink: 112 -> 118 cases, statuses 17/21 -> 18/21, UNCOVERED_VARIANT closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Why
An audit of
mainfound checks that can catch real defects but were missing:oneOf/anyOfbranches other than the example's were never sent;CI could not notice coverage going down: expected gaps were compared by count per code, with no operation or location, and nothing tracked active case IDs or write-test cleanup.
Baseline (main) → this PR
Fault injection on the demo API, same spec,
items+me:DEMO_FAULT)mainrequire-optional(an optional field becomes required)accept-expired(an expired token is accepted)ignore-suspension(a refused account gets 200)What
Positive request-body variants (
src/generate/variants.ts,variant-render.ts). These apply to create / update operations of a confirmed chain.optional-omitted). Optional fields are removed outer first, and each removal is kept only while the payload stays valid. Nothing is removed insideoneOf/anyOf/ conditional subtrees.oneOf/anyOfbranch (variant,request.body#<pointer>/@<n>). The branch the example sends is found by schema match, not by comparing values.finally. TypeScript and Python have identical case IDs.Reviewed auth cases. A deps
authsection holds environment variable names only, never the values:UNSAFE_LIVE_CHECK; unknown path values getMISSING_RESOURCE_SOURCE.INVALID_REVIEWED_CONFIGgaps.Accurate gap codes.
POST /admin/reset401 is nowMISSING_CLEANUP, notNO_DOCUMENTED_REJECTION.GET /reports/{id}200 is nowMISSING_RESOURCE_SOURCE.Case ID vocabulary v4:
optional-omitted,variant,expired-credentials. Registry validation checks that avariantlocation points at an existing branch.CI quality gates (
scripts/coverage-summary.ts,src/report/quality-gates.ts):ci/coverage-baseline.{demo,kitchen-sink}.jsonlist every active case ID and every gap (code + operation + location). A lost case, or a gap the baseline does not list, fails the build until the PR updates the baseline with--write-baseline.finally, through a fixture teardown, or withremoveIfCreatedright after the request and before any assertion. Unit tests include negative cases on which the gate must fail.coverage-summaryartifact and also appears in the job summary.items+mewith all 9 fault modes.Gap codes
UNCOVERED_VARIANT×2 (kitchen sinkPOST/PUT /orders,payment);UNCONFIRMED_BUSINESS_RULEfor 403 (kitchen sinkGET /orders);NO_DOCUMENTED_REJECTION×2 (demo: login / reset 401).UNCONFIRMED_BUSINESS_RULE→MISSING_CLEANUP/MISSING_RESOURCE_SOURCE(demo login, reset, reports; kitchen sink cancel 202).INVALID_REVIEWED_CONFIGis reused for a badauthsection.Verification (local, CI-equivalent)
tsc, build, unit tests: 220 passed, 2 skipped (the oasdiff-only tests). 10 tests are new.stats/get/contractdefect fails;Limitations
?q=) is not part of the collection mapping yet.UNSAFE_LIVE_CHECK.oneOf/anyOf/ conditional subtrees, and arrays are varied at element 0 only.finally/ fixture / immediateremoveIfCreated); it cannot prove the API actually deleted the record. The run-time cleanup log covers that.