Overview
A MergeQueue (apiVersion: nominos.io/v1) watches a repository for PRs carrying a label (default nominos/merge-queue). Each labeled PR is rebased onto the latest target branch, gated on CI, and merged with the configured strategy. If the rebase conflicts, an AI agent attempts resolution before escalating to a human. After merging, the queue watches CI for a configurable window and can automatically revert and reopen the PR.
kubectl get mergequeues
NAME PHASE QUEUE TARGET AGE
main-queue Processing 3 main 2d
Spec Fields
| Field | Type | Default | Description |
repository | string | — | Repository URL to manage merges for. Required. |
targetBranch | string | main | Branch PRs are merged into. |
mergeStrategy | enum: squash | merge | rebase | squash | How PRs are merged. |
watchLabel | string | nominos/merge-queue | PRs with this label enter the queue automatically. |
defaultPRLabels | string[] | watchLabel | Labels added to PRs created by this queue’s agents. |
maxConcurrentCI | integer | 1 | Maximum concurrent CI runs (1 = strictly sequential). |
ci | CIConfig | — | CI integration settings (see below). |
conflictResolution | ConflictResolutionConfig | — | AI-assisted conflict resolution (see below). |
autoRevert | AutoRevertConfig | — | Auto-revert on post-merge CI failure (see below). |
stalePR | StalePRConfig | — | Stale-PR handling (see below). |
authSecret | string | — | Secret containing git credentials. |
paused | boolean | false | Pause queue processing. |
CI configuration
| Field | Type | Default | Description |
ci.requiredChecks | string[] | — | Status checks that must pass before merging. |
ci.timeoutMinutes | integer | inferred from history | How long to wait for CI to complete. |
ci.waitForAllChecks | boolean | false | Wait for all checks, or just the required ones. |
Conflict resolution
| Field | Type | Default | Description |
conflictResolution.enabled | boolean | true | Enable AI-assisted conflict resolution. |
conflictResolution.model | string | sonnet | Model used to resolve conflicts. |
conflictResolution.maxAttempts | integer | 3 | Attempts before escalating to a human. |
conflictResolution.humanReviewLabel | string | nominos/needs-human-review | Label added when human review is needed. |
Auto-revert
| Field | Type | Default | Description |
autoRevert.enabled | boolean | true | Auto-revert the merge if CI fails on the target branch after landing. |
autoRevert.windowMinutes | integer | 10 | Post-merge window to watch for CI failures. |
autoRevert.reopenPR | boolean | true | Reopen the PR after reverting. |
Stale PRs
| Field | Type | Default | Description |
stalePR.thresholdDays | integer | 7 | Days before a queued PR is considered stale. |
stalePR.action | enum: rebase | remove | notify | rebase | What to do with stale PRs. |
Status
Queue Phases
| Phase | Meaning |
Idle | Queue is empty or waiting for work. |
Processing | A PR is being rebased, checked, or merged. |
Paused | Queue processing is paused (spec.paused: true). |
Error | The queue hit an error it cannot recover from on its own. |
Per-PR Statuses
| Status | Meaning |
Queued | Waiting in the queue. |
Rebasing | Being rebased onto the latest target branch. |
ResolvingConflicts | An AI agent is resolving rebase conflicts. |
WaitingCI | Waiting for required status checks. |
Merging | Merge in progress. |
Merged | Merged into the target branch. |
Failed | Failed to merge; removed from the queue. |
NeedsHumanReview | Conflict resolution exhausted its attempts — a human must take over. |
Status Fields
| Field | Description |
phase / message | Queue phase (see above) and a human-readable message. |
queue / queueLength | PRs currently queued, each with number, title, author, enqueue time, status, priority, attempts, and any linked AgentJob/AgentPlan. |
currentPR | The PR currently being processed, including conflictStatus (conflicting files, resolution attempts, resolution job). |
stats | Lifetime counters: totalMerged, totalFailed, conflictsResolved, autoReverts, average queue and CI times. |
lastMergeTime | Timestamp of the last successful merge. |
recentMerges | Recent merge records: PR number, merge SHA, and revert SHA/time if auto-reverted. |
conditions | Standard Kubernetes conditions. |
Examples
Basic queue for main
apiVersion: nominos.io/v1
kind: MergeQueue
metadata:
name: main-queue
spec:
repository: https://github.com/myorg/myapp
targetBranch: main
mergeStrategy: squash
authSecret: nominos-git-credentials
ci:
requiredChecks: ["build", "test"]
Auto-revert queue
apiVersion: nominos.io/v1
kind: MergeQueue
metadata:
name: auto-revert-queue
spec:
repository: https://github.com/myorg/myapp
targetBranch: main
watchLabel: nominos/merge-queue
mergeStrategy: squash
maxConcurrentCI: 1
authSecret: nominos-git-credentials
autoRevert:
enabled: true
windowMinutes: 10 # watch CI for 10 minutes after merge
reopenPR: true # reopen the PR if reverted
conflictResolution:
enabled: true
model: sonnet
maxAttempts: 2
humanReviewLabel: nominos/needs-human-review
With this configuration: the PR merges, and if CI fails on main within the 10-minute window, the queue reverts the merge commit and reopens the PR for another pass.