chore: add stale PR workflow#933
Conversation
There was a problem hiding this comment.
Pull request overview
Documents a proposed stale pull request policy for coder/registry, intended to align with the actions/stale-based approach used in coder/coder, with a 15-day stale / 3-day close cadence and a waiting-for-info exemption.
Changes:
- Add a “Stale PR Policy” section to
MAINTAINER.mddescribing labeling/closure behavior and exemptions. - Link the policy to a
Stale PR Cleanupworkflow file path under.github/workflows/.
|
|
||
| ## Stale PR Policy | ||
|
|
||
| The [`Stale PR Cleanup`](./.github/workflows/stale.yaml) workflow runs daily and manages inactive pull requests: |
|
|
||
| - A PR with no activity for **15 days** gets the `stale` label. | ||
| - A PR with the `stale` label is **closed 3 days later** if it sees no further activity. | ||
| - A PR labeled `waiting-for-info` is **exempt** from the stale flow. Apply this label when the PR is waiting on the author so the bot doesn't penalize them for a reviewer-side pause. |
| ## Stale PR Policy | ||
|
|
||
| The [`Stale PR Cleanup`](./.github/workflows/stale.yaml) workflow runs daily and manages inactive pull requests: |
|
Let's do all no exception for I wanted to only use that on issues. For PRs let's be uniform and use 15 days |
bpmct
left a comment
There was a problem hiding this comment.
So excited for this!! I think this will improve both the contribution experience (contributors get faster responses) and the maintainer experience (clear queue of issues that are ready for maintainer review)
This PR seems to just add the policy to MAINTAINER.md, but not the policy itself. We should have this as a draft PR until it's ready for review.
|
|
||
| - A PR with no activity for **15 days** gets the `stale` label. | ||
| - A PR with the `stale` label is **closed 3 days later** if it sees no further activity. | ||
| - A PR labeled `waiting-for-info` is **exempt** from the stale flow. Apply this label when the PR is waiting on the author so the bot doesn't penalize them for a reviewer-side pause. |
There was a problem hiding this comment.
I'm not sure I understand this. Should this be reversed?
If a PR author takes 15+ days to respond, the PR should probably be stalled and closed. However, if the author is waiting on a maintainer (e.g. you, me, Adele) then the author shouldn't be penalized.
Also I think (in this PR) we should set up a bot to automatically apply/un-apply and perhaps change the label to waiting-for-maintainer.
Summary
Adds a stale-PR workflow modeled on
coder/coder's.github/workflows/stale.yaml, tuned to the cadence requested for the registry:stalelabel.stalelabel is closed 3 days later if it sees no further activity.waiting-for-infois exempt from the stale flow.workflow_dispatch.Also documents the policy in
MAINTAINER.mdso reviewers know when to applywaiting-for-info.Why mirror
coder/coder's setupSame action pins (
actions/stale@v10.2.0,step-security/harden-runner@v2.17.0), samepermissionsscoping, sameoperations-per-run: 60/ascending: truedefaults, and empty stale/close messages to avoid PR-thread noise. This keeps the registry's workflow style aligned with the main product repo and passeszizmoratmin-severity: high(which the registry already enforces on every workflow PR).Action required from a maintainer to finish this PR
The agent that opened this PR runs through a GitHub App that intentionally lacks the
workflows: writescope, so it cannot push files under.github/workflows/directly. Two small steps are needed:1. Commit
.github/workflows/stale.yamlto this branchVia GitHub UI on this branch: Add file → Create new file, path
.github/workflows/stale.yaml, paste the YAML below, commit directly tochore/stale-pr-workflow.2. Create the
stalelabel on the repoactions/staledoes not auto-create labels. Before the first scheduled run, create the label oncoder/registry:stale#ededed(or any neutral gray)The
waiting-for-infolabel already exists and is being used as the exempt label as-is (lowercase, hyphenated).Verifying after merge
Kick off the workflow with
workflow_dispatchfrom the Actions tab to confirm the action wires up correctly. With no PRs over the 15-day threshold yet, the run will be a no-op and just log how many PRs it scanned.Design notes / decisions
coder/coder's 7/3) chosen per the request — the registry has more external community PRs and a longer first-touch window than the product repo.exempt-pr-labels: waiting-for-infouses the existing label exactly as it is on the repo (lowercase, hyphenated). No rename.stale-pr-message: ""/close-pr-message: ""matchescoder/coder— keeps PR threads clean. Easy to add a friendly contributor-facing message later if we decide we want one.days-before-issue-stale: -1/days-before-issue-close: -1so this workflow is scoped strictly to PRs as requested.step-security/harden-runnermatches the security baseline used across the registry's other workflows (version-bump.yaml,zizmor.yaml,check_registry_site_health.yaml).coder/coder'sstale.yamlalso contains; an issue stale flow; a contributor-facing stale message body.