Skip to content

[JUM-910][Chore] Stop test-map.json from conflicting on every PR - #544

Merged
web2solutions merged 1 commit into
devfrom
claude/chore/JUM-910-test-map-merge-driver
Sep 27, 2026
Merged

web2solutions merged 1 commit into
devfrom
claude/chore/JUM-910-test-map-merge-driver

Conversation

@web2solutions

@web2solutions web2solutions commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • test-map.json is 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 manual git merge origin/dev + conflict resolution here).
  • ci-cd/setup-git-merge-drivers.js (new, run from prepare — self-registers on bun install in every clone/worktree, no extra onboarding step) registers a git merge driver for test-map.json that keeps "ours" instead of a textual 3-way merge, so a conflict here can never block a merge.
  • test-map:check moves into ci:gate:static (previously only in the full/strict dev/main matrix), so every branch-gate preflight — including plain task branches — fails closed immediately on the resulting staleness, forcing bun run test-map:generate before 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:check running after the merge fully completes.

Test plan

  • Reproduced a real test-map.json conflict 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 new test-map:check step.
  • Confirmed the merge driver is visible from a sibling worktree (shared git config), so no extra setup is needed once this merges and clones run 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.json when parallel branches both touch tests, without silently shipping a wrong manifest.

.gitattributes assigns test-map.json a 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.js registers that driver in local git config (true — no in-driver regeneration). It runs from prepare after husky, so bun install sets it up on every clone/worktree.

ci:gate:static now includes test-map:check, so branch preflights fail until someone runs test-map:generate on 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.

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

cursor Bot commented Sep 26, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@web2solutions
web2solutions merged commit a45b531 into dev Sep 27, 2026
36 of 37 checks passed
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.

1 participant