Stop building documents the contract refuses, and watch its master - #87
Merged
Conversation
This suite was green against `rasuvaeff/openapi-contract` 0.7 and red against its development branch: ten tests, all of them building deliberately malformed documents through `Contract::fromArray()` to pin a refusal of *this* package's generator. The contract now refuses those documents where they are written, so the tests died before reaching what they meant to test. The shared multipart fixture is a document that compiles again. The two header declarations it carried to exercise the generator's skip branches — a value that is not an object, a name that is not a string — moved to a test that hands the generator an `Operation` built by hand, which is the only way such a shape can still reach it and therefore the path worth pinning. `rejectsAPartContentTypeMismatchItCannotConstruct` builds its operation the same way, so all fifteen datasets reach the refusal they are named for. The suite is green against both the released contract and its master now, and a `Contract dev-master` job keeps it that way: it runs this suite against that branch on every relevant pull request without gating the build, because the contract's master may legitimately be ahead of what this package supports. The release ritual and the reason for it are in AGENTS.md. Fixes #86
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Warning Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice. 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. Comment |
This was referenced Sep 6, 2026
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.
This suite is green against
rasuvaeff/openapi-contract0.7.x and was redagainst its
master— 698 passed, 6 failed, 4 errors of 708. Not a regressionover there: the ten tests build deliberately malformed documents through
Contract::fromArray(), and that package now refuses them where they arewritten.
BodyContracts::multipart()carried'X-Malformed' => 'ignored'and7 => [...]insideencoding.title.headersfromArray()skipsPartHeaderDeclarationsItCannotRead, which hands the generator anOperationbuilt by handrejectsAPartContentTypeMismatchItCannotConstructcompiled each datasetA hand-built
Operationis not a workaround: it is the only way those shapescan still arrive, since a compiled contract can no longer carry them, and both
forOperation()andpartContentTypeMismatchForOperation()take one bysignature. The skip branches in
RequestCaseArbitrary::multipartHeaders()stay covered.
Green both ways now: 709 tests against the released contract and 709 against
its
master.And the reason it was invisible. The oracle between the two packages runs
one way — generated traffic is recorded into the contract's corpus, so the
contract notices changes here; nothing noticed a change there. The new
Contract dev-masterjob runs this suite against that branch on every relevantPR,
continue-on-erroron purpose: the contract's master is allowed to beahead of what this package supports, so a red result is a heads-up rather than
a verdict.
AGENTS.mdrecords both that and the pre-release ritual of runningeach package's suite against the other.
Verification:
composer buildgreen (709 tests, 29 491 assertions),composer rectorclean, and the cross-check script from the monorepo(
docs/reviews/probe-openapi-contract-2026-09-06/pto-against-master.sh) green.Fixes #86