Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# Auto detect text files and perform LF normalization
* text=auto

# Generated from the current test tree (ci-cd/generate-test-map.js). Two
# branches that both touch test files textually conflict on this file even
# when neither is wrong, so conflicts here keep "ours" instead of blocking
# (driver registered by `prepare` — ci-cd/setup-git-merge-drivers.js);
# `test-map:check` (in `ci:gate:static`) fails closed on the resulting
# staleness until `test-map:generate` runs for real.
test-map.json merge=keep-ours-test-map
36 changes: 36 additions & 0 deletions ci-cd/setup-git-merge-drivers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable no-console */
const { execFileSync } = require('child_process');

/**
* `test-map.json` is a pure function of the current test tree, regenerated by
* its own `test-map:generate` script — so a textual 3-way merge on it
* conflicts whenever two branches both touch test files, even when neither
* branch's content is actually wrong.
*
* The driver does NOT regenerate the file itself: a merge driver runs mid-merge,
* before git guarantees every other path in the same merge is checked out to
* disk (proven empirically — a driver that shelled out to the generator here
* silently produced a manifest missing the other side's new test file, with
* no conflict marker to catch it). Instead the driver just keeps the current
* branch's version (`true`, exit 0, %A untouched) so a real conflict never
* blocks the merge; `test-map:check` — now part of `ci:gate:static`, which
* every branch-gate preflight runs (JUM-903) — catches the resulting
* staleness immediately and fails closed until `test-map:generate` runs for
* real, against a fully checked-out tree.
*
* Git looks up drivers in local (untracked) config, so every clone must
* register them once; this runs from `prepare` (already invoked by
* `bun install` on every clone/worktree) so no extra onboarding step is needed.
*/
const DRIVERS = [
{
name: 'keep-ours-test-map',
command: 'true'
}
];

for (const driver of DRIVERS) {
execFileSync('git', ['config', `merge.${driver.name}.name`, `keep ours for ${driver.name}; test-map:check catches staleness`]);
execFileSync('git', ['config', `merge.${driver.name}.driver`, driver.command]);
console.log(`[setup-git-merge-drivers] registered merge.${driver.name}`);
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"docs:consumers:package-scripts": "bun tooling/scripts/generate-consumer-package-scripts-docs.mjs",
"docs:check-current-governance": "bun ci-cd/check-current-governance-docs.js",
"docs:check-audience": "bun ci-cd/check-documentation-audience.js",
"prepare": "husky",
"prepare": "husky && node ci-cd/setup-git-merge-drivers.js",
"changelog:update": "bun ci-cd/update-changelog.js",
"changelog:check": "bun ci-cd/update-changelog.js --check",
"oas:check-routes": "bun ci-cd/check-oas-route-resolution.js",
Expand Down Expand Up @@ -86,7 +86,7 @@
"ci:gate": "bun run check-bun-version && bun run deps:check-overrides && bun run deps:audit && bun run lint && bun run deps:check-cycles && bun run arch:check-boundaries && bun run arch:check-users-legacy-imports && bun run arch:check-workspace-boundaries && bun run arch:check-ownership-placement && bun run arch:check-http-adapters && bun run workspace:check-quality && bun run workspace:check-coverage-policy && bun run release:governance:check && bun run governance:check-authorship && bun run requirements:check && bun run docs:check-current-governance && bun run docs:check-audience && bun run packages:check-suites && bun run packages:check-build-freshness && bun run cli:check-template-freshness && bun run website:check-content-routes && bun run rtdb:check-indexes && bun run test:integrity && bun run test-map:check && bun run ci:check-provider && bun run ci:check-third-party-review && bun run integrations:check && bun run integration-migration:check && bun run agent-registry:check && bun run test:unit && bun run frontend:test:coverage && bun run frontend:coverage:check && bun run ci:security-smoke && bun run oas:check-routes && bun run oas:check-relations && bun run serverless:check-handlers && bun run build:dev && bun run ci:smoke",
"ci:gate:branch": "bun ci-cd/run-branch-quality-gate.js",
"ci:gate:task": "bun run workspace:build:packages && bun ci-cd/run-task-change-tests.js",
"ci:gate:static": "bun run deps:check-overrides && bun run deps:audit && bun run arch:check-http-adapters && bun run governance:check-authorship && bun run packages:check-suites && bun run packages:check-build-freshness && bun run cli:check-template-freshness && bun run website:check-content-routes && bun run rtdb:check-indexes && bun run ci:check-provider && bun run oas:check-relations",
"ci:gate:static": "bun run deps:check-overrides && bun run deps:audit && bun run arch:check-http-adapters && bun run governance:check-authorship && bun run packages:check-suites && bun run packages:check-build-freshness && bun run cli:check-template-freshness && bun run website:check-content-routes && bun run rtdb:check-indexes && bun run test-map:check && bun run ci:check-provider && bun run oas:check-relations",
"ci:gate:strict": "bun ci-cd/run-full-test-matrix.js",
"ci:gate:generated-automation": "bun ci-cd/check-generated-automation-pr.js",
"dev": "bun run pm2:start:dev:restapi",
Expand Down
Loading