Register a merge queue target branch
Stamp's merge queue tests approved pull requests together and lands them on a branch in batches. On a Stamp where many teams' servers share Stamp's GitHub App, the queue lands only on a branch registered as its target. The Stamp operator registers some branches; a GitHub admin of the repository can register one on the repository's Settings → Merge queue page, in the Target branch box.
Registering may be off on your Stamp
Where registering a branch yourself isn't turned on, Register says "Registering a target branch yourself isn't turned on for this Stamp", and a branch registered for your server before stays registered but its queue doesn't run there: the box reads "Registered, not running". Ask the Stamp operator to register the branch for you. A Stamp that shows no Target branch box needs no registering.
Who can register
- A person. Agents can't register or unregister a branch, and nobody can do it on your behalf.
- Signed in to Stamp with GitHub connected, and named an admin of the repository by GitHub. Stamp asks GitHub with your own account each time you register or unregister; being an admin earlier does not count.
- On a Stamp server whose GitHub App covers the repository.
What registering does
While the branch is registered, on every Stamp server:
- The repository's merge queue belongs to your server. Only your server's people and agents set up and run a queue on it. On any other server the page says the queue belongs to another Stamp server (
BATCH_REPOSITORY_OWNED), and agents'stamp queue setup,save,verify,enableandturn-offthere are refused the same way. Nothing tells them which server. - Stamp refuses every direct push to the branch, from every server's agents, your own included (
QUEUE_TARGET_REQUIRES_PR): changes reach it through pull requests. - Other servers can't merge into the branch (
QUEUE_REQUIRED), whatever your queue's state, on or off. A server federated with yours can still join your queue while it's on.
A repository has one registered branch. All of this holds even where registering is turned off: turning it off only stops the queue from running on a branch that the registration alone names.
A branch the operator registers shows "Registered by the Stamp operator", with Register for this server: registering it yourself binds the repository's queue to your server as above.
Set up the queue, in this order
- Register. In Target branch, check the branch (it starts as the queue's saved branch, else the repository's default branch), choose Register, and confirm. The branch must already exist on GitHub: Stamp asks GitHub with your account, and refuses a branch GitHub doesn't have (
QUEUE_TARGET_BRANCH_NOT_FOUND). The box then says who registered it for this server, and when. - Save the settings. Pick the test workflow, choose Inspect checks, confirm the checks, and Save with queue off.
- Verify with a pull request someone else approved (an author's approval of their own pull request doesn't count), and wait for the result.
- On GitHub, let Stamp's GitHub App bypass "Require a pull request" on the branch, and nothing else. The queue lands each tested batch by pushing it with that App. Keep the required status checks and the rules against force pushes and deletion in force for it. In classic branch protection, add the App under "Allow specified actors to bypass required pull requests". With rulesets, a bypass covers every rule of its ruleset, so keep "Require a pull request before merging" in a ruleset of its own and add the App to that ruleset's bypass list only; don't add it to the rulesets with status checks, force-push or deletion rules. The step between Verify and Turn on on the page says the same.
- Turn on the queue.
Grant the bypass only once the branch is registered here, so that Stamp refuses direct pushes to it from the start.
Unregister
- Turn the queue off ("Turn off the merge queue"). Unregister is offered only while the queue is off; while it's on, paused or holding pull requests, unregistering is refused (
QUEUE_TARGET_IN_USE). A queue saved again after it was on counts as on until you turn it off; one that was never on needs no turning off once its verification has ended. - On GitHub, remove Stamp's GitHub App from the branch's bypass lists: its branch protection, and every ruleset with a pull request rule for the branch.
- Unregister, and confirm.
Stamp then reads, with your GitHub account, whether its App can still bypass the branch's pull request rule: the bypass list of the branch protection, and that of each ruleset with a pull request rule for the branch.
- A list still names Stamp's App: refused (
QUEUE_TARGET_BYPASS_GRANTED), nothing changed. Remove it on GitHub and unregister again. - Stamp couldn't read a list: GitHub refused or failed the read, or didn't show the list. GitHub shows the bypass list of an organization's or enterprise's ruleset only to someone who may change that ruleset, so an empty list there counts as unread. The dialog asks you to check on GitHub that Stamp's App can't bypass "Require a pull request" there; for a ruleset whose list you can't see, ask an owner of the organization (or enterprise) to check it, and to remove the App if it's listed. Once that's done, tick "I removed Stamp's App from the bypass list" and Unregister: your confirmation is recorded in place of Stamp's read. Confirm only what you checked: once the branch is unregistered, Stamp no longer refuses direct pushes to it, so Stamp's App must not be able to bypass the rule.
- GitHub's rate limit refused a read (
GITHUB_RATE_LIMITED): try again later. A confirmation doesn't stand in for it. - No list names it: the branch is unregistered.
Once unregistered, Stamp stops refusing direct pushes to the branch on every server, unless the operator registers it.
If nobody can unregister the branch (the server it's registered to can't act on the repository any more, or nobody can check a bypass list Stamp can't read), ask the Stamp operator: they can remove the registration. Moving a registration to another server isn't on the page. Removing it doesn't move the repository's queue either: a queue the registered server set up stays that server's, and the page can't take it over. If that server is gone (Stamp was removed from it, or it was deleted), the operator can also release its queue: it's turned off, and the first server to set up a queue for the repository, or register the branch, takes it. If that queue is on, have it turned off first: once the registration is gone it can't land anything, but it still keeps pull requests from merging into the branch directly.
Refusals you may meet
| Code | When | What to do |
|---|---|---|
QUEUE_REGISTRATION_OFF | Register, where registering is turned off on this Stamp | Ask the Stamp operator to register the branch |
QUEUE_REGISTRATION_UNAVAILABLE | Register, on a Stamp where branches need no registering | Nothing to do |
BATCH_SELF_SERVICE_UNAVAILABLE | Setting up a queue yourself is off on this Stamp | Ask the Stamp operator |
BATCH_PLATFORM_UNAVAILABLE | The merge queue isn't ready on this Stamp | Ask the Stamp operator; trying again later is safe |
BATCH_ADMIN_REQUIRED | GitHub doesn't name you an admin of the repository | Ask a repository admin |
BATCH_BRANCH_INVALID | Register: not a branch the queue may land on (a malformed name, or one Stamp reserves, such as stamp-mq/… or stamp-ci/…) | Check the name and try again |
QUEUE_TARGET_BRANCH_NOT_FOUND | Register: GitHub has no branch of that name in the repository | Check the name, or create the branch on GitHub first |
BATCH_REPOSITORY_OWNED | The repository's queue, or its registration, is another Stamp server's | A person on that server manages it |
QUEUE_REGISTRATION_EXISTS | Register: the repository already has a registered branch | Unregister it first |
QUEUE_REGISTRATION_MISSING | Unregister: nothing is registered for this server | Nothing to do |
QUEUE_TARGET_IN_USE | Unregister: the queue on the branch is on, paused or holding pull requests | Turn the queue off first |
QUEUE_TARGET_BYPASS_GRANTED | Unregister: Stamp's App may still bypass the branch's pull request rule | Remove the App from the bypass list on GitHub, then unregister |
QUEUE_TARGET_BYPASS_UNKNOWN | Unregister: Stamp couldn't read every bypass list | Check on GitHub, then confirm (above) |
QUEUE_REGISTRATION_CHANGED | Unregister: the registration changed since you read the page | Read the page again |
GITHUB_RATE_LIMITED | GitHub's rate limit refused a read | Try again later |
QUEUE_BUSY, BATCH_STORE_UNAVAILABLE | The queue was finishing a step, or Stamp couldn't read its records | Nothing changed; try again in a moment |
BATCH_TARGET_NOT_CONFIGURED | Verify, on a branch this server's queue may not run on | Register the branch above, or ask the Stamp operator |
Your agents meet QUEUE_TARGET_REQUIRES_PR when they push to a registered branch. Their stamp queue commands on a branch that isn't a target for your server are refused QUEUE_TARGET_NOT_REGISTERED; where registering is turned on, its next step names the repository's Settings → Merge queue page.