From 2e29720e0b9b11a7dcb8d65e6decc205d5048e76 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Mon, 22 Jun 2026 20:27:11 +0100 Subject: [PATCH 1/5] Add ready-for-review label automation caller and docs Adds a caller workflow that invokes the org-wide reusable manage-ready-for-review workflow to strip the ready-for-review label when a PR is closed or merged, becomes a draft, gains >=2 approvals, or gains >=2 change requests. Documents the label lifecycle in docs/github-labels.md. Signed-off-by: Simon Davies --- .github/workflows/ready-for-review-label.yml | 37 ++++++++++++++++++++ docs/github-labels.md | 13 +++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/ready-for-review-label.yml diff --git a/.github/workflows/ready-for-review-label.yml b/.github/workflows/ready-for-review-label.yml new file mode 100644 index 000000000..25ff76415 --- /dev/null +++ b/.github/workflows/ready-for-review-label.yml @@ -0,0 +1,37 @@ +name: Ready-for-review label + +# Caller workflow that wires this repository's pull-request events up to the +# reusable `manage-ready-for-review.yml` workflow, which removes the +# "ready-for-review" label once a PR is no longer awaiting review. +# +# `pull_request_target` (rather than `pull_request`) is required so that the job +# has a read/write token for pull requests opened from forks. This is safe here +# because the reusable workflow never checks out or executes pull-request code. +# +# The label logic lives in the organisation's `.github` repository so that every +# repository consumes the same engine. To roll this out to another repository, +# copy this file verbatim - the `uses:` reference below already points at the +# shared engine. +on: + pull_request_target: + types: [closed, converted_to_draft] + pull_request_review: + types: [submitted, dismissed] + +# Serialise runs per pull request so that concurrent events (for example, a +# review submitted at the same moment the PR is closed) cannot race on the label. +concurrency: + group: ready-for-review-${{ github.event.pull_request.number }} + cancel-in-progress: false + +permissions: + contents: read + pull-requests: write + +jobs: + manage-label: + # Shared engine in the org-wide `.github` repository, pinned to a commit SHA + # (matching this repository's action-pinning convention). + uses: hyperlight-dev/.github/.github/workflows/manage-ready-for-review.yml@12c76e8040b3a64d36cc8e95b129996dba6a8c54 + with: + pr-number: ${{ github.event.pull_request.number }} diff --git a/docs/github-labels.md b/docs/github-labels.md index 5133f048a..97b008f29 100644 --- a/docs/github-labels.md +++ b/docs/github-labels.md @@ -7,6 +7,19 @@ We use GitHub labels to categorize PRs. Before a PR can be merged, it must be as - **kind/enhancement** - For PRs that introduce new features or improve existing functionality. This label also applies to improvements in documentation, testing, and similar areas. Any changes must be backward-compatible. - **kind/refactor** - For PRs that restructure or remove code without adding new functionality. This label also applies to changes that affect user-facing APIs. +## Review readiness + +We use the **ready-for-review** label to signal that a PR is waiting for a (re-)review: + +- **Add** `ready-for-review` when you open a PR that is ready for review, or when a PR is ready for re-review (for example, once you have addressed requested changes and re-requested review). +- The label is **removed automatically** by the [`Ready-for-review label`](../.github/workflows/ready-for-review-label.yml) workflow once the PR is no longer awaiting that review, specifically when any of the following become true: + - the PR is closed or merged, + - the PR is converted to a draft, + - the PR has two or more approvals, or + - the PR has two or more change requests. + +You only ever need to add the label; removal is fully automated. + --- # **Issues** From 38281eb44b6b67f552308886c2854252812ed7d7 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 23 Jun 2026 10:25:27 +0100 Subject: [PATCH 2/5] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Simon Davies --- .github/workflows/ready-for-review-label.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ready-for-review-label.yml b/.github/workflows/ready-for-review-label.yml index 25ff76415..8a4a7248d 100644 --- a/.github/workflows/ready-for-review-label.yml +++ b/.github/workflows/ready-for-review-label.yml @@ -26,8 +26,8 @@ concurrency: permissions: contents: read - pull-requests: write - + pull-requests: read + issues: write jobs: manage-label: # Shared engine in the org-wide `.github` repository, pinned to a commit SHA From 0686d165dbacee6a5a07fdd2da947b9b2fab87cc Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 23 Jun 2026 11:57:06 +0100 Subject: [PATCH 3/5] update commit sha Signed-off-by: Simon Davies --- .github/workflows/ready-for-review-label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ready-for-review-label.yml b/.github/workflows/ready-for-review-label.yml index 8a4a7248d..e63389aa3 100644 --- a/.github/workflows/ready-for-review-label.yml +++ b/.github/workflows/ready-for-review-label.yml @@ -32,6 +32,6 @@ jobs: manage-label: # Shared engine in the org-wide `.github` repository, pinned to a commit SHA # (matching this repository's action-pinning convention). - uses: hyperlight-dev/.github/.github/workflows/manage-ready-for-review.yml@12c76e8040b3a64d36cc8e95b129996dba6a8c54 + uses: hyperlight-dev/.github/.github/workflows/manage-ready-for-review.yml@8eaae4229db908ea64fff06c31dbf5677611ce5e with: pr-number: ${{ github.event.pull_request.number }} From f117a502a08da0719e52292dc654eca896598cb5 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 30 Jun 2026 10:42:00 +0100 Subject: [PATCH 4/5] Review feedack and update to shared workflow Signed-off-by: Simon Davies --- .github/workflows/ready-for-review-label.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ready-for-review-label.yml b/.github/workflows/ready-for-review-label.yml index e63389aa3..b41f1755d 100644 --- a/.github/workflows/ready-for-review-label.yml +++ b/.github/workflows/ready-for-review-label.yml @@ -1,25 +1,22 @@ name: Ready-for-review label -# Caller workflow that wires this repository's pull-request events up to the -# reusable `manage-ready-for-review.yml` workflow, which removes the -# "ready-for-review" label once a PR is no longer awaiting review. +# When a pull-request changes state (closed, converted to draft) or a review is submitted/dismissed, +# run the `manage-ready-for-review.yml` workflow, to remove the +# "ready-for-review" label once a PR if its no longer needed. # # `pull_request_target` (rather than `pull_request`) is required so that the job # has a read/write token for pull requests opened from forks. This is safe here # because the reusable workflow never checks out or executes pull-request code. # -# The label logic lives in the organisation's `.github` repository so that every -# repository consumes the same engine. To roll this out to another repository, -# copy this file verbatim - the `uses:` reference below already points at the -# shared engine. +# The label removal workflow lives in hyperlight-dev's `.github` repository. To apply this workflow +# to another repository, copy this file to that repo. on: pull_request_target: types: [closed, converted_to_draft] pull_request_review: types: [submitted, dismissed] -# Serialise runs per pull request so that concurrent events (for example, a -# review submitted at the same moment the PR is closed) cannot race on the label. +# Serialise runs per pull request so that concurrent events cannot race. concurrency: group: ready-for-review-${{ github.event.pull_request.number }} cancel-in-progress: false @@ -30,8 +27,7 @@ permissions: issues: write jobs: manage-label: - # Shared engine in the org-wide `.github` repository, pinned to a commit SHA - # (matching this repository's action-pinning convention). - uses: hyperlight-dev/.github/.github/workflows/manage-ready-for-review.yml@8eaae4229db908ea64fff06c31dbf5677611ce5e + # Shared workflow in the org-wide `.github` repository, pinned to a commit SHA + uses: hyperlight-dev/.github/.github/workflows/manage-ready-for-review.yml@55e0ed4457b40f371ec9b6f2828397b09a833a43 with: pr-number: ${{ github.event.pull_request.number }} From 006bda7c0c88fe3042e025efcb4f0147befe3b53 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 30 Jun 2026 21:24:33 +0100 Subject: [PATCH 5/5] Update .github/workflows/ready-for-review-label.yml Co-authored-by: Dan Chiarlone Signed-off-by: Simon Davies --- .github/workflows/ready-for-review-label.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ready-for-review-label.yml b/.github/workflows/ready-for-review-label.yml index b41f1755d..bbbc85027 100644 --- a/.github/workflows/ready-for-review-label.yml +++ b/.github/workflows/ready-for-review-label.yml @@ -1,8 +1,8 @@ name: Ready-for-review label # When a pull-request changes state (closed, converted to draft) or a review is submitted/dismissed, -# run the `manage-ready-for-review.yml` workflow, to remove the -# "ready-for-review" label once a PR if its no longer needed. +# run the `manage-ready-for-review.yml` workflow, to remove the +# "ready-for-review" label from a PR if its no longer needed. # # `pull_request_target` (rather than `pull_request`) is required so that the job # has a read/write token for pull requests opened from forks. This is safe here