Skip to content

Fix auto-merge green on error - #131

Merged
ppenna merged 1 commit into
mainfrom
fix/auto-merge-retry
Aug 13, 2026
Merged

Fix auto-merge green on error#131
ppenna merged 1 commit into
mainfrom
fix/auto-merge-retry

Conversation

@ada-x64

@ada-x64 ada-x64 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Auto-merge returns green on error. This fixes that. Also adds a 3-round retry for transient errors and a post-op check to ensure the merge succeeded.

Copilot AI lite review requested due to automatic review settings August 13, 2026 16:27
@ada-x64
ada-x64 requested a review from ppenna as a code owner August 13, 2026 16:27
@ada-x64
ada-x64 removed the request for review from ppenna August 13, 2026 16:28

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.

Pull request overview

Updates the auto-merge workflow step so that automation PR merges fail the job when the merge does not actually succeed, preventing “green” CI outcomes on merge errors. It also adds a bounded retry loop and verifies merge success via server state.

Changes:

  • Add a 3-attempt retry loop around gh pr merge for automation PRs.
  • Verify merge success via gh pr view ... --json merged and fail the job if not merged after retries.
  • Emit warnings per failed merge attempt and a final error on failure.

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

Comment thread .github/workflows/nanvix-ci.yml Outdated
Comment thread .github/workflows/nanvix-ci.yml Outdated
MERGE_ERR="$(mktemp)"
while [ "$n" -le "$ATTEMPTS" ]; do
gh pr merge "$PR_NUMBER" --repo "$REPO" --merge --admin --delete-branch \
|| echo "::warning::Auto-merge attempt $n/$ATTEMPTS failed for PR #$PR_NUMBER"

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.

Should we make it error out? If not, why not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is attempt 1 of N. If it continues to fail, then the loop proceeds to line 1404 where it exits 1. It warns here instead of failing to catch transient errors that a retry would fix, e.g. the 504 error we saw in cpython.

@ppenna
ppenna merged commit 7ec7538 into main Aug 13, 2026
2 checks passed
@ppenna
ppenna deleted the fix/auto-merge-retry branch August 13, 2026 17:45
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.

3 participants