forked from Tokutek/tokumxse
-
Notifications
You must be signed in to change notification settings - Fork 68
PSMDB-1965: add instructions for merging workflow #1784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
plebioda
wants to merge
1
commit into
master
Choose a base branch
from
PSMDB-1965-mergai-readme
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # Mergai Workflow | ||
|
|
||
| The `mergai.yml` workflow automates the process of merging upstream MongoDB commits into Percona Server for MongoDB, including AI-assisted conflict resolution and AI-assisted summary of merged commits. | ||
|
|
||
| ## Quick Start | ||
|
|
||
| 1. **Check available commits**: Visit the [Fork Status page](https://percona.github.io/percona-server-mongodb/) | ||
| 2. **Trigger merge**: Go to Actions → "mergai bot" → "Run workflow", or use CLI: | ||
|
|
||
| ```bash | ||
| gh workflow run .github/workflows/mergai.yml -f merge-pick=<SHA> | ||
| ``` | ||
|
|
||
| 3. **Review the PR**: The workflow creates one of two PR types: | ||
| - **Merge PR** - Clean merge without conflicts, ready for review | ||
| - **Conflict Solution PR** - Contains conflict markers with AI-resolved solutions visible in the diff for easy review | ||
| 4. **Build and test**: Check out the branch locally, build, and run tests | ||
| 5. **Merge**: Post `/fast-forward` comment to merge without double commits | ||
|
|
||
| ## Workflow Jobs | ||
|
|
||
| | Job | Trigger | Purpose | | ||
| | ----------------- | -------------------------------- | ---------------------------------------------------- | | ||
| | `trigger-merge` | Manual dispatch | Performs merge, handles conflicts with AI resolution | | ||
| | `solution-merged` | PR merged to `mergai/*/conflict` | Finalizes after solution PR is merged | | ||
|
|
||
| ## Understanding PRs | ||
|
|
||
| ### Merge PR (no conflicts) | ||
|
|
||
| - Direct PR to main branch | ||
| - Review "Auto-merged files" section | ||
|
|
||
| ### Conflict Resolution PR | ||
|
|
||
| - PR from `solution` branch into `conflict` branch | ||
| - Check "Conflict Context" and "Solutions" sections for AI-resolved conflicts | ||
| - Unresolved files will have conflict markers visible in review | ||
|
|
||
| ## Making Fixes | ||
|
|
||
| If tests fail or changes are needed: | ||
|
|
||
| ### Option 1 - Simple (commits not tracked by mergai) | ||
|
|
||
| Add commits directly to the branch. This works but commits won't be marked as solutions for future reuse. | ||
|
|
||
| ### Option 2 - Tracked (recommended) | ||
|
|
||
| ```bash | ||
| # Add your commits, then: | ||
| mergai commit sync # Add mergai notes to commits | ||
| mergai branch push main # Push branch | ||
| mergai notes push # Push notes | ||
| mergai pr update main # Update PR description | ||
| ``` | ||
|
|
||
| **Optional**: Use `mergai commit squash` to squash all commits into the merge commit. | ||
|
|
||
| ## Merging the PR | ||
|
|
||
| Ensure the PR branch is rebased onto (and fast-forwardable to) the base branch, then post a comment with `/fast-forward` to merge without creating extra merge commits. | ||
|
|
||
| ## Canceling a Merge | ||
|
|
||
| To cancel an in-progress merge: | ||
|
|
||
| 1. Close the PR | ||
| 2. Delete the associated branch(es) | ||
|
|
||
| ## Local Setup (Optional) | ||
|
|
||
| For local work with mergai: | ||
|
|
||
| ```bash | ||
| mergai config # One-time: configure git for note markers and diff3 | ||
| mergai notes update # Sync notes from remote | ||
| mergai context init # Create local context from commit notes | ||
| # Now other mergai commands work | ||
| ``` | ||
|
|
||
| If you need to rebase an existing merge: | ||
|
|
||
| ```bash | ||
| mergai context init | ||
| mergai rebase | ||
| ``` | ||
|
|
||
| ## Resources | ||
|
|
||
| - [Mergai Documentation](https://github.com/Percona-Lab/mergai#readme) | ||
| - [Fork Status Dashboard](https://percona.github.io/percona-server-mongodb/) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.