ci(guard): fail PRs that roll a vendor/* submodule pointer backwards (B44 prevention) - #5133
Closed
graycyrus wants to merge 1 commit into
Closed
ci(guard): fail PRs that roll a vendor/* submodule pointer backwards (B44 prevention)#5133graycyrus wants to merge 1 commit into
graycyrus wants to merge 1 commit into
Conversation
…(B44 prevention) Add a Vendor Gitlink Guard CI lane that fails any PR moving a vendor/* git-submodule gitlink BACKWARDS (head SHA is an ancestor of the base SHA, or the two diverge with head not descending from base). Forward moves and unchanged pointers pass. This is the prevention half of B44: PR tinyhumansai#5114 branched off a stale main and rolled vendor/tinyagents 2.1.0 -> 1.9.0 while Cargo.toml still required 'tinyagents = "2.1"', an unsatisfiable skew that broke main's compile. The compile break was fixed in tinyhumansai#5128; this guard stops it recurring silently. - scripts/ci/check-vendor-gitlink.mjs: pure move classifier + git ancestry resolution (submodule update + origin fetch + merge-base --is-ancestor), crystal-clear failure message with exact remediation, and a --self-test. - .github/workflows/ci-lite.yml: new blocking 'Vendor Gitlink Guard' job, wired into pr-ci-gate.needs and its results map. - CONTRIBUTING.md: note to re-sync submodules after merging main. See my_docs/flows_workflow_bugs.md (B44).
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
12 tasks
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.
Summary
vendor/*git-submodule pointer backwards.my_docs/flows_workflow_bugs.md): stale-tree submodule-pointer drift that repeatedly brokemain. The compile break itself was already fixed in fix(flows): repair main compile break from crossed PRs #5128 — this PR stops it recurring silently.PR CI Gate; no Rust/product code changes.Problem
The superproject records each
vendor/*submodule as a gitlink SHA. A PR branched off an oldmain— from before a dependency bump advanced a gitlink — carries the stale SHA in its tree. On merge that stale tree rolls the gitlink backwards while the newCargo.tomlversion requirement stays put → an unsatisfiable version skew →mainstops compiling and every open flows PR goes red.Concretely (B44): PR #5114 rolled
vendor/tinyagentsback from a 2.1.0-compatible commit (2583fcc) to a 1.9.0 commit (19dc2c4) whileCargo.tomlstill requiredtinyagents = "2.1"→ theSqliteCheckpointer: Checkpointertrait mismatch → broken build. It recurred when re-merging main into two PRs the same day. Nothing in CI flagged the backward roll.Solution
How the guard detects a backward move. Per
vendor/*submodule it reads the gitlink SHA recorded on the PR head (git rev-parse HEAD:<path>) and on the base branch (git rev-parse origin/<base>:<path>), then classifies:How it gets ancestry in CI.
merge-base --is-ancestorneeds both commits in the submodule's object store. On a backward roll the base commit is a descendant of the checked-out head, so it isn't present — the script runsgit submodule update --initfor eachvendor/*submodule (per-vendor, so the largetauri-ceffork is never cloned) and thengit -C vendor/<name> fetch origin(plus a targeted per-SHA fetch fallback) to bring the base commit in. If ancestry still can't be resolved it fails closed — a guard that shrugs is worse than none.Failure output names the submodule, both SHAs, whether it's a backward vs diverged move, and the exact remediation:
git checkout origin/main -- vendor/<name> && git commit --amend+git submodule update --init --recursive.Wiring. New
vendor-gitlink-guardjob inci-lite.yml(runs on PRs tomain/release), added topr-ci-gate.needsand its results map so the existing required PR CI Gate check blocks the merge — mirroring thefeature-forwarding-gatepattern. Not filtered onchanges: a stale tree can roll a gitlink without touching any watched path, and a skipped job counts as a pass.Verification (local, before push):
--self-testtruth table pins all five classifier branches (also runs as a CI step).tinyagents 2583fcc → 19dc2c4) through the full git-ancestry path → guard exits 1 with the backward-move message.git diff origin/main -- vendor/is clean.Submission Checklist
--self-testtruth table covers pass (equal/forward/new) and fail (backward/diverged); runs as a CI stepN/A: CI-config + a Node CI script only; no Vitest/cargo-llvm-cov instrumented source changed (no lcov-covered lines)N/A: CI-infrastructure change, no user-facing feature row## Related—N/A: no matrix feature affectedvendor/*submodule origins already fetched by other CI lanesN/A: does not touch release-cut runtime surfacesCloses #NNN—N/A: tracked inmy_docs/flows_workflow_bugs.md(B44), no GitHub issueImpact
main-breaking class of failure (backward vendor submodule rolls).Related
my_docs/flows_workflow_bugs.md); compile fix was fix(flows): repair main compile break from crossed PRs #5128.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
ci/vendor-gitlink-guardcd38b529c8f09a2b48219608ce809d02c47a132cValidation Run
pnpm --filter openhuman-app format:check— N/A: noapp/srcfiles changedpnpm typecheck— N/A: no TypeScript changednode scripts/ci/check-vendor-gitlink.mjs --self-test(all pass) + simulated B44 backward roll → guard fails as expectedValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
vendor/*submodule pointer backwards now fail CI.Parity Contract
Duplicate / Superseded PR Handling