@@ -64,7 +64,7 @@ import { slackCached } from "@/lib";
6464 *
6565 * c) PER-TARGET-BRANCH STATUS — only runs when `backportStatusRaw` is
6666 * "needed". For each labeled target branch:
67- * - Checks for `* -backport-not- needed` labels (e.g. ` core-backport-not-needed`)
67+ * - Checks for `no -backport-needed[- core|-cloud]` labels
6868 * → marks that target as "not-needed"
6969 * - Uses `compareCommits(target_branch, commit_sha)` to check if the
7070 * commit already exists on that branch:
@@ -126,10 +126,11 @@ import { slackCached } from "@/lib";
126126 * from bots (username ending in `bot` or `[bot]`) are excluded to avoid
127127 * false positives from automated messages.
128128 *
129- * • BACKPORT-NOT-NEEDED LABELS — per-target dismissal labels like
130- * `core-backport-not-needed` override the per-branch status to "not-needed",
131- * even if the commit hasn't been cherry-picked. When ALL targets are
132- * dismissed this way, the overall status becomes "not-needed".
129+ * • BACKPORT-NOT-NEEDED LABELS — `no-backport-needed` dismisses all targets;
130+ * per-target labels `no-backport-needed-core` / `no-backport-needed-cloud`
131+ * override individual branch status to "not-needed", even if the commit
132+ * hasn't been cherry-picked. When ALL targets are dismissed, the overall
133+ * status becomes "not-needed".
133134 *
134135 * • DIVERGED BRANCH (backport PR detection) — when the target branch has
135136 * diverged from the commit (common for long-lived stable branches), the
@@ -183,10 +184,11 @@ const config = {
183184 // 3. backport labels on PRs
184185 backportLabels : [ "needs-backport" ] ,
185186
186- // labels that dismiss backport requirements per target
187+ // labels that dismiss backport requirements per target (or all targets)
188+ backportNotNeededLabel : "no-backport-needed" ,
187189 backportNotNeededLabels : {
188- core : "core -backport-not- needed" ,
189- cloud : "cloud -backport-not- needed" ,
190+ core : "no -backport-needed-core " ,
191+ cloud : "no -backport-needed-cloud " ,
190192 } as Record < string , string > ,
191193
192194 // 5. detect backport mentions
@@ -463,6 +465,10 @@ async function resolveSlackTagForAuthor(githubUsername?: string): Promise<string
463465
464466/** Check if a PR has a backport-not-needed label for a given target prefix (e.g. "core" or "cloud") */
465467function hasBackportNotNeededLabel ( labels : string [ ] , targetPrefix : string ) : boolean {
468+ // General label dismisses all targets
469+ if ( labels . some ( ( l ) => l . toLowerCase ( ) === config . backportNotNeededLabel . toLowerCase ( ) ) )
470+ return true ;
471+ // Per-target label
466472 const notNeededLabel = config . backportNotNeededLabels [ targetPrefix ] ;
467473 if ( ! notNeededLabel ) return false ;
468474 return labels . some ( ( l ) => l . toLowerCase ( ) === notNeededLabel . toLowerCase ( ) ) ;
@@ -593,7 +599,7 @@ async function processTask(
593599
594600 const backportTargetStatus = await sflow ( targetBranches )
595601 . map ( async ( branchName ) => {
596- // Check for * -backport-not- needed labels first (e.g. "core/1.4" → prefix "core")
602+ // Check for no -backport-needed[-core|-cloud] labels first (e.g. "core/1.4" → prefix "core")
597603 const targetPrefix = branchName . split ( "/" ) [ 0 ] ;
598604 if ( hasBackportNotNeededLabel ( labels , targetPrefix ) ) {
599605 logger . debug (
0 commit comments