From 158635198e8fc8b158c61935ac3dd972d2f32272 Mon Sep 17 00:00:00 2001 From: easonLiangWorldedtech Date: Tue, 6 Oct 2026 00:50:32 +0800 Subject: [PATCH 1/9] feat(label): mark stacked pull requests so reviewers can filter them A stacked unit's head commit has exactly one parent, and that parent is another open pull request's head. The reconcile workflow already reads PR metadata, so it can identify that relationship and apply a `stacked` label, which lets reviewers filter the PR list to standalone PRs. The label is orthogonal to the review-state labels, so it is reconciled separately and never removed by reconcileLabels. A stale label is removed when the parent is no longer another open PR head. The open-PR map is read only when there is a PR to reconcile, so an unassociated workflow run still resolves to zero reads. A commit lookup failure is an advisory, not a failure. This is the labelling half of #1923; the measurement half is #1924. --- .github/workflows/label-pr-review-state.yml | 54 ++++++++++++++++ .../pr-review-state-workflow.test.ts | 64 +++++++++++++++++-- 2 files changed, 113 insertions(+), 5 deletions(-) diff --git a/.github/workflows/label-pr-review-state.yml b/.github/workflows/label-pr-review-state.yml index 08ecf2e3fe..f9fb20c2fd 100644 --- a/.github/workflows/label-pr-review-state.yml +++ b/.github/workflows/label-pr-review-state.yml @@ -33,6 +33,8 @@ permissions: issues: write checks: read statuses: write + # Reading a commit's parents is metadata only; no PR code is checked out or executed. + contents: read concurrency: group: label-pr-review-state @@ -86,6 +88,11 @@ jobs: color: 'c2e0c6', description: 'Fresh community approval on the current head; maintainer review still required', }, + { + name: 'stacked', + color: 'c2c2c2', + description: 'Head commit sits on another open PR, so its diff is only this unit', + }, ]; const guideMarker = ''; const codeRabbitLabelMarkerPrefix = '