chore(ci) Check the contract pin in the PR pipeline #29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "contract-pin-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
contract.refpins the recipe-platform commit this repo builds against (#26). During development a feature branch may pin any pushed platform commit, including one on an unmerged platform contract branch. To enterstage, the pin must be on platformmainand must not fall behind the pin already onstage. See the ADR in recipe-platform: docs/adr/2026-10-03-contract-pin.md (branchcontract-pin).What
A new, separate job
contract_pinin.forgejo/workflows/pr_check.yaml. It clones this repo at the PR head andrecipe-platform(full clone), the same way thetestjob does, and runs two checks:check_pin_on_platform_main— the commit incontract.refmust be an ancestor of (or equal to) platformorigin/main. If not: "contract.ref is not on recipe-platform main yet. Merge the platform contract PR first, then re-run this check."check_pin_not_older_than_base— readscontract.reffrom the PR's base branch (FORGEJO_BASE_REF). The base branch's pin must be an ancestor of (or equal to) this branch's pin. If not: "contract.ref is older than the pin on the base branch. Take the base branch into this branch." If the base branch has nocontract.ref(currentlymain, until the first release that carries the pin), the comparison is skipped with a message.The existing
testjob is unchanged. Build and tests keep their own job and their own status, so a PR shows real build and test results while its pin is still on an unmerged platform contract branch; onlycontract_pinis red in that phase.Re-run needed: nothing in this repo changes when a platform contract PR is merged, so the
contract_pincheck has to be re-run by hand afterwards.build_stage.yamlandbuild_release.yamlare not changed.CLAUDE.mddocuments the check in the paragraph aboutcontract.ref.Verification
Locally, with a throwaway platform clone and real refs: a pin on
mainpasses check A, the tip of an unmerged platform branch fails it; check B passes for an older and for an equal base pin, fails for a newer base pin, and skips when the base branch has nocontract.ref. This PR's own pipeline is the proof in CI: the pin equals the pin onstage, so both checks run and pass.🤖 Generated with Claude Code