Skip to content

Task/awaiting response label#2647

Open
alleria173 wants to merge 3 commits into
gchq:masterfrom
alleria173:task/awaiting-response-label
Open

Task/awaiting response label#2647
alleria173 wants to merge 3 commits into
gchq:masterfrom
alleria173:task/awaiting-response-label

Conversation

@alleria173

Copy link
Copy Markdown
Contributor

Description
Adds two workflows that manage an "awaiting response" label on pull requests, to make it easy to see which PRs are waiting on their author versus waiting on a maintainer:

  1. awaiting-response-label.yml (event-driven) — removes the label as soon as the author responds, either by pushing a new commit or by leaving a comment on the PR. Follows the same pattern as the existing "awaiting cla" labelling workflow (Add a workflow to automatically flag PRs without a signed CLA #2627).
  2. awaiting-response-scan.yml (scheduled, daily) — adds the label to open PRs that are waiting on their author, following the scheduled-workflow precedent set by Feature: automatically expire PRs if CLA remains unsigned for an extended period #2636. It covers two cases: the PR has a merge conflict, or the most recent review requested changes and the author hasn't pushed or commented since.

A scheduled scan is used for adding the label (rather than reacting to review events directly) because GitHub gives workflows a read-only token when they are triggered by reviews on PRs from forks — which is how most contributions arrive — so an event-driven approach cannot apply labels in exactly the cases that matter. Label removal is not affected because the events it uses (pull_request_target, issue_comment) always run with a write-capable token. This behaviour was confirmed by testing against a fork.

Maintainers can also add the label manually at any time (e.g. after asking a question in a comment) — the automatic removal treats manually-added labels identically.

The scan only examines up to 200 most-recently-updated open PRs per run and makes ~2-3 API requests per unlabelled PR, keeping a full sweep of the current backlog (~124 open PRs) comfortably within the GITHUB_TOKEN rate budget.

Possible follow-up, not included here: automatically closing PRs that keep the label for an extended period, following the approach of #2636 (actions/stale scoped with only-labels: 'awaiting response'). Left out deliberately as the issue notes this needs more consideration.

Existing Issue
Fixes #2637

Screenshots
N/A — this change only adds GitHub Actions workflow files, it doesn't affect the CyberChef UI.

AI disclosure
Used Claude Code (Anthropic) to help design and write these workflows. I have reviewed the logic myself and understand how it works.

Test Coverage
No automated tests apply since these are GitHub Actions workflows rather than application code. The event-driven removal workflow was verified end-to-end on a fork with a test PR from a second account: the label was correctly removed both when the author pushed a follow-up commit and when the author left a comment. The same testing confirmed that review-triggered labelling cannot work for fork PRs (read-only token), which motivated the scheduled scan. The scan workflow supports workflow_dispatch so it can be run manually and its per-PR decisions inspected in the run logs before the schedule takes over.

…nse' label for cases where reviewer asks a question
Review events on fork PRs run with a read-only token, so labels can't
be added from the pull_request_review trigger. Move label-adding to a
daily scheduled scan, which also covers PRs with merge conflicts. The
event-driven workflow now handles removal only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track pull requests awaiting a response

1 participant