Conversation
1748e59 to
a6b508a
Compare
There was a problem hiding this comment.
Pull request overview
Adds automation and guardrails for upstream merge workflows (via mergai) and introduces a /fast-forward comment-driven merge workflow, while also hardening existing CI workflows against PR label race conditions.
Changes:
- Add
.mergaiconfiguration and invariants documentation to guide automated merge picking and conflict resolution. - Add GitHub Actions workflows for
mergaiautomation and fast-forward merges. - Update
formatandclang-tidyworkflows with concurrency + an API-based skip-label gate to avoid label timing races.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
.mergai/invariants.md |
New documented invariants and conflict-resolution hints for merges. |
.mergai/config.yml |
New mergai configuration (upstream sync + merge-pick strategies + resolve settings). |
.github/workflows/mergai.yml |
New workflow to run mergai merge/resolve and post PRs. |
.github/workflows/format.yml |
Add concurrency + API-fetched label gating for skip logic. |
.github/workflows/clang-tidy.yml |
Add concurrency + API-fetched label gating; adjusts job dependencies. |
.github/workflows/fast-forward.yml |
New comment-triggered fast-forward merge workflow using a GitHub App token. |
.github/actions/setup-mergai/action.yml |
New composite action to checkout/install mergai via pipx. |
.github/actions/setup-mergai-workflow/action.yml |
New composite action to set up git credentials + optional GCP/Node/Gemini + mergai init. |
Comments suppressed due to low confidence (2)
.github/workflows/clang-tidy.yml:16
gh api .../pulls/...requirespull-requests: readpermission. This workflow sets explicitpermissions:without granting it, so the label check can fail and skip logic becomes unreliable. Addpull-requests: read(or broaden permissions appropriately).
permissions:
contents: read
security-events: write
.github/workflows/clang-tidy.yml:72
actions/checkout@v6is not a valid release ofactions/checkout(current major is v4). This will fail at runtime; useactions/checkout@v4here to match the rest of the workflow.
- name: Checkout
uses: actions/checkout@v6
with:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,27 @@ | |||
| ## Project Invariants | |||
There was a problem hiding this comment.
This might need an update. That is a proposal.
| # | ||
| # To change priorities, simply reorder the strategies in the list. | ||
| # | ||
| merge_picks: |
There was a problem hiding this comment.
This section is a proposal. Please comment your suggestions.
| # mergai finalize --mode <squash|keep|fast-forward> | ||
| # | ||
| # Default: "squash" | ||
| mode: squash |
There was a problem hiding this comment.
This will squash all commits. The alternative is fast-forward which would just skip the PR merge commit. However, this means there would be a commit with conflict markers, followed by a commit(s) removing them.
IMHO the best option would be to combine these - suqash only commits created by the mergai or the ones which remove the conflict markers - but this is not implemented yet.
| gcp-credentials: ${{ secrets.GCP_CREDENTIALS }} | ||
| github-app-token: ${{ steps.app-token.outputs.token }} | ||
| github-app-id: ${{ secrets.GH_APP_ID }} | ||
| mergai-ref: master |
There was a problem hiding this comment.
master currently but will change that to v0.1.0 once the review is done.
c653af2 to
c121ee4
Compare
Add a gate job that fetches current PR labels via the GitHub API to avoid race conditions where the 'opened' event triggers before labels are applied. The main jobs now depend on this gate job and only run if the skip label is not present. Also add concurrency control to cancel in-progress runs when new PR events occur, preventing duplicate runs on rapid pushes.
c121ee4 to
3e157a9
Compare
|
All secrets defined. Unfortunately, I am not able to verify if the workflow is working on this repo because the workflow must exist on the default branch to execute it. The only remaining piece is the definition of the protected environment for github actions which is WIP. Please also check the mergai: https://github.com/Percona-Lab/mergai used by the workflow. |
No description provided.