fix(automerge): honor the latest green CI run #641

Open
gmackie wants to merge 1 commit from fix-automerge-checks into main
Owner

Summary

  • Auto-merge kept whichever CI row it read last, so an older failed forgejo:CI run could hide a later pass.
  • A required check named CI never matched the stored pipeline forgejo:CI. The newest run of a workflow now satisfies either name.
  • A Forgejo merge records merge_commit_sha when merged_commit_id is absent.

Tests

  • latestChecksFromBuilds covers a later pass, a later failure, the forgejo:ci alias, and a different required check.
  • evaluateAutoMergeAfterCI moves to merging when the passed forgejo:CI row is not the last row returned.
  • mergeViaForgejo reads merge_commit_sha.

32 tests passed in @forgegraph/api.

## Summary - Auto-merge kept whichever CI row it read last, so an older failed `forgejo:CI` run could hide a later pass. - A required check named `CI` never matched the stored pipeline `forgejo:CI`. The newest run of a workflow now satisfies either name. - A Forgejo merge records `merge_commit_sha` when `merged_commit_id` is absent. ## Tests - `latestChecksFromBuilds` covers a later pass, a later failure, the `forgejo:ci` alias, and a different required check. - `evaluateAutoMergeAfterCI` moves to merging when the passed `forgejo:CI` row is not the last row returned. - `mergeViaForgejo` reads `merge_commit_sha`. 32 tests passed in `@forgegraph/api`.
fix(automerge): honor the latest green CI run
All checks were successful
CI / gitleaks (pull_request) Successful in 14s
CI / storybook (pull_request) Successful in 2m32s
CI / web-build (pull_request) Successful in 4m7s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 13m24s
89964ad7ce
evaluateAutoMergeAfterCI kept whichever build row it read last, so an
older failed forgejo:CI run could hide a later pass. A required check
named CI also never matched the stored forgejo:CI pipeline.

Keep the newest run of each workflow, and treat forgejo:CI as CI.

Record Forgejo's merge_commit_sha when merged_commit_id is absent.
Author
Owner

Preview environment is live: https://pr-641-forgegraph.forgegraf.com

Deployed 89964ad7 with the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.

Preview environment is live: https://pr-641-forgegraph.forgegraf.com Deployed `89964ad7` with the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.
All checks were successful
CI / gitleaks (pull_request) Successful in 14s
Required
Details
CI / storybook (pull_request) Successful in 2m32s
CI / web-build (pull_request) Successful in 4m7s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 13m24s
Required
Details
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix-automerge-checks:fix-automerge-checks
git switch fix-automerge-checks
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gmackie/ForgeGraph!641
No description provided.