Skip to content

[TRUNK-17696] Document multiple queues per repository#459

Merged
trunk-staging-io[bot] merged 4 commits intomainfrom
sam-gutentag/multiple-queues-per-repo
May 7, 2026
Merged

[TRUNK-17696] Document multiple queues per repository#459
trunk-staging-io[bot] merged 4 commits intomainfrom
sam-gutentag/multiple-queues-per-repo

Conversation

@samgutentag
Copy link
Copy Markdown
Member

@samgutentag samgutentag commented Mar 12, 2026

Summary

  • Added new "Multiple queues per repository" section to Advanced Settings — explains creating queues for different branches, the one-queue-per-branch constraint, independent settings, and dashboard navigation
  • Updated FAQ — replaced outdated "one queue per repo" answer with new multi-queue guidance, retained fork-based CI testing tip
  • Added hint to Getting Started pointing to multi-queue docs

Context links

  • Linear: TRUNK-17696
  • Eng PRs (all merged Feb 2026): trunk-io/trunk2#2757, #2763, #2787, #2795, #2901
  • Flag cleanup PR: trunk-io/trunk2#2874 (removed allowCreatingMultipleMergeQueuesFromWeb)
  • Earlier flag cleanup: trunk-io/trunk2#2795 (removed useClickhouseForMergeDashboard, ships new accordion dashboard)

Files changed

  • merge-queue/administration/advanced-settings.md — new section
  • merge-queue/reference/common-problems.md — updated FAQ answer
  • merge-queue/getting-started/install-and-create-your-queue.md — added hint

Verified facts

  1. One-queue-per-branch is enforced. Each branch can only be associated with one queue. Validation lives at three layers in trunk2: a frontend validateBranch check against mergeInstanceBranches, a service-layer MERGE_INSTANCE_ALREADY_EXISTS error, and a backend duplicate check. Phil Vendola confirmed in #trunk-appliedintuition 2026-02-06: "still one queue per branch." Documented in both pages.

  2. No documented per-repo queue limit. No MAX_QUEUES constant or PRD reference. Production usage shows up to 13 queues per repo without friction (Trunk Support bot query, #team-go-to-market, 2026-04-30). Not documenting a limit since none exists in code.

  3. Screenshots / video for the new accordion dashboard. PR trunk-io/trunk2#2795 contains a demo video and a before image (GitHub user-attachment URLs, auth-gated to the private repo). PR trunk-io/trunk2#2901 has a follow-up UX polish video. Native screenshots for the docs site can be captured in a follow-up PR.

Test plan

  • Check GitBook preview for all three pages
  • Verify cross-links between pages work
  • Confirm FAQ renders correctly with updated answer
  • Spot-check that the per-branch constraint sentence reads clearly

🤖 Generated with Claude Code

@trunk-staging-io
Copy link
Copy Markdown

trunk-staging-io Bot commented Mar 12, 2026

😎 Merged successfully - details.

@samgutentag samgutentag changed the title Document multiple queues per repository [TRUNK-17696] Document multiple queues per repository Mar 12, 2026
Add docs for creating multiple merge queues targeting different branches
within the same repo. New section in advanced settings, updated FAQ,
and hint in getting started guide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@samgutentag samgutentag force-pushed the sam-gutentag/multiple-queues-per-repo branch from fd8a10e to f418177 Compare March 17, 2026 05:43
@samgutentag
Copy link
Copy Markdown
Member Author

Triage status (2026-05-05): merge conflicts with main in 3 merge-queue admin/getting-started files. Three open questions in the PR body also need engineering input before merge.

@samgutentag
Copy link
Copy Markdown
Member Author

samgutentag commented May 6, 2026

Verification status (2026-05-06, re-verified): live

Verified: customers can use this. Ready to publish.

  • Eng PRs: trunk2#2757, #2763, #2787, #2795, #2901 (all merged Feb 2026, merge commits still on main)
  • Linear ticket: TRUNK-17696
  • Flags found in stack:
    • allowCreatingMultipleMergeQueuesFromWeb (introduced by #2763, the actual gating flag for creating multi-queues from the UI)
    • useClickhouseForMergeDashboard (introduced earlier, gated the legacy dashboard render path)
  • Rollout signals:
    • trunk2#2795 ("Add new merge dashboard + remove legacy flow", merged 2026-02-05) removes useClickhouseForMergeDashboard and the legacy dashboard component.
    • trunk2#2874 ("Clean Old LD Flags", merged 2026-02-12) removes allowCreatingMultipleMergeQueuesFromWeb and its gated branches.
    • Current ts/apps/frontend/src/constants/flags.ts confirms both flags are gone from the codebase.

Two independent "delete legacy" rollout signals. The feature is unconditionally on in prod.

Merge readiness:

  • Branch state: CONFLICTING against main (still). Resolve conflicts in merge-queue/administration/advanced-settings.md, merge-queue/reference/common-problems.md, merge-queue/getting-started/install-and-create-your-queue.md before merging.
  • Open questions in PR body (queue limits, two queues per branch, screenshots) still need engineering input or removal from the PR before merge.

Suggested next action: resolve conflicts, close out the open questions, then merge.

samgutentag and others added 3 commits May 6, 2026 23:38
Surface the unique-branch-per-queue rule in both the advanced settings
section and the FAQ. The backend enforces it via the
MERGE_INSTANCE_ALREADY_EXISTS error and customers searching for the
error string should land on the docs.

Also drops an em-dash in the advanced settings paragraph.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves conflict in common-problems.md by keeping both the new
multi-queue answer and the fork-based CI testing paragraph that the PR
body says was retained.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Verified against trunk2:

- Top-right button is "New Queue", not "Create New Queue"
  (page.tsx:56, merge-queue-settings-client.tsx:108). "Create New Queue"
  is only the empty-state button (merge-instances-list-empty.tsx:21).
- Multi-queue rows are not collapsed by default — they always render
  inline. The Collapsible wrapper only applies to inactive-only repos
  (repository-queue-group.tsx:40).
- Settings selector is labeled "Merge Queues" and only appears when
  availableQueues.length > 1 (merge-queue-settings-client.tsx:138).
  The selected branch shows as a chip next to the section title.
- The actual error string from the create form is
  `A merge queue already exists for branch "<branch>" in this repository`
  (create-merge-client.tsx:95), not the simpler service-layer string.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 7, 2026

Claude finished @samgutentag's task in 2m 39s —— View job


Review summary

Reviewed the three changed files for typos, grammar, formatting, and doc best practices. The new section is well-scoped and the cross-links resolve correctly. No blocking issues — just style/consistency nits, posted as inline suggestions.

  • Read PR diff and changed files
  • Check consistency with neighboring docs
  • Post inline comments for issues
  • Post final review summary

Findings

File Line Issue Severity
advanced-settings.md 118 Button label New Queue vs Create New Queue used elsewhere (install-and-create-your-queue.md L27/L44, getting-started/README.md L20) Consistency
common-problems.md 92 Same button-label mismatch Consistency
advanced-settings.md 114 "for the same repo" — informal vs repository used elsewhere on the page Style nit
advanced-settings.md 129 "In the Settings page" → "On the Settings page" Grammar nit
advanced-settings.md 112 "create a second queue against the same branch" — "against" reads oddly Style nit
advanced-settings.md 126 "is itself a link that goes directly to the queue" — tighten for parallelism with the next bullet Style nit

What I checked and didn't flag

  • Cross-link ../administration/advanced-settings.md#multiple-queues-per-repository resolves correctly from both pages.
  • The error string A merge queue already exists for branch "<branch>" in this repository matches the wording you verified in the PR body.
  • The new ordered list lacks trailing periods, but that's consistent with other step lists on the same page (e.g., the Bisection Testing Concurrency "How to Configure" steps).
  • FAQ tone (Yes!) matches the conversational style of the surrounding entries.
  • No links broken, no markdown rendering issues spotted.

Recommendation

Address the button-label inconsistency before merge — it's the only finding likely to confuse a reader hunting for the button in the UI. The rest are polish.

I couldn't run trunk fmt/trunk check from this environment (no permission to invoke trunk directly); please run those locally or rely on CI before merge.
· branch sam-gutentag/multiple-queues-per-repo


### Creating additional queues

1. Navigate to **Merge Queue** and click **New Queue** at the top right
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Button label inconsistency. The other Merge Queue docs refer to this button as Create New Queue (e.g., install-and-create-your-queue.md lines 27 and 44, getting-started/README.md line 20), but here and in common-problems.md line 92 it's called New Queue. Pick one and use it in all three places so users searching the UI for the exact label always find it. If the actual button label is "New Queue" today, the older pages need a follow-up update; if it's "Create New Queue", these new mentions should match.

Suggested change
1. Navigate to **Merge Queue** and click **New Queue** at the top right
1. Navigate to **Merge Queue** and click **Create New Queue** at the top right

Fix this →


A branch can only be associated with one queue. Attempting to create a second queue against the same branch returns the error `A merge queue already exists for branch "<branch>" in this repository`.

Each queue operates independently. PRs submitted to one queue don't interact with PRs in another queue for the same repo, and every queue has its own settings, including merge method, required statuses, batching, and concurrency.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: repo is informal compared to the rest of this page (and section heading), which uses repository. Also, the qualifier is a bit redundant since the whole section is scoped to a single repository — consider trimming.

Suggested change
Each queue operates independently. PRs submitted to one queue don't interact with PRs in another queue for the same repo, and every queue has its own settings, including merge method, required statuses, batching, and concurrency.
Each queue operates independently. PRs submitted to one queue don't interact with PRs in another queue, and every queue has its own settings, including merge method, required statuses, batching, and concurrency.

* **Single-queue repos**: The repository row is itself a link that goes directly to the queue.
* **Multi-queue repos**: The repository row expands inline to list each queue with its target branch label. Click any queue to open it.

In the Settings page, when a repository has more than one queue, a **Merge Queues** selector appears so you can switch between queues. The currently selected branch is shown next to the **Merge Queue Settings** heading.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Grammar nit: "In the Settings page" reads a bit awkwardly — the conventional preposition is "On the Settings page" (or just "In Settings"). Same suggestion lets you tighten the sentence too.

Suggested change
In the Settings page, when a repository has more than one queue, a **Merge Queues** selector appears so you can switch between queues. The currently selected branch is shown next to the **Merge Queue Settings** heading.
On the Settings page, when a repository has more than one queue, a **Merge Queues** selector appears so you can switch between queues. The currently selected branch is shown next to the **Merge Queue Settings** heading.


You can create multiple merge queues within a single repository, with each queue targeting a different branch. This is useful for teams that maintain separate branches for different environments (e.g., `main`, `staging`, `release/v2`).

A branch can only be associated with one queue. Attempting to create a second queue against the same branch returns the error `A merge queue already exists for branch "<branch>" in this repository`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Style nit: "create a second queue against the same branch" — "against" reads a bit oddly here. "for the same branch" or "targeting the same branch" matches the language used in the section's first paragraph ("each queue targeting a different branch").

Suggested change
A branch can only be associated with one queue. Attempting to create a second queue against the same branch returns the error `A merge queue already exists for branch "<branch>" in this repository`.
A branch can only be associated with one queue. Attempting to create a second queue targeting the same branch returns the error `A merge queue already exists for branch "<branch>" in this repository`.


The Merge Queue dashboard groups queues by repository:

* **Single-queue repos**: The repository row is itself a link that goes directly to the queue.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Style nit: "is itself a link that goes directly to the queue" is a bit roundabout. Tightening it improves parallelism with the Multi-queue repos bullet below.

Suggested change
* **Single-queue repos**: The repository row is itself a link that goes directly to the queue.
* **Single-queue repos**: The repository row links directly to the queue.

Yes! You can create multiple queues within a single repository, with each queue targeting a different branch (e.g., `main`, `staging`, `release/v2`). Each queue operates independently with its own settings, required statuses, and merge behavior. A branch can only be associated with one queue.

For validating significant changes to your CI process or queue configuration without impacting your primary workflow, the recommended approach is to use a fork of your repository. You can set up and test a separate merge queue on the fork to make sure your changes work as expected before applying them to your primary repository.
To create an additional queue, click **New Queue** from the Merge Queue dashboard and select the same repository with a different target branch. See [Multiple queues per repository](../administration/advanced-settings.md#multiple-queues-per-repository) for details.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same button-label inconsistency I flagged in advanced-settings.md line 118 — the rest of the docs (e.g., install-and-create-your-queue.md) call this Create New Queue. Should match whichever label is correct in the live UI.

Suggested change
To create an additional queue, click **New Queue** from the Merge Queue dashboard and select the same repository with a different target branch. See [Multiple queues per repository](../administration/advanced-settings.md#multiple-queues-per-repository) for details.
To create an additional queue, click **Create New Queue** from the Merge Queue dashboard and select the same repository with a different target branch. See [Multiple queues per repository](../administration/advanced-settings.md#multiple-queues-per-repository) for details.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Auto-approved: Claude code review passed.

@trunk-staging-io trunk-staging-io Bot merged commit 4c505f9 into main May 7, 2026
7 checks passed
@trunk-staging-io trunk-staging-io Bot deleted the sam-gutentag/multiple-queues-per-repo branch May 7, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant