Documentation Docs version: dev (Pre-release: Gitoodo has not been released yet)
GitHub Get notified

For developers · Orchestrator

Branch rules that work with the autopilot

On this page
  1. The setup check
  2. What the rule should allow
  3. Forgejo and Gitea
  4. GitHub
  5. GitLab

The autopilot merges a finished pull request with the merge account: the worker account of the repository, or the repository's own account when no worker account is set up. A rule on the base branch can refuse that merge. When it does, Gitoodo reads the rule, names the cause and acts on it (#942):

CauseWhat Gitoodo does
The branch is behind its baseUpdates the branch the way the merge style needs and merges again.
A required check failedSends the pull request back to its worker.
The merge account may not mergeShows a card in "Asked of me" with Allow the merge account.
A required check reports nowhereShows a card naming the check, what a required check is and the two ways out, with Check the setup and the link to the setting.
A required check did not run for this commitStarts CI for the commit again (at most twice, five minutes apart) and merges once it is green; only then a card with Start the check again.
Approvals are missingShows a card with the count (given of required), with the link.
The rule cannot be readShows a card with the link to the branch settings.
The rule allows it, the forge still says noShows a card with what was found fine, the forge's message and Open PR / Try again.
The forge is busy ("Please try again later")Waits and tries again; no card.
The forge answers with a server errorTries again; after three in a row a card with the forge's message and Open PR / Try again.

Each cause is notified once per pull request. While a setting refuses the merge, Gitoodo makes no merge attempt; it reads the rule again every two minutes, and at once after **Allow the merge account**. When the cause is gone, the merge runs and the card disappears.

"Reports nowhere" means: the check has no result on the pull request, on the newest commit of the base branch, or on other open pull requests into it. Then the name in the rule and the name the pipeline reports differ, or the check no longer exists. Either have the pipeline report under exactly the name in the rule (or put the name it reports under into the rule), so the check keeps guarding every merge; or, only if the check no longer exists, remove it from the rule, so Gitoodo merges without it. A check that reports on those other commits but not on this one is no setting: its CI run was skipped once (for example a force-push the CI trigger ignored), and Gitoodo starts it again instead of asking you to change the rule.

When the rule explains nothing, the card lists what Gitoodo checked and found fine and quotes the forge's own message. Open the pull request on the forge and merge it there once by hand: the forge's message there names the reason. Then choose Try again (#1880).

A pull request that changes no file is not a merge case: Gitoodo closes it with a note and closes its issue with the pull request's description, without a card (#1880).

Reading a branch rule needs admin rights on most forges. Gitoodo reads it with the repository's own account first and the merge account second; when neither may read it, the card says so.

The setup check#

When you add a repository or switch its autopilot on, Gitoodo reads the rule of the base branch right away and compares it with what the autopilot needs (#942). Switching on is never held up: the autopilot is on at once, and the check runs in the background. When something would stop the autopilot, a notice appears in the corner of the window with one plain sentence per problem and the same actions as the card: Allow the merge account where Gitoodo can change it, otherwise Open the setting, and the link to this guide. The same items stay in the repository's readiness checklist until the rule fits.

ItemCheckedAction
Merge accountThe merge account is on the rule's merge list (Forgejo/Gitea merge whitelist, GitHub push restrictions).Allow the merge account (admin rights needed), or link.
Merge account may pushThe merge account has at least write access to the repository.Link to the collaborator or access settings.
Required checks reportEvery required check was reported on the newest open pull request whose checks have all finished. A check missing there but reported on the newest commit of the base branch or on another open pull request counts as reporting. Without such a pull request, or without named required checks, the item is left out.Link to the rule.
ApprovalsThe rule requires no approvals. Required approvals are flagged because the autopilot then waits for a person on every pull request.Link to the rule.

The configured merge style is checked by the existing item Merge style of the checklist.

Nothing alarming is shown for what Gitoodo cannot know: a rule the token may not read, a forge that does not report it, an account whose login is unknown, or a repository without an open pull request leaves the matching item out. GitLab is skipped for now (see below).

What the rule should allow#

  • Merging by the merge account. If the rule lists who may merge (or push), the merge account must be on that list.
  • Required checks that report. Every required check must be a check the pipeline of the repository actually reports, with exactly that name. A check that was renamed or removed from the pipeline blocks every merge.
  • Approvals the autopilot can get. Required approvals hold every pull request until a person approves it. Keep them only if a person reviews each change; Gitoodo does not approve its own work.
  • "Behind the base" is fine. Gitoodo updates the branch by itself, so a rule that refuses outdated branches works.

Forgejo and Gitea#

Settings → Branches → the rule of the base branch (/settings/branches/edit?rule_name=<rule>):

  • Enable merge whitelist: when on, add the merge account under the allowed users (merge_whitelist_usernames). Allow the merge account does exactly this; it needs admin rights on the repository.
  • Enable status check: the listed contexts (status_check_contexts, globs allowed) must match checks the pipeline reports on pull requests.
  • Required approvals (required_approvals): only official, current approvals count.
  • Block merge on outdated branch (block_on_outdated_branch): fine; Gitoodo updates the branch.
  • Merges by the merge account need the write right on the repository.

GitHub#

Settings → Branches → the protection rule of the base branch:

  • Restrict who can push to matching branches: the merge account must be listed (users or teams). Allow the merge account adds the user; a team has to be changed by hand.
  • Require status checks to pass: the required checks must be reported on pull requests. Require branches to be up to date is fine.
  • Require approvals: the count of approving reviews.

GitLab#

Settings → Repository → Protected branches: the merge account needs Allowed to merge on the base branch, and the project settings decide whether pipelines must succeed. Gitoodo does not read these rules on GitLab yet: the setup check skips them, and when a merge is refused there, the card links to the setting.

Edit on GitHubDocs version: dev