chore(ci) Check the contract pin in the PR pipeline #29

Merged
araemer merged 1 commit from contract-pin-check into stage 2026-10-03 17:45:16 +00:00
Owner

Why

contract.ref pins 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 enter stage, the pin must be on platform main and must not fall behind the pin already on stage. See the ADR in recipe-platform: docs/adr/2026-10-03-contract-pin.md (branch contract-pin).

What

A new, separate job contract_pin in .forgejo/workflows/pr_check.yaml. It clones this repo at the PR head and recipe-platform (full clone), the same way the test job does, and runs two checks:

  • check_pin_on_platform_main — the commit in contract.ref must be an ancestor of (or equal to) platform origin/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 — reads contract.ref from 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 no contract.ref (currently main, until the first release that carries the pin), the comparison is skipped with a message.

The existing test job 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; only contract_pin is red in that phase.

Re-run needed: nothing in this repo changes when a platform contract PR is merged, so the contract_pin check has to be re-run by hand afterwards.

build_stage.yaml and build_release.yaml are not changed. CLAUDE.md documents the check in the paragraph about contract.ref.

Verification

Locally, with a throwaway platform clone and real refs: a pin on main passes 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 no contract.ref. This PR's own pipeline is the proof in CI: the pin equals the pin on stage, so both checks run and pass.

🤖 Generated with Claude Code

## Why `contract.ref` pins 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 enter `stage`, the pin must be on platform `main` and must not fall behind the pin already on `stage`. See the ADR in recipe-platform: [docs/adr/2026-10-03-contract-pin.md](https://git.raemer.net/araemer/recipe-platform/src/branch/contract-pin/docs/adr/2026-10-03-contract-pin.md) (branch `contract-pin`). ## What A new, separate job `contract_pin` in `.forgejo/workflows/pr_check.yaml`. It clones this repo at the PR head and `recipe-platform` (full clone), the same way the `test` job does, and runs two checks: - **`check_pin_on_platform_main`** — the commit in `contract.ref` must be an ancestor of (or equal to) platform `origin/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`** — reads `contract.ref` from 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 no `contract.ref` (currently `main`, until the first release that carries the pin), the comparison is skipped with a message. The existing `test` job 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; only `contract_pin` is red in that phase. **Re-run needed:** nothing in this repo changes when a platform contract PR is merged, so the `contract_pin` check has to be re-run by hand afterwards. `build_stage.yaml` and `build_release.yaml` are not changed. `CLAUDE.md` documents the check in the paragraph about `contract.ref`. ## Verification Locally, with a throwaway platform clone and real refs: a pin on `main` passes 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 no `contract.ref`. This PR's own pipeline is the proof in CI: the pin equals the pin on `stage`, so both checks run and pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore(ci) Check the contract pin in the PR pipeline
All checks were successful
/ test (pull_request) Successful in 1m18s
/ contract_pin (pull_request) Successful in 11s
506ed14d4e
Adds a separate job contract_pin to pr_check.yaml. It passes only when the
commit in contract.ref is on recipe-platform main and is not older than the
pin on the PR's base branch. Build and tests keep their own job and status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
araemer merged commit 2f69ac10d8 into stage 2026-10-03 17:45:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
araemer/recipe-backend!29
No description provided.