Make a dent in GitHub issue & PR backlogs across repositories.
Aimed at teams managing multiple projects and sick of the time cost of refinement/triage:
See action.yml
for a full list of configuration options.
name: Priority List
on: { schedule: [{ cron: '0 1 * * 1' }] } # 01:00 (AM, UTC) Mondays
jobs:
priority-list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with: { python-version: '3.x' }
- uses: iterative/priority-list@v1
with:
repos: >-
myorg/somerepo
myorg/otherrepo
github-token: ${{ secrets.GH_TOKEN }} # must have read access to `repos`
weight_activity: 14 # weight for number of comments
weight_reactions: 7 # weight for reactions to original issue
weight_staleness: 1 # weight for days of inactivity
weight_age: 0.142857 # weight for days open
multiplier_pr: 7 # weight multiplier for PRs (compared to issues)
# weight multiplier for labels (negative to exclude)
multiplier_labels: >-
example:-1
epic:0.142857
blocked:0.142857
invalid:0.142857
p_label_graveyard: 4 # largest pN-label (lowest priority)
slack_webhook: ${{ secrets.SLACK_WEBHOOK || '' }} # optional; requires `people.json`
GitHub Actions job summary:
# | priority | days stale | link | assigned |
---|---|---|---|---|
0 | 20377 | 50 | iterative/dvc#755 | @efiop |
1 | 17062 | 0 | iterative/cml#1326 | @dacbd @0x2b3bfa0 |
2 | 15000 | 41 | iterative/cml.dev#382 | @jorgeorpinel |
3 | 69 | 15 | iterative/shtab#127 | @casperdcl |
4 | 0 | 0 | iterative/priority-list#3 | @casperdcl |
... | ... | ... | ... | ... |
The main calculation is done by the priority
function in prioritise.py
. In summary:
- we assume you use
pN-label
s (e.g.p0-critical
,p1-important
,p2-nice-to-have
) on issues/PRs- labels match the Python regex
[pP](?:riority)[\s:-]*([0-9]+).*
- labels match the Python regex
bug
andexternal-request
labels are treated the same asp1
- issues/PRs lacking a
pN-label
are treated asp0
- this bumps unnoticed/unlabelled items to the top of the list, thus encouraging you to at least assign a
pN-label
to (potentially) lower the priority
- this bumps unnoticed/unlabelled items to the top of the list, thus encouraging you to at least assign a
- if an issue/PR has multiple labels, their associated priorities will be summed
- use
multiplier_labels
to exclude (e.g.wip:-1
will skip anything labelledwip
) or scale (e.g.upstream:0.01
) the overall priority of an issue/PR - labels not matching the above rules are ignored
Results are posted in a job summary. To post to your team's slack channel too:
- provide a
slack_webhook
- create a file named
people.json
in the working directory (see e.g. https://status.cml.dev/people.json) to map GitHub usernames to Slack member IDs