AntFleet

Disagreement · 0a8afccf-anthropic-1

Merge-conflict commit may be empty and is silently swallowed, producing a push with no merge commit

mismatch
repo 6f7fc663·PR #17·reviewed 1 week ago

Primary finding

Merge-conflict commit may be empty and is silently swallowed, producing a push with no merge commit

mediumbugmedium
  • .github/workflows/sync-upstream.yml:68-75
When `git merge` fails with conflicts, the working tree has conflict markers and `MERGE_HEAD` is set. `git add -A` stages the conflicted files. `git commit ... || true` will succeed in the normal case, but if for any reason the commit fails (e.g. pre-existing commit hook, empty index after add, or git refusing to commit during an active merge state in some configurations), the `|| true` masks the failure. The subsequent `git push` step will then push the branch *without* the merge commit, and the PR will be opened claiming conflicts exist while the branch actually contains no upstream changes at all — a misleading PR. Additionally, if conflicts include deletions vs. modifications, `git add -A` alone may not stage everything as expected.

Recommendation

Remove `|| true` and explicitly check `$?`; if commit fails, fail the job loudly instead of pushing an empty/misleading branch. Also verify `git status` shows a clean tree post-commit before pushing.

Counterpart finding

Reusing date-based branch name can cause non-fast-forward push failures if an existing sync branch diverged

mediummaintainabilitymedium
  • .github/workflows/sync-upstream.yml:51-53
  • .github/workflows/sync-upstream.yml:64-66
The branch name is reused for all runs on the same day. If a previous run opened a PR and maintainers (or CI) pushed additional commits to that branch, the next run creates a fresh local branch and attempts a non-forced push, which will fail with a non-fast-forward error. The workflow does not detect or handle this case, leading to intermittent failures and stale PRs.

Recommendation

Before creating the branch, check if the remote branch exists and base the local branch on it (e.g., `git fetch origin "$BRANCH" || true` and `git checkout -B "$BRANCH" origin/"$BRANCH"`), then merge upstream and push. Alternatively, make the branch name unique per run (include timestamp or upstream commit hash) and rely on PR auto-update using `gh pr create --fill --head "$BRANCH"` accordingly.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →