AntFleet

Disagreement · 7fd1739d-anthropic-0

Push step runs even when merge produced no commit, causing the workflow to fail

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

Primary finding

Push step runs even when merge produced no commit, causing the workflow to fail

highbughigh
  • .github/workflows/sync-upstream.yml:56-67
On a merge conflict the step runs `git add -A` then `git commit ... --no-verify || true`. If the working tree has nothing stageable that produces a different snapshot (e.g. a delete/delete or rename/rename conflict that resolves to identical content, or `git add -A` failing on a submodule conflict), the commit can fail. The `|| true` swallows that failure, so the workflow proceeds to push a branch whose tip equals an ancestor of upstream/main with no merge commit, or `git push` may succeed but the subsequent `gh pr create --base main --head $BRANCH` will fail with "No commits between main and $BRANCH". More importantly, even when the commit does succeed, conflict markers in tracked text files will be committed — but binary conflicts and submodule conflicts are silently lost. There is no verification that a commit was actually created before pushing.

Recommendation

After the conflict branch, check `git rev-parse HEAD` against the pre-merge SHA (or use `git diff --quiet HEAD@{1} HEAD`) and fail the step explicitly if no commit was produced. Do not swallow the commit failure with `|| true`.

Counterpart finding

Hardcoded upstream repo and branch names reduce robustness

mediummaintainabilityhigh
  • .github/workflows/sync-upstream.yml:33-34
  • .github/workflows/sync-upstream.yml:39
  • .github/workflows/sync-upstream.yml:54
  • .github/workflows/sync-upstream.yml:89
The workflow assumes the upstream default branch is named "main" and that the upstream repo location remains constant. If the upstream project renames its default branch or moves repositories, fetch/merge steps will fail. Similarly, creating a PR against "main" will be incorrect if the fork's default branch changes. These hardcoded values make the workflow brittle and prone to silent breakage when defaults change.

Recommendation

Parameterize both the upstream repository and branch, and the fork base branch. - Define env vars or workflow inputs, e.g.: - env: BASE_BRANCH: ${{ github.event.repository.default_branch }} - env: UPSTREAM_REPO: aaronjmars/aeon (or from a repository variable) - env: UPSTREAM_BRANCH: main (or discover via GitHub API or `git remote show upstream`) - Replace occurrences: - `git fetch upstream main` -> `git fetch upstream "$UPSTREAM_BRANCH"` - `git rev-list --count HEAD..upstream/main` -> `...HEAD..upstream/$UPSTREAM_BRANCH` - `git merge --no-edit upstream/main` -> `... upstream/$UPSTREAM_BRANCH` - `gh pr create --base main` -> `--base "$BASE_BRANCH"`

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 →