Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ Unlike trunk, the PR builds _will_ utilize the Gradle cache.
In order to get the attention of committers, we have a triage workflow for Pull Requests
opened by non-committers. This workflow consists of two files:

* [pr-update.yml](pr-update.yml) When a PR is created, add the `triage` label if the PR
was opened by a non-committer.
* [pr-reviewed.yml](pr-reviewed.yml) Cron job to remove the `triage` label from PRs which have been reviewed
* [pr-update.yml](pr-update.yml) When a PR is created, add the `triage` label if
the PR was opened by a non-committer.
* [pr-labels-cron.yml](pr-labels-cron.yml) Cron job to add `needs-attention` label to community
PRs that have not been reviewed after 7 days. Also includes a cron job to
remove the `triage` and `needs-attention` labels from PRs which have been reviewed.

_The pr-update.yml workflow includes pull_request_target!_

Expand All @@ -82,7 +84,8 @@ organization must be public. Here are the steps to take:
* Find yourself
* Change "Organization Visibility" to Public

Full documentation for this process can be found in GitHub's docs: https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership
Full documentation for this process can be found in GitHub's docs:
https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership

If you are a committer and do not want your membership in the ASF org listed as public,
you will need to remove the `triage` label manually.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Remove Triage Label
name: Fixup PR Labels

on:
workflow_dispatch: # Let us run manually

schedule:
- cron: '0 3 * * *' # Run at 3:00 UTC nightly -- just before the "stale.yml" workflow
- cron: '0 3 * * *' # Run at 3:00 UTC nightly

jobs:
remove-triage:
# This job removes the triage and needs-attention labels from any PRs that have been reviewed. Once reviewed, it is
# assumed that a PR does _not_ need extra attention from the committers, so these labels can be removed.
fixup-pr-labels:
runs-on: ubuntu-latest
strategy:
matrix:
label: [triage, needs-attention]
steps:
- name: Env
run: printenv
Expand All @@ -35,8 +40,9 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log("Finding PRs with label '${{ matrix.label }}'");
github.paginate("GET /search/issues{?q}", {
q: "repo:apache/kafka label:triage is:pull-request"
q: "repo:apache/kafka label:${{ matrix.label }} is:pull-request"
})
.then((pulls) => {
pulls.forEach(pull => {
Expand All @@ -50,14 +56,37 @@ jobs:
}).then((resp) => {
console.log("Found " + resp.data.length + " reviews for PR " + pull.number);
if (resp.data.length > 0) {
console.log("Removing 'triage' label from PR " + pull.number + " : " + pull.title);
console.log("Removing '${{ matrix.label }}' label from PR " + pull.number + " : " + pull.title);
github.rest.issues.removeLabel({
owner: "apache",
repo: "kafka",
issue_number: pull.number,
name: "triage"
name: "${{ matrix.label }}"
});
}
});
});
});

# This job adds a 'needs-attention' label to any PR that has not been updated in 7 days and has been labeled with 'triage'.
# The idea here is to give committers a quick way to see which PRs have languished and need attention.
needs-attention:
runs-on: ubuntu-latest
needs: [fixup-pr-labels]
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
debug-only: ${{ inputs.dryRun || false }}
operations-per-run: ${{ inputs.operationsPerRun || 500 }}
days-before-stale: 7
days-before-close: -1
ignore-pr-updates: true
only-pr-labels: 'triage'
stale-pr-label: 'needs-attention'
stale-pr-message: |
A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the `triage` label
should be removed to prevent this automation from happening again.
16 changes: 0 additions & 16 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,6 @@ permissions:
pull-requests: write

jobs:
needs-attention:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
debug-only: ${{ inputs.dryRun || false }}
operations-per-run: ${{ inputs.operationsPerRun || 500 }}
days-before-stale: 7
days-before-close: -1
ignore-pr-updates: true
only-pr-labels: 'triage'
stale-pr-label: 'needs-attention'
stale-pr-message: |
A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the `triage` label
should be removed to prevent this automation from happening again.
stale:
runs-on: ubuntu-latest
steps:
Expand Down