Looking for a script to close all open issues
Categories
(mozilla.org :: Github: Administration, task)
Tracking
(Not tracked)
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!
| Assignee | ||
Comment 1•3 years ago
|
||
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)
| Reporter | ||
Comment 2•3 years ago
|
||
Yes, PRs to remain open.
Reversing isn't a concern en masse. We can always re-open some manually if needed.
| Assignee | ||
Comment 3•3 years ago
|
||
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)
| Reporter | ||
Comment 4•3 years ago
|
||
It's not critical. No timeframes. Friday would be great. Thanks for your help!
| Assignee | ||
Comment 5•3 years ago
|
||
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.
| Reporter | ||
Comment 6•3 years ago
|
||
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.
| Assignee | ||
Comment 7•3 years ago
|
||
See, laughter is good.
Closed the issues in mozilla/fxa
Updated the script with learnings.
- the 422 unprocessable error text that mentioned --force - updated.
- made a default 2 second delay to avoid the secondary rate limits, which interrupted us a few times
- made that configurable in case GH goes even longer in the future.
I think that ends this bug, reopen if needed.
Description
•