Skip to content

Stop building documents the contract refuses, and watch its master - #87

Merged
rasuvaeff merged 1 commit into
masterfrom
fix/documents-the-compiler-refuses
Sep 6, 2026
Merged

Stop building documents the contract refuses, and watch its master#87
rasuvaeff merged 1 commit into
masterfrom
fix/documents-the-compiler-refuses

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

This suite is green against rasuvaeff/openapi-contract 0.7.x and was red
against its master — 698 passed, 6 failed, 4 errors of 708. Not a regression
over there: the ten tests build deliberately malformed documents through
Contract::fromArray(), and that package now refuses them where they are
written.

Cluster Was Is
BodyContracts::multipart() carried 'X-Malformed' => 'ignored' and 7 => [...] inside encoding.title.headers four tests died at fromArray() the fixture is a document that compiles; the two declarations moved to skipsPartHeaderDeclarationsItCannotRead, which hands the generator an Operation built by hand
rejectsAPartContentTypeMismatchItCannotConstruct compiled each dataset six datasets never reached the generator the operation is built by hand, so all fifteen datasets reach the refusal they are named for

A hand-built Operation is not a workaround: it is the only way those shapes
can still arrive, since a compiled contract can no longer carry them, and both
forOperation() and partContentTypeMismatchForOperation() take one by
signature. 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-master job runs this suite against that branch on every relevant
PR, continue-on-error on purpose: the contract's master is allowed to be
ahead of what this package supports, so a red result is a heads-up rather than
a verdict. AGENTS.md records both that and the pre-release ritual of running
each package's suite against the other.

Verification: composer build green (709 tests, 29 491 assertions),
composer rector clean, and the cross-check script from the monorepo
(docs/reviews/probe-openapi-contract-2026-09-06/pto-against-master.sh) green.

Fixes #86

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
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 911c3b20-32e1-41a7-ba84-7dd114d7a554

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rasuvaeff
rasuvaeff merged commit b7a0d35 into master Sep 6, 2026
12 checks passed
@rasuvaeff
rasuvaeff deleted the fix/documents-the-compiler-refuses branch September 6, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests build documents the contract compiler no longer accepts

1 participant