-
Notifications
You must be signed in to change notification settings - Fork 23k
Mergebot
The merge bot is a tool to orchestrate pull requests merging into the stable branches of Odoo.
- Create your PR
- Squash appropriate commits to keep only meaningful ones
- Write commit messages respecting the commit guidelines
- If your PR contains more than one commit, clean the pull request description to match the commit guidelines too (it will be used as the merge commit message)
- Ask a review to one of the authorized reviewers
- Review the pull request (actually a mandatory step).
- If there are multiple reviews requested, you can use Github's "Approve", otherwise skip to next step.
- If all reviewers have approved, either use
review+
ordelegate
, to start the merging process. - If the PR contains multiple commits, configure its integration mode
A command string is a line starting with the mergebot's name (robodoo, @
prefix optional) and followed by various commands.
-
retry
resets a PR in error mode to ready for staging
can be used by a reviewer or the PR author to re-stage the PR after it's been updated or the target has been updated & fixed.
-
r(eview)+
approves a PR, can be used by a reviewer or delegate reviewer
submitting an "approve" review implicitly r+'s the PR
-
r(eview)-
removes approval from a PR, allows un-reviewing a PR in error (staging failed) so it can be updated and re-submitted
if a PR is staged and unreviewed, the staging is cancelled
-
delegate=<users>
adds the specified users as reviewers for this pull request. Can be used by reviewers
<users>
is a comma-separated list of github usernames (no@
prefix) -
delegate+
shortcut for
delegate=<pr-author>
-
p(riority)=2|1|0
sets the priority to normal (2), pressing (1) or urgent (0), lower-priority PRs are selected first and batched together, can be used by reviewers
- priority 2 (the default) means the PR will be staged after other priorities and splits
- priority 1 means the PR will be staged before splits
- priority 0 is similar to priority 1 but stages without needing approval
(review) or runbot to pass on the PR, "unreviewing" (
r-
) such a PR automatically re-sets it top=1
-
override=<status>
Allows overriding whatever status was automatically generated for a branch. The override is persistently linked to the pull request, status updates on the PR will be ignored. Example:
override=ci/security
Override rights must be configured individually on users, for each status to be overridden ; they are purposely independent from general review rights.
When a PR contains more than one commit, a merge method has to be selected:
-
merge
integrates the PR via a regular merge commit, without rebasing, the PR title and body are used to create the message of the merge commit
-
rebase-merge
rebases the PR then integrates it via a regular merge commit, the PR title and body are used to create the message of the merge commit
-
rebase-ff
rebases the PR then integrates it via a fast-forward (all the commits of the PR are copied to the target), this is the behaviour when the PR has a single commit as well
-
@alice creates a PR, write a good commit message and asks a review to @bob
-
@bob writes a message to approve the PR
robodoo review+
-
@robodoo rebases and merges the PR
-
@alice creates a PR, write a good commit message and asks a review to @bob
-
@bob is not certain of the content and would like a second opinion from @carol (who is not an authorized reviewer)
robodoo delegate=carol
-
@carol agrees with the PR and approves
robodoo r+ 👍
-
@robodoo rebases and merges the PR
-
@alice creates a PR, writes a good commit message and asks a review to @bob
-
@bob approves the PR with
r+
-
@robodoo tries to merge it but it fails (e.g. test fail or conflict after rebase); it posts a message on PR
Staging failed: ci/runbot failed on 4a0b13ed923
-
@alice corrects the PR
-
As the content has changed, @bob validates again the PR
robodoo r+ please
-
@robodoo rebases and merges the PR
-
@alice (community member) creates a PR and asks a review to @bob
-
@bob (reviewer) wants to slightly clean up the PR to apply code/commit guidelines
-
As @alice, by default, allows commits in her branch when creating a PR, @bob can add the remote, fetch and checkout the branch (or, if he is lazy, use an alias to set in his
~/.gitconfig
to do the same)$ git get-br alice:11.0-awesome-fix $ git commit --amend $ git push --force-with-lease alice 11.0-awesome-fix
-
Once the PR is ready, @bob approves the amended version
robodoo review+
-
@robodoo rebases and merges the PR
-
@alice creates a PR containing multiple commits, writes a good PR title and body and asks a review to @bob
-
@bob writes the following message to approve the PR
robodoo r+
-
@robodoo sends a feedback message on the github PR like this one:
Because this PR has multiple commits, I need to know how to merge it:
merge to merge directly, using the PR as merge commit message rebase-merge to rebase and merge, using the PR as merge commit message rebase-ff to rebase and fast-forward
-
@alice sets the merge method to merge
robodoo merge
-
@robodoo creates a merge commit with the PR title and body as commit message
-
@alice creates a PR containing multiple commits, writes a good PR title and body and asks a review to @bob
-
@bob writes the following message to set the merge method and approves the PR
robodoo rebase-merge r+
-
@robodoo rebases and creates a merge commit with the PR title and body as commit message
-
@alice creates a PR with multiple commits and good commit messages. She asks a review to @bob
-
@alice wants the commits to be fast-forwarded, she sets the merge method
robodoo rebase-ff
-
@bob writes a message to set the merge method and approves the PR
robodoo review+
-
@robodoo rebases and fast-forwards the PR commits
A branch should target the lowest version where the bug is reproducible and then be forward ported to upper versions.
The forward ports are automatically created by @fw-bot
once your PR is merged. The following commands need to be specified before the merge, otherwise the bot can not take them into account.
Forward-ported pull-requests automatically get the same merge mode as their original.
-
up to
<version>
To use on the original PR before it is merged.
Allows setting a forward port limit (e.g.
up to 12.0
), by default a pull request is forward-ported to all still-supported later versions. The limit is inclusive.Forward-port can be disabled by providing the original PR's target as limit e.g. if the PR was created targeting 10.0, specifying
up to 10.0
will not do any forward-porting. -
ignore
To use on the original PR before it is merged. Disables the forward-port of this PR (similar to specifying up to
<pr target>
) -
close
Allows closing forward-port pull requests if you're the author of the original, even if you can't normally close PRs (no write access to the repository).
-
r+
To be done on the last PR that has to be merged. All the PR targeting the previous versions will be merged. Can be done by anyone having robodoo r+ rights and the author of the source PR.
-
Create a branch in v11, create a PR.
-
Follow the usual review process with @robodoo and with an optional fw-odoo command
@robodoo r+
@fw-bot up to saas-12.3
-
As soon as the PR is merged, the @fw-bot will create a PR in version N + 1, in this case v11.3
-
If the v11.3 runbot is green, a PR is created in v12.0.
-
If the v12 runbot is green, a PR is created in v12.3 (the specified limit).
-
When the v12.3 runbot is green, you can proceed on the PR for v12.3: "@fw-bot r+"
-
Every forward port PR, from v11.3 to v12.3 will be merged
If runbot fails on a forward-port PR, the chain will get interrupted as the bot awaits further action.
If this is a false-positive runbot failure, you can just rebuild, as soon as runbot succeeds the forward-port will continue as if nothing had happened.
If this is a real failure, you will need to edit the pull-request.
If a conflict occurs while creating a forward-port PR, the chain will get broken, you will have to edit it to resolve the conflict, either in-place if there is a single commit or doing your own cherry-pick to re-do the forward-port resolving the conflicts.
Alternatively, the pull request can be closed (and ignored) if it turns out redundant or unnecessary from this point onwards.
A forward-port pull-request can be edited by pushing commits to it (either pushing new commits or editing and force-pushing commits). This puts the pull-request into a semi-manual mode:
- the pull-request will have to be approved via the merge bot
- the forward-port process will then resume up to the limit originally configured (if any)
- if the edited pull-request already has forward-port descendants, those descendants will automatically get updated to match
- Create a branch in v11, create a PR and r+ it
- As soon as the PR is merged, the @fw-bot will create a PR in version N + 1, in this case v11.3
- If the v11.3 runbot is green, a PR is created in v12.0.
- If the v12.0 PR fails because of a merge conflict, solve the conflict manually and ask @robodoo to merge it when ready. You will also need to @fw-bot r+ the 11.3 PR (so all PRs of the chain up to 11.3 are merged)
- The @fw-bot will create a PR in version 12.3 based on the 12.0 port (in essence, it's the 12.0 PR that is now being forward-ported, the 11.0 PR is closed).
Website | Online Demo | Community | eLearning | Help | Scale-Up business game
Boost Sales: CRM | Point of Sale | Quote Builder | Mass Mailing | Survey | Events
Build Websites: CMS | eCommerce | Blogs | Forum | Get a Free Website
Run Operations: Projects | Billing | Accounting | Inventory | Manufacturing | Procurements
Delight Employees: Employees | Recruit | Expenses | Appraisals | Fleet