[JUM-910][Chore] Stop test-map.json from conflicting on every PR - #544
Merged
Merged
Conversation
JUM-910. test-map.json is fully generated (deterministic filesystem walk + sort), so any two branches touching test files diverge and conflict on merge even when neither is wrong — this hit every PR in the docs epic. setup-git-merge-drivers.js (run from `prepare`, so every clone self-registers on `bun install`) registers a merge driver that keeps "ours" instead of a textual 3-way merge, so a spurious conflict here can never block a merge. Verified this is safe by reproducing a real two-branch conflict: a first design that regenerated *inside* the driver silently produced an incomplete manifest, because a merge driver isn't guaranteed the full merged tree is checked out to disk yet. The shipped design instead defers to test-map:check, now part of ci:gate:static (previously only in the strict dev/main matrix), so every branch-gate preflight fails closed on the resulting staleness until `test-map:generate` runs for real. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_30116cc3-5c4c-4851-9fb5-f569004f7bca) |
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
test-map.jsonis fully generated (deterministic filesystem walk + sort), so any two branches touching test files diverge and textually conflict on merge even when neither is wrong — this hit every PR in the docs epic (JUM-895/896/907/908 each needed a manualgit merge origin/dev+ conflict resolution here).ci-cd/setup-git-merge-drivers.js(new, run fromprepare— self-registers onbun installin every clone/worktree, no extra onboarding step) registers a git merge driver fortest-map.jsonthat keeps "ours" instead of a textual 3-way merge, so a conflict here can never block a merge.test-map:checkmoves intoci:gate:static(previously only in the full/strictdev/mainmatrix), so every branch-gate preflight — including plain task branches — fails closed immediately on the resulting staleness, forcingbun run test-map:generatebefore it can be pushed.Why "keep ours" instead of regenerating inside the driver
Verified this empirically, not by assumption: a first design tried to regenerate the file inside the merge driver. Reproducing a real two-branch conflict showed it silently produced an incomplete manifest — missing the other branch's new test file — because a merge driver is not guaranteed the full merged tree is checked out to disk yet. The shipped design avoids that hazard entirely by never trusting driver-time disk state; it defers to
test-map:checkrunning after the merge fully completes.Test plan
test-map.jsonconflict between two scratch branches twice (once per driver design) to prove the fix, not just plausibility.bun run test-map:check— passes clean.bun run lint(root) — clean.bun run ci:gate:static— all green, including the newtest-map:checkstep.bun install.🤖 Generated with Claude Code
Note
Low Risk
Developer workflow and CI gate wiring only; correctness still enforced by test-map:check, with no runtime or auth changes.
Overview
Stops merge-blocking conflicts on generated
test-map.jsonwhen parallel branches both touch tests, without silently shipping a wrong manifest..gitattributesassignstest-map.jsona custom merge driver (keep-ours-test-map) so Git keeps the current branch’s copy instead of doing a textual 3-way merge.ci-cd/setup-git-merge-drivers.jsregisters that driver in local git config (true— no in-driver regeneration). It runs fromprepareafterhusky, sobun installsets it up on every clone/worktree.ci:gate:staticnow includestest-map:check, so branch preflights fail until someone runstest-map:generateon a fully checked-out tree after a merge that left a stale map.Reviewed by Cursor Bugbot for commit 27eb055. Bugbot is set up for automated code reviews on this repo. Configure here.