Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

triaging-merge-queue-failures

БесплатноЗапускает вложенные скриптыНе проверен

Decision procedure for a PR that failed or was removed from the Trunk merge queue: classify the kick (superseded by a newer commit, not mergeable, a gate that…

PostHogот PostHog★ 41 278 звёзд на GitHub

Об этом скилле

Triaging merge queue failures

One triage is one PR plus its latest Trunk queue attempt: establish the facts, walk the decision chart below, and end with a verdict and its action. Runs are either interactive (a developer asked about a kicked PR) or unattended (a scheduled sweep over recent kicks); the chart is identical, only the actions you may take yourself differ.

/merging-prs covers enqueueing and babysitting; this skill starts where it hands off, at a failed or removed queue entry.

How Trunk reports queue state here

Read this before writing any command. It is the part that goes stale.

Trunk publishes no check run in this repository. The trunk-io app posts zero check runs — not on the PR head, not on the queue branch. A predicate like select(.name | startswith("Trunk Merge Queue")) matches nothing, and a sweep built on it reports zero verdicts forever while the queue runs normally. /merging-prs, /debugging-ci-failures and AGENTS.md used to assert that check run exists; all three now point at trunk merge status instead.

Trunk exposes queue state three ways. Only the first carries Trunk's own reasons; the other two are what the GitHub API can see, and they are what this skill's helpers read:

  1. trunk merge status <n> (the CLI) — the full state machine with a reason per transition, in Trunk's words. This is the primary source for why, and the only one that surfaces conflicts, line-skips and cancellations at all. Human text only, no --json. The same timeline is exportable as JSON from the Trunk dashboard.
  2. One sticky comment per PR, authored by trunk-io[bot], rewritten in place as state changes. It carries the current state, the failing check's name, and a link to the failing job. Rewritten means no history: earlier reasons are gone. It can also carry a Failed Test | Failure Summary | Logs table naming the failing test outright — check it before reading any log, and note it is empty for suites that do not upload results to Trunk.
  3. One draft shadow PR per queue attempt, authored by trunk-io[bot], with head ref trunk-merge/pr-<n>/<uuid>. Its head SHA carries the attempt's real CI as ordinary github-actions check runs, with job links. A -bisection suffix means Trunk is bisecting a failed batch to find the culprit.

The shadow PR's body lists the batch members and the PRs queued ahead of it, which is the only place queue depth is visible. Note the ref is named after the batch leader, so a PR batched behind another never appears in a trunk-merge/pr-<its own number>/ search even while it is actively queued. Search the bodies for it, which is what attempts does; recent still groups by the ref, so it reports a batched member under the leader's number.

Shadow PRs are never merged — every one ends closed and unmerged, whether the PR merged or was kicked. So a shadow PR's own state tells you nothing about the outcome; the sticky comment does. Repeated shadow PRs for the same pr-<n> are repeated attempts, which is the retry-already-happened signal.

Both helpers live in scripts/ next to this file:

Q=.agents/skills/triaging-merge-queue-failures/scripts/mq-queue-state.sh
bash $Q recent PostHog/posthog 2   # <pr> <attempt_pr> <kind> <attempts_seen>, newest first
bash $Q state  PostHog/posthog <n> # state= [stacked=] [fingerprint_sha=] [check=] [job_url=] [testing_pr=]
bash $Q attempts PostHog/posthog <n> [head_oid]  # <attempt_pr> <sha> <kind> <created_at> <covers_head>

An attempt tests one revision of the PR, and covers_head says whether it was the one you asked about: yes when that revision is an ancestor of the shadow head, no when the branch was pushed to after the attempt started. Give attempts a head OID and it keeps only the attempts that cover it; without one it checks the PR's current head and prints the answer per attempt.

attempts finds the attempts a PR was batched into as well as the ones named after it, so it answers for a batch member too. It reads the batch list out of each shadow PR's body and then confirms with the same ancestry check, so a PR queued ahead of this one in the same batch counts as an attempt on both, which is what happened.

Do not read the revision off the shadow head's parents. The shadow head is a chain of merge commits, one per batch member, so its last parent names whichever member Trunk merged last. On a batched attempt that is another PR's head, and taking it for this PR's makes an in-flight attempt look superseded.

attempts_seen from recent counts every attempt on the PR over all of its revisions, so treat it as an upper bound. A PR that was pushed to and re-enqueued shows 2 while its current head has only been tried once. Any per-head decision — the retry gate above all — reads attempts $REPO <n> <head_oid> and counts lines.

A helper that exits 5 means a GitHub read failed, not that there is nothing there. Stop the sweep and report it. Both helpers refuse to tur

Полный SKILL.md на GitHub

Установить triaging-merge-queue-failures в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/routine-setup.mdscripts/mq-queue-state.shscripts/mq-queue-state.test.shscripts/mq-triage-marker.sh

FAQ

Что делает скилл triaging-merge-queue-failures?

Decision procedure for a PR that failed or was removed from the Trunk merge queue: classify the kick (superseded by a newer commit, not mergeable, a gate that failed on a cancelled run, real failure, one-off flake, or repo-wide flaky/infra issue) and take the matching action (wait, hold and fix, requeue once, or escalate instead of spam-retrying). Use when a PR is kicked from the queue, Trunk reports a failed queue attempt on a PR, someone asks "why was my PR removed from the queue" or "should I requeue", or when running as the scheduled merge queue triage sweep. Trigger terms: merge queue kicked, removed from queue, queue failure, requeue, trunk merge failed. Operators setting up the automation itself: see references/routine-setup.md.

Как установить скилл triaging-merge-queue-failures?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл triaging-merge-queue-failures запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить triaging-merge-queue-failures с