From 94e7a6508c2160e710b30e05f60946572eb3d50a Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Sat, 2 May 2026 16:57:30 -0700 Subject: [PATCH] fix: [#781] marker-guard non-strict on bridge-merge push to main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PR-side marker-guard already runs in non-strict mode for `upstream/merge-*` head_refs, but after a squash-merge of that PR, the push event to main has no head_ref / second-parent / branch-name signal — it falls back to `--strict` and fails on the hundreds of upstream files the bridge merge brings in (98 false-positive warnings on the v1.4.0 bridge merge, run 25264283463). Detect bridge / upstream-merge commits in the pushed range by subject (`grep -qiE '(bridge|merge) upstream'`) and downgrade strict->non-strict for those pushes. Warnings still surface in job output; the PR-side review already gated marker integrity for the change. Validated locally: - regex matches commit 3cc3d4cb68 (v1.4.0 bridge merge) - analyze.ts --markers --base exits 0 (97 warnings shown) - --branding and --require-markers --strict both pass on main HEAD - marker-parser tests: 22/22 passing - ci.yml is valid YAML Closes #781 --- .github/workflows/ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad772f1cb..fdb63be6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -441,8 +441,18 @@ jobs: echo "Initial push (zero-SHA) — skipping marker check" exit 0 fi - echo "Push to main — running marker check against pre-push state" - bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}" --strict + # Squash-merging an `upstream/merge-*` PR lands as a single commit + # on main, so the second-parent / branch-name signal is gone here. + # Detect bridge/merge-upstream commits in the pushed range by subject + # and downgrade to non-strict — the PR-side review already gated this. + if git log --format=%s "${{ github.event.before }}..${{ github.sha }}" \ + | grep -qiE '(bridge|merge) upstream'; then + echo "Bridge/upstream-merge commit detected in push range — running marker check in non-strict mode" + bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}" + else + echo "Push to main — running marker check against pre-push state" + bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}" --strict + fi elif [[ "${{ github.head_ref }}" == merge-upstream-* ]] || [[ "${{ github.head_ref }}" == upstream/merge-* ]]; then echo "Upstream merge PR detected — running marker check in non-strict mode" bun run script/upstream/analyze.ts --markers --base ${{ github.event.pull_request.base.ref }}