Skip to content

Commit

Permalink
approvers: add commenter that marks stale PRs (#3655)
Browse files Browse the repository at this point in the history
* approvers: add commenter that marks stale PRs

Adds a periodic job using the commenter to mark PRs that haven't
received a review by an approver within a week with the
needs/approver-review label.

Since that label doesn't exist yet, it is added as well - furthermore
the documentation page is updated.

Signed-off-by: Daniel Hiller <[email protected]>

* approvers: rename label from needs/approver-review

Since the initial approach (using the `/needs ...`) is not supported
by the label plugin, we use the `/label` command. This requires a
configuration in the label plugin section to allow the bot user to set
the label on PRs, which we add here.

Finally we update the labels.md page with the latest changes.

Signed-off-by: Daniel Hiller <[email protected]>

---------

Signed-off-by: Daniel Hiller <[email protected]>
  • Loading branch information
dhiller authored Sep 23, 2024
1 parent 918320b commit 0d3bb5c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ larger set of contributors to apply/remove them.
| <a id="do-not-merge/release-note-label-needed" href="#do-not-merge/release-note-label-needed">`do-not-merge/release-note-label-needed`</a> | Indicates that a PR should not merge because it's missing one of the release note labels. <br><br> This was previously `needs/release-note`, | prow | [release-note](https://prow.ci.kubevirt.io/command-help#release-note) |
| <a id="do-not-merge/work-in-progress" href="#do-not-merge/work-in-progress">`do-not-merge/work-in-progress`</a> | Indicates that a PR should not merge because it is a work in progress.| prow | [wip](https://prow.ci.kubevirt.io/command-help#wip) |
| <a id="lgtm" href="#lgtm">`lgtm`</a> | Indicates that a PR is ready to be merged.| reviewers or members | [lgtm](https://prow.ci.kubevirt.io/command-help#lgtm) |
| <a id="needs-approver-review" href="#needs-approver-review">`needs-approver-review`</a> | Indicates that a PR requires a review from an approver.| prow | [label](https://prow.ci.kubevirt.io/command-help#label) |
| <a id="needs-ok-to-test" href="#needs-ok-to-test">`needs-ok-to-test`</a> | Indicates a PR that requires an org member to verify it is safe to test.| prow | [trigger](https://prow.ci.kubevirt.io/command-help#trigger) |
| <a id="needs-rebase" href="#needs-rebase">`needs-rebase`</a> | Indicates a PR cannot be merged because it has merge conflicts with HEAD.| prow | [needs-rebase](https://prow.ci.kubevirt.io/command-help#needs-rebase) |
| <a id="ok-to-test" href="#ok-to-test">`ok-to-test`</a> | Indicates a non-member PR verified by an org member that is safe to test.| prow | [trigger](https://prow.ci.kubevirt.io/command-help#trigger) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,41 @@ periodics:
- --template
- --ceiling=10
- --confirm
- name: periodic-project-infra-needs-approver-review
interval: 1h
annotations:
testgrid-create-test-group: "false"
labels:
preset-github-credentials: "true"
decorate: true
cluster: kubevirt-prow-control-plane
spec:
containers:
- image: gcr.io/k8s-staging-test-infra/commenter:v20240801-a5d9345e59
command:
- /ko-app/commenter
args:
- |-
--query=org:kubevirt
is:open
is:pr
label:lgtm
-label:approved
-label:do-not-merge/work-in-progress
-label:needs/approver-review
is:public
- --updated=168h
- --token=/etc/github/oauth
- |-
--comment=Pull requests that are marked with `lgtm` should receive a review
from an approver within 1 week.
After that period the bot marks them with the label `needs-approver-review`.
/label needs-approver-review
- --template
- --ceiling=10
- --confirm
- name: periodic-project-infra-autoowners
interval: 24h
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ default:
target: prs
prowPlugin: lgtm
addedBy: reviewers or members
- color: b60205
description: Indicates that a PR requires a review from an approver.
name: needs-approver-review
target: prs
prowPlugin: label
addedBy: prow
- color: 0ffa16
description: Indicates a PR has been approved by an approver from all required OWNERS files.
name: approved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,9 @@ override:
label:
restricted_labels:
'kubevirt':
- allowed_users:
- kubevirt-bot
label: needs-approver-review
- allowed_teams:
- kubevirtorg-label
label: good-first-issue
Expand Down

0 comments on commit 0d3bb5c

Please sign in to comment.