Skip to content

Automate removal of the ready-for-review label#1568

Open
simongdavies wants to merge 1 commit into
hyperlight-dev:mainfrom
simongdavies:feat/ready-for-review-label
Open

Automate removal of the ready-for-review label#1568
simongdavies wants to merge 1 commit into
hyperlight-dev:mainfrom
simongdavies:feat/ready-for-review-label

Conversation

@simongdavies

Copy link
Copy Markdown
Member

What

Automates removal of the ready-for-review label from a pull request once it is
no longer awaiting review.

The label is removed 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.

Adding the label stays a manual / author action (now documented in
docs/github-labels.md); only removal is automated.

How

The reusable engine lives in the organisation's .github repository
(hyperlight-dev/.github) so every repository can share one implementation.
This PR adds the hyperlight-side pieces:

  • .github/workflows/ready-for-review-label.yml — a thin caller that
    triggers on pull_request_target (closed, converted_to_draft) and
    pull_request_review (submitted, dismissed) and invokes the shared
    engine, pinned to commit 12c76e8.
  • docs/github-labels.md — a new "Review readiness" section describing when
    the label is added (manually) and removed (automatically).

pull_request_target is used so the job has a write-scoped token for pull
requests from forks. This is safe because the engine never checks out or
executes PR code — it only reads PR metadata and removes a label.

Notes

  • Review counting uses the GraphQL latestOpinionatedReviews field, so only
    each reviewer's most recent approve / request-changes counts (comments are
    ignored and a reviewer is never double-counted).
  • The approval and change-request thresholds are workflow inputs that default
    to 2.
  • Validated locally: the workflow YAML passes schema checks and the engine's
    run script passes bash -n.

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 <simongdavies@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 22, 2026 20:21
@simongdavies simongdavies added kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. area/infrastructure Concerns infrastructure rather than core functionality labels Jun 22, 2026
@simongdavies simongdavies added kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. area/infrastructure Concerns infrastructure rather than core functionality labels Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an automated mechanism to remove the ready-for-review label when a pull request is no longer awaiting review, by wiring repository events into a reusable org-wide workflow. It also documents the intended manual-add / automatic-remove behavior in the project’s label documentation.

Changes:

  • Adds a new GitHub Actions workflow that calls the shared hyperlight-dev/.github “manage-ready-for-review” reusable workflow on relevant PR/review events.
  • Documents the “ready-for-review” label lifecycle (when to add it, and when it will be removed automatically).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/ready-for-review-label.yml Adds the caller workflow that triggers on PR closure/draft conversion and review submission/dismissal, and invokes the pinned org-wide reusable workflow.
docs/github-labels.md Documents the ready-for-review label purpose and the automatic removal criteria.

Comment on lines +27 to +30
permissions:
contents: read
pull-requests: write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/infrastructure Concerns infrastructure rather than core functionality kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants