Skip to content

fix(ci): resolve dev-to-main promotion merge conflicts and whitespace false-positives - #2152

Merged
tamirdresher merged 2 commits into
github:devfrom
tamirdresher:tamirdresher-microsoft-laughing-barnacle
Oct 2, 2026
Merged

tamirdresher merged 2 commits into
github:devfrom
tamirdresher:tamirdresher-microsoft-laughing-barnacle

Conversation

@tamirdresher

Copy link
Copy Markdown
Collaborator

Why

squad-promote.yml's dry-run dispatch (run 37045899886) failed with ~76 unresolved dev→main merge conflicts, blocking the v1.0.0 promotion (#2150 merged to dev at f65ade9).

Root causes found (not a human-judgment-required case — all mechanical)

  1. ~51 spurious conflicts: git's rename-detection heuristic falsely paired new template/charter files on dev (absent at merge-base) with unrelated files independently deleted on main. Fix: add -X no-renames to the merge.
  2. ~25 remaining conflicts: genuine delete(main)/modify(dev) conflicts purely on .squad//.ai-team/-type paths that the script's own next step strips from the release tree regardless of merge outcome — not a real decision. Fix: move that git rm --cached cleanup to run before the unresolved-conflict check.
  3. 1 conflict: .github/workflows/squad-preview.yml was SHA-pin-hardened independently on main while deliberately removed on dev (8361274 "finalize preview and stable release channels", which folded its logic into squad-release.yml). Fix: explicitly accept dev's removal.

Also fixes a second, independent latent blocker that would hit the real v1.0.0 promotion even after the conflicts above are resolved: git diff --cached --check flags every added line in the repo's ~95 intentionally CRLF-encoded .ts files (documented in .gitattributes, kept CRLF to avoid a disruptive renormalization commit) as "trailing whitespace." Fixed by running that check with core.whitespace=cr-at-eol, which still catches real trailing-space/tab and blank-line-at-EOF issues — and did catch one real one: a stray trailing blank line in test/gh-aw-hosted-e2e.test.ts, now removed (141/141 tests for that file still pass via vitest).

Validation

Reproduced and fixed against live origin/main/origin/dev in an isolated clone (not just this worktree, to rule out local working-tree contamination):

  • Baseline (no fix): git merge origin/dev --no-commit --no-ff -X theirs → 76 unresolved conflicts (matches the real CI failure).
  • With -X no-renames: 25 unresolved conflicts (all .squad/** + squad-preview.yml).
  • With the full fixed sequence (merge → git rm cleanup → git rm for squad-preview.yml): 0 unresolved conflicts, 0 forbidden paths remaining.
  • git -c core.whitespace=cr-at-eol diff --cached --check: clean after the test-file fix (confirmed it correctly still flags the real blank-line issue before that fix was applied).

Not yet validated: a real GitHub Actions dry-run dispatch of the updated workflow (next step after this merges).

Closes the promotion blocker reported from run 37045899886.

…espace failures

squad-promote.yml's dev-to-main merge (-X theirs) was failing with ~76
unresolved conflicts, diagnosed down to concrete, mechanical causes:

1. Git's rename-detection heuristic falsely paired newly-added template/
   charter files (new on dev, absent at merge-base) with unrelated files
   independently deleted on main, producing ~51 spurious conflicts. Fix:
   add -X no-renames.

2. The remaining ~25 conflicts were genuine delete(main)/modify(dev)
   conflicts purely on .squad/.ai-team/etc paths that the script's own
   next step deletes from the release tree regardless of merge outcome.
   Fix: run that git rm --cached cleanup before the unmerged-conflict
   check instead of after, so these non-decisions don't block the merge.

3. .github/workflows/squad-preview.yml was hardened independently on
   main while being deliberately removed on dev as part of the preview/
   stable release-channel consolidation (8361274, which folded its
   logic into squad-release.yml). Fix: accept dev's removal explicitly.

Also fixes a second, independent latent blocker that would hit the real
v1.0.0 promotion even after the conflicts above are resolved: the
'git diff --cached --check' validation step flags every added line in
the repo's ~95 intentionally CRLF-encoded .ts files (see .gitattributes)
as 'trailing whitespace', since they're deliberately excluded from
eol=lf normalization to avoid a disruptive renormalization commit. Fix:
run the check with core.whitespace=cr-at-eol, which still catches real
trailing spaces/tabs and blank-line-at-EOF issues.

That real issue was present too: test/gh-aw-hosted-e2e.test.ts had one
stray trailing blank line at EOF, now removed (141/141 tests still pass
for that file via vitest).

Validated end-to-end against live origin/main and origin/dev in an
isolated clone: merge -X theirs -X no-renames -> git rm cleanup for
.squad/.ai-team/etc -> git rm for squad-preview.yml yields 0 unresolved
conflicts, 0 forbidden paths remaining, and a clean cr-at-eol whitespace
check.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 18:39
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: base-controlled pull_request_target reporter.

⚠️ Architectural review: 1 info.

Severity Category Finding Files
ℹ️ info template-sync Template files changed in .github/workflows/ but not in other template locations. If these templates should stay in sync, consider updating the others too. Changed: .github/workflows/, Unchanged: templates/, .squad-templates/, packages/squad-cli/templates/

Automated architectural review — informational only.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #2152

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 3
Files added 0
Files modified 3
Files deleted 0
Modules touched 2

🎯 Risk Factors

  • 3 files changed (≤5 → LOW)
  • 2 modules touched (2-4 → MEDIUM)

📦 Modules Affected

ci-workflows (1 file)
  • .github/workflows/squad-promote.yml
tests (2 files)
  • test/gh-aw-hosted-e2e.test.ts
  • test/standalone-release-workflow.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 5029ea1

PR Scope: 🔧 Infrastructure

⚠️ 5 item(s) to address before review

Status Check Details
❌ Single commit 2 commits — consider squashing before review
✅ Not in draft Ready for review
❌ Branch up to date dev is 1 commit(s) ahead — rebase recommended
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present No source files changed — changeset not required
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
❌ Copilot threads resolved 1 unresolved Copilot thread(s) — fix and resolve before merging
❌ CI passing 11 check(s) still running

Files Changed (3 files, +35 −11)

File +/−
.github/workflows/squad-promote.yml +32 −9
test/gh-aw-hosted-e2e.test.ts +0 −1
test/standalone-release-workflow.test.ts +3 −1

Total: +35 −11


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The modified merge command breaks an existing regression assertion that must be updated.

1 open finding
What changed in this PR

Unblocks dev-to-main promotion for v1.0.0 by resolving mechanical merge conflicts and avoiding CRLF whitespace false positives.

Changes:

  • Disables rename detection and resolves intentional deletions before checking conflicts.
  • Allows CRLF endings while retaining whitespace validation.
  • Removes a trailing blank line from a test file.
File Description
test/​gh-aw-hosted-e2e.test.ts Removes a trailing blank line; test logic is unchanged.
.github/​workflows/​squad-promote.yml Adjusts promotion conflict handling and whitespace validation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

# don't exist at the merge-base; without this, git's rename-detection
# heuristic falsely pairs them with unrelated files independently
# deleted on main, producing spurious rename/delete conflicts.
git merge origin/dev --no-commit --no-ff -X theirs -X no-renames || true
The 'stable promotion' contract test hardcoded the exact pre-fix merge
command string ('git merge origin/dev --no-commit --no-ff -X theirs ||
true'). PR github#2152's fix added '-X no-renames' to that command to
eliminate spurious rename-detection-heuristic conflicts during the
dev-to-main sanitized merge, so the literal substring no longer
matched, failing CI run 37048896755.

Updated the expected string to match the new, intentional command:
'git merge origin/dev --no-commit --no-ff -X theirs -X no-renames ||
true'. Verified via
px vitest run test/standalone-release-workflow.test.ts
(32/32 passed).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tamirdresher
tamirdresher merged commit dbfe382 into github:dev Oct 2, 2026
18 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.

2 participants