renovate icon indicating copy to clipboard operation
renovate copied to clipboard

Run a GitHub Action weekly to check for issues that are missing labels

Open HonkingGoose opened this issue 2 years ago • 3 comments

Describe the proposed change(s).

Intro

I wrote some GitHub issue search queries that help us check if any issues are wrongly labeled.

Maybe we can automate this task, by writing a GitHub Action script.

Requirements

  1. Action runs weekly
  2. Check if any queries have a match
    • If a query matches (so an issue is missing labels), throw error
    • If no query matches, exit cleanly

Queries

https://github.com/renovatebot/renovate/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+-label%3Astatus%3Arequirements+-label%3Astatus%3Aready+-label%3Astatus%3Ain-progress+-label%3Astatus%3Ablocked+-label%3Astatus%3Awaiting-on-response+

https://github.com/renovatebot/renovate/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+-label%3Atype%3Abug+label%3Astatus%3Aready+-label%3Atype%3Afeature+-label%3Atype%3Adocs+-label%3Atype%3Arefactor+

https://github.com/renovatebot/renovate/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+-label%3Apriority-1-critical+-label%3Apriority-2-high+-label%3Apriority-3-medium+-label%3Apriority-4-low++-label%3Apriority-5-triage

Todo:

  • [ ] Put status query in action
  • [ ] Put type of issue query in action
  • [ ] Put priority query in action
  • [ ] Run action weekly
  • [ ] Make action error if any query matches
  • [ ] Else action exits cleanly
  • [ ] If action works properly, update docs/development/issue-labeling to remove the queries, and mention the GitHub action check run

HonkingGoose avatar Jun 27 '22 10:06 HonkingGoose

How would we process this result? e.g. we "notice" a failed checkrun, or something else?

rarkins avatar Jun 27 '22 19:06 rarkins

We'll probably accidentally ignore the failed checkrun for the label check action. I usually ignore all CI messages that come from my PRs in this repository. Usually they're just telling me that a CI run has been cancelled due to merging in the latest main branch. 🙈

Ideally the action would open an issue something like this:

# Label check action

## Found issue(s) with missing `status:` labels:

- #<number>

## Found issues(s) with missing `type:` labels:

- #<number>

## Found issues(s) with missing `priority` labels:

- #<number>

HonkingGoose avatar Jun 28 '22 10:06 HonkingGoose

@JamieMagee this is somewhat related to the issue you opened recently:

  • #17050

Checking labels is a thing that the GitHub Action can do for us. But I need somebody else to write the code. 😉 Let me know what you think? 😉

HonkingGoose avatar Aug 09 '22 10:08 HonkingGoose

@JamieMagee do you want to work on this issue?

HonkingGoose avatar Aug 29 '22 10:08 HonkingGoose

@HonkingGoose Not right now, but you're right that the update-data workflow would be a good basis for a new workflow to add issue labels.

JamieMagee avatar Aug 29 '22 15:08 JamieMagee

Do you guys mind if I work on this one?

denis-rossati avatar Mar 04 '24 12:03 denis-rossati

I'm happy for you to work on this.

What changed?

Some things changed between when I opened this issue and now, that you should know:

  • Only maintainers may create issues
    • Because a maintainer makes the issue we assume:
      • the issue is status:ready (most of the time), so we dropped the status:ready label
      • the issue is at least priority-4-low, so we dropped the priority-5-triage label

Related PR:

  • #25023

Issue labeling docs

Our Issue labeling docs mention a search for the issue and for the priority labels.

Updated requirements

I think the updated requirements are:

  • [ ] Check if all issues have a type: label
  • [ ] Check if all issues have a priority-number-description label
  • [ ] Run GitHub Action weekly
  • [ ] Error if any of the searches return a result (which means a maintainer needs to apply a label)
  • [ ] If none of the searches returns a result: exit action cleanly
  • [ ] Test action works
  • [ ] Update the Issue labeling docs so they mention the action
  • [ ] Put a comment in the action, that explains how to update it (we sometimes rename/drop labels, which may affect the results of the action!)

HonkingGoose avatar Mar 04 '24 15:03 HonkingGoose

@denis-rossati I'm assigning this issue to you, so we know you're going to work on it. 😉

HonkingGoose avatar Mar 06 '24 10:03 HonkingGoose

Much appreciated! I'm already working on it

denis-rossati avatar Mar 06 '24 12:03 denis-rossati