Closed Bug 1783968 Opened 3 years ago Closed 3 years ago

Looking for a script to close all open issues

Categories

(mozilla.org :: Github: Administration, task)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clouserw, Assigned: cknowles)

Details

Howdy.

mozilla/fxa currently has a 2-way sync to Jira. We are converting to a 1-way sync over in https://mozilla-hub.atlassian.net/browse/SDD-7712 . The steps are roughly:

  • Stop the 2-way sync
  • Close all open github issues
  • Start the 1-way sync

For step #2 I'm wondering if you have a script or could easily make one to close all the open github issues in a github project (roughly ~1000 at the time of this writing).

Thanks!

I don't have anything immediately at hand - though closing issues is a part of the repo_archiver.py script in https://github.com/MoCo-GHE-Admin/github-scripts/blob/main/repo_archiver.py --- though that will also close PR's too (which is a welcome side effect for that use case, but not so much for you.

There's a tutorial on using actions to do this kind of thing - https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues --- but that's more around ongoing maintenance.

So, some questions - PR's are really just "special issues" - did you want the PRs to remain open? and did you have any interest in the issue closing to be reversible (which is a main concern of that repo_archiver script)

Yes, PRs to remain open.

Reversing isn't a concern en masse. We can always re-open some manually if needed.

That's a useful tool to possess. I'll have something ready as soon as I can. (Due to appointments and meetings, it might be Friday). Is there a timeframe here? (I can't open that jira ticket in case the time is mentioned there)

It's not critical. No timeframes. Friday would be great. Thanks for your help!

Alright - https://github.com/MoCo-GHE-Admin/github-scripts/blob/main/repo_close_issues.py exists and should do what you want.

I have the env and tokens setup, so I'm happy to run it for you if you like - just need the when, and if you wanted to add a closing comment to the issues before closing them, what that comment should be.

Take a look, laugh at my code, ask questions, let me know how I can help.

Awesome. I'll invite you to a thread on slack to coordinate details. Thanks.

PS - your script mentions a --force but it doesn't exist.

See, laughter is good.

Closed the issues in mozilla/fxa

Updated the script with learnings.

  1. the 422 unprocessable error text that mentioned --force - updated.
  2. made a default 2 second delay to avoid the secondary rate limits, which interrupted us a few times
  3. made that configurable in case GH goes even longer in the future.

I think that ends this bug, reopen if needed.

Assignee: nobody → cknowles
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.