Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: close stale issues and PRs automatically #11778

Merged
merged 8 commits into from
Feb 25, 2022
Merged

Conversation

sigveio
Copy link
Contributor

@sigveio sigveio commented Aug 24, 2021

Summary

This PR proposes two new jobs for the GitHub automated workflow.

They are based on the Close Stale Issues Github Action.

Details

Base conditions for all jobs:

  • Issues labeled Stale will be closed with no further activity after
    • 5 days for issues
    • 14 days for PRs.
  • The existing workflow would then lock after a further 30 days of inactivity.

Job: "Close stale issues and PRs older than 12 months"

Legacy cleanup to label all* issues and PRs with no activity for 1 year as Stale.

*Click to see exemptions! These are exempt:
  • Labeled:
    • Confirmed
    • Discussion
    • Documentation 📖
    • good first issue
    • Help Wanted
  • Has assignee
  • Has milestone

Impact 💥

This could potentially close almost 600 issues at this point in time.

It would also affect around 65 stale PRs.


Job: "Close stale issues and PRs"

Normal routine applying to all* new issues and PRs from this date forward.

Labels issues and PRs matching the following conditions as Stale:

  • Issues with activity for 30 days and still carrying the Needs Triage label.
  • PRs with no activity for 90 days.

These are exempt:

  • Has assignee
  • Has milestone

Motivation

Trimming down the amount of open issues and PRs could help make it easier to maintain an overview for those managing the project. I think it would also help make the project more approachable for potential contributors.

The new automated workflow would help take care of it going forward. 🤖 💙

Things to consider / discuss

  • This will fire off a lot of emails initially; but in my opinion it's worth it.
  • At the moment the "legacy" (1-year) job runs everything in one big batch. This should be fine, as Github AFAIK allows upto 5000 requests to the API per hour in this setting. And I feel it's less painful/intrusive to have one big surge of emails.
  • An even more aggressive approach is possible, but I found it prudent to start reasonably soft and rather do it in several "waves" over some time.
  • The bot should revert the labelling automatically if someone comments, reducing the need for any form of manual intervention for issues or PRs where users feel the Stale classification is incorrect.
  • The GitHub Action supports a "debug-only" dry-run mode, so we could test it out without making actual changes. And verify a random subset.

Todo before this could be merged:

  • Add Stale label
  • Consider removing 📖 -icon from Documentation label, as I'm not 100% sure if the bot plays well with it.
  • Could we clean up the labels in general? There are several unused or minimally used ones.

Warning

⚠️   Please note that these tasks are merely a draft based on documentation, and has not been tested yet. ⚠️

- Label all issues and PRs older than 1 year (except certain labels)
as Stale, close if no further activity after warning period.
- From this date forward, label issues with no activity for 30 days
and still carrying the `Needs Triage` label as Stale, close if no
further activity after warning period.
- From this date forward, label PRs with no activity for 90 days as
stale and close if no further activity after warning period.

Issues and PRs with milestones or assignees are exempt.
@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2021

Codecov Report

Merging #11778 (f0f4da6) into master (4f4062b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11778   +/-   ##
=======================================
  Coverage   69.01%   69.01%           
=======================================
  Files         312      312           
  Lines       16346    16346           
  Branches     4742     4742           
=======================================
  Hits        11281    11281           
  Misses       5037     5037           
  Partials       28       28           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f4062b...f0f4da6. Read the comment docs.

@sigveio
Copy link
Contributor Author

sigveio commented Aug 24, 2021

I have updated it to use a dry-run mode.

Together with ACTIONS_RUNNER_DEBUG this could allow for some basic verification before it's thrown into the wild.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sigveio! Sorry I dropped the ball on this.

I think this is something we want to - 1.5k open issues iss too many to reasonably be able to address. I've had some extra time in the last couple of weeks, but I've only reduced the PR count by about 40 , and not even looked at issues unless linked to PRs. Being able to close out old ones, and then having new ones opened which follow the great templates you put together seems reasonable to me.

days-before-pr-stale: 365
days-before-issue-close: 5
days-before-pr-close: 14
exempt-issue-labels: 'Confirmed,Discussion,Documentation :book:,good first issue,Help Wanted'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some sort of pinned?

with:
stale-issue-message: 'This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have something about "open up a new issue following the template and link to this issue if still relevant" thing?

@SimenB
Copy link
Member

SimenB commented Feb 25, 2022

Created the Stale label: https://github.com/facebook/jest/labels/Stale

@SimenB
Copy link
Member

SimenB commented Feb 25, 2022

Could we clean up the labels in general? There are several unused or minimally used ones.

We should

@SimenB
Copy link
Member

SimenB commented Feb 25, 2022

I tweaked this

  • encourage new issues/PRs linking to old ones
  • No exempted labels except an explicit Pinned
  • A single workflow - splitting into two files doesn't give us anything, AFAIK

I should also probably make a pinned issue explaining why we're doing and a place for people to provide feedback

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's try it. it's debug-only for now, so shouldn't actually do anything.

Thanks for getting this started @sigveio!

@SimenB SimenB merged commit ce7bc85 into jestjs:main Feb 25, 2022
@SimenB
Copy link
Member

SimenB commented Feb 25, 2022

Ok, looks good! Activated it and filed #12496. Thanks again @sigveio 🙂

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants