with one click
backport-pr-assistant
Help backport PRs to release branches using the backport CLI tool. Use when backporting changes that have merge conflicts requiring manual resolution.
Menu
Help backport PRs to release branches using the backport CLI tool. Use when backporting changes that have merge conflicts requiring manual resolution.
| name | backport-pr-assistant |
| description | Help backport PRs to release branches using the backport CLI tool. Use when backporting changes that have merge conflicts requiring manual resolution. |
Help the user backport pull requests to older release branches, especially when conflicts need resolution.
Always pass --no-browser to prevent the backport tool from opening browser
windows. If --no-browser is not recognized, the user has an old version of the
tool — upgrade it by running go install github.com/cockroachdb/backport@latest
and retry.
Basic Usage:
backport --no-browser <pull-request>... # Backport entire PR(s)
backport --no-browser <pr> -r <release> # Target specific release (e.g., -r 23.2)
backport --no-browser <pr> -b <branch> # Target specific branch (e.g., -b release-23.1.10-rc)
backport --no-browser <pr> -j "justification" # Add release justification
backport --no-browser <pr> -c <commit> -c <commit> # Cherry-pick specific commits only
backport --no-browser <pr> -f # Force operation
Conflict Resolution:
backport --continue # Resume after resolving conflicts
backport --abort # Cancel in-progress backport
Common Examples:
backport --no-browser 23437 # Simple backport
backport --no-browser 23437 -r 23.2 # To release-23.2 branch
backport --no-browser 23437 -j "test-only changes" # With justification
backport --no-browser 23437 -b release-23.1.10-rc # To specific release candidate branch
When the user specifies exact release branches, use those directly. When the user says something like "backport to all branches" or "backport to all supported releases" without listing specific versions, determine which branches are still supported by fetching the CockroachDB release support policy page:
https://www.cockroachlabs.com/docs/releases/release-support-policy
The page contains two tables: Supported versions and Unsupported versions. Only backport to versions whose Maintenance Support end date has not yet passed — versions in the Assistance Support phase only receive critical security fixes, not general bug-fix backports. Skip any version that appears in the Unsupported versions table (it is EOL). Pay attention to Innovation releases — they have shorter support windows and no Assistance Support phase, so they may have recently gone EOL.
Before starting the first backport, prompt the user for a release justification
(e.g., "bug fix for potential data loss", "test-only changes", "security patch").
Use the same justification across all backport PRs. Pass it to every backport
invocation via -j.
backport --no-browser <pr> -r <release> -j "<justification>" for the target branchgit add the resolved filesbackport --continue to resumegh pr create (see "Creating Backport PRs" below)Only create PRs when the user explicitly requests it. Use gh pr create with the
following conventions:
PR Title Format:
release-XX.X: <original PR title>
The title is the release branch prefix, a colon, a space, and then the original PR title verbatim. For example, if the original PR title is "keys: handle case where keys targeted by GC request straddle header" and the target branch is release-24.3, the backport PR title should be:
release-24.3: keys: handle case where keys targeted by GC request straddle header
PR Body Format:
Match the standard body format used by the backport tool:
Backport N/N commits from #<original-pr> on behalf of @<user>.
----
<original PR commit messages or body>
----
Release justification: <justification>
Example gh pr create invocation:
gh pr create \
--repo cockroachdb/cockroach \
--base release-24.3 \
--head <user>:backport24.3-<pr-number> \
--title "release-24.3: <original title>" \
--body "<body following the format above>"
Simple conflicts you can resolve directly:
Complex conflicts - ask the user for guidance:
git add <files> then backport --continueRun a single CockroachDB roachtest end-to-end: pick local vs. user's GCE worker, launch detached on worker via tmux + `roachstress.sh` with long-poll done-notification and tail. Use whenever user asks to run/stress/kick off a roachtest, or just modified one and next step is running it. Single test + single iteration only; nightly loops belong elsewhere.
Analyze DRT cluster health for a given time range. Reconstructs the operations timeline, checks CockroachDB metrics (availability, latency, storage, changefeeds, jobs, goroutines, admission control, LSM, KV prober) and logs for anomalies, correlates findings with disruptive operations to distinguish expected side-effects from real bugs. Use when asked to "analyze DRT", "check cluster health", "what happened on the DRT cluster", "DRT health report", investigate DRT issues, or review DRT operations. Also use when the user mentions a DRT cluster name (drt-scale, drt-chaos, drt-large, etc.) in the context of health or operations.
Skip a flaky or broken test with proper issue tracking. Use when asked to skip a test, disable a test, or mark a test as flaky.
Use when downloading test logs, artifacts, or outputs.zip from EngFlow build invocations. Use when investigating CockroachDB CI test failures hosted on mesolite.cluster.engflow.com.
Migrate React components from Redux + Saga to SWR hooks. Use when converting data fetching from Redux store (reducers, sagas, selectors, connect HOC) to SWR-based hooks in CockroachDB DB Console or cluster-ui.
Bump cluster-ui package version after a release branch cut. Creates two PRs — one to drop the prerelease suffix on the release branch and one to increment the minor version on master.