Skip to content

PSMDB-1931: mergai workflow#1695

Open
plebioda wants to merge 6 commits intomasterfrom
PSMDB-1931-merging-workflow
Open

PSMDB-1931: mergai workflow#1695
plebioda wants to merge 6 commits intomasterfrom
PSMDB-1931-merging-workflow

Conversation

@plebioda
Copy link

No description provided.

@plebioda plebioda requested a review from Copilot February 23, 2026 16:28
@plebioda plebioda marked this pull request as draft February 23, 2026 16:28
@plebioda plebioda force-pushed the PSMDB-1931-merging-workflow branch from 1748e59 to a6b508a Compare February 23, 2026 16:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 .mergai configuration and invariants documentation to guide automated merge picking and conflict resolution.
  • Add GitHub Actions workflows for mergai automation and fast-forward merges.
  • Update format and clang-tidy workflows 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/... requires pull-requests: read permission. This workflow sets explicit permissions: without granting it, so the label check can fail and skip logic becomes unreliable. Add pull-requests: read (or broaden permissions appropriately).
permissions:
  contents: read
  security-events: write

.github/workflows/clang-tidy.yml:72

  • actions/checkout@v6 is not a valid release of actions/checkout (current major is v4). This will fail at runtime; use actions/checkout@v4 here 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
Copy link
Author

Choose a reason for hiding this comment

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

This might need an update. That is a proposal.

#
# To change priorities, simply reorder the strategies in the list.
#
merge_picks:
Copy link
Author

Choose a reason for hiding this comment

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

This section is a proposal. Please comment your suggestions.

# mergai finalize --mode <squash|keep|fast-forward>
#
# Default: "squash"
mode: squash
Copy link
Author

Choose a reason for hiding this comment

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

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
Copy link
Author

Choose a reason for hiding this comment

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

master currently but will change that to v0.1.0 once the review is done.

@plebioda plebioda requested review from igorsol and ktrushin February 23, 2026 16:33
@plebioda plebioda force-pushed the PSMDB-1931-merging-workflow branch 2 times, most recently from c653af2 to c121ee4 Compare February 24, 2026 14:23
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.
@plebioda plebioda force-pushed the PSMDB-1931-merging-workflow branch from c121ee4 to 3e157a9 Compare February 25, 2026 11:30
@plebioda plebioda marked this pull request as ready for review February 25, 2026 12:50
@plebioda
Copy link
Author

plebioda commented Feb 25, 2026

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.

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.

2 participants