Skip to content

Evergreen: always merge main first, then fix CI as separate pushes#267

Merged
mrjf merged 2 commits into
mainfrom
copilot/evergreen-merge-main-first
May 4, 2026
Merged

Evergreen: always merge main first, then fix CI as separate pushes#267
mrjf merged 2 commits into
mainfrom
copilot/evergreen-merge-main-first

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

Evergreen treated merge_conflict and failing_checks as independent issues, so a CI-fix run could include a local main merge in its patch and conflict with the un-merged remote PR branch on push_to_pull_request_branch. This change makes "merge main first" an explicit, separate push that always precedes any CI fix.

Selector (pr_needs_attention)

  • New get_behind_by() helper hits GET /repos/{repo}/compare/{base}...{head} and reads behind_by.
  • Adds a behind_main: N commit(s) issue type so PRs behind main are picked up even when CI is green. Suppressed when merge_conflict is already flagged (the merge step covers both).

Workflow prompt

Replaces the two ad-hoc subsections with an ordered 5-step flow:

  1. If merge_conflict or behind_main, git fetch origin main + git merge origin/main, resolve, run local checks.
  2. Push Build tsb: pandas → TypeScript migration #1 — merge commit only, via push-to-pull-request-branch.
  3. Re-check CI on the new HEAD; drift-only failures end here.
  4. If still red: diagnose, fix, Push [Autoloop] [Autoloop: build-tsb-pandas-typescript-migration] #2 — fix commit only.
  5. Update repo-memory tracking + PR comment (mention both pushes when applicable).

Rules

  • New rule: always merge main as its own push; never bundle a main merge into a CI-fix patch — that's what causes the patch conflict.
  • New rule: one concern per push (merge push = merge only; fix push = fix only).
  • Tracking rule extended so a clean merge-only push also counts as success and resets the attempt counter.

evergreen.lock.yml regenerated via gh aw compile.

Copilot AI assigned Copilot and mrjf May 4, 2026
Copilot AI linked an issue May 4, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update Evergreen process to merge main before fixing CI Evergreen: always merge main first, then fix CI as separate pushes May 4, 2026
Copilot finished work on behalf of mrjf May 4, 2026 04:13
Copilot AI requested a review from mrjf May 4, 2026 04:13
@mrjf mrjf marked this pull request as ready for review May 4, 2026 15:11
@mrjf mrjf merged commit 5db2adf into main May 4, 2026
18 checks passed
@mrjf mrjf deleted the copilot/evergreen-merge-main-first branch May 4, 2026 21:57
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.

Evergreen: always merge main first, then fix CI

2 participants