Why does GitHub recommend closing issues before archiving a repository? #22554
-
The GitHub documentation on archiving repositories recommends closing all open issues before archiving a repository, but doesn’t explain why. I understand that issues cannot be updated once a repository is archived, but it seems like a useful thing to know what unresolved issues there are be in an archived repository. Since I can archve a repository without closing the issues, what are the downsides? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
There is no real reason, I think it is for completeness. If you have archive a repository you have probably solved the whole set of issues, otherwise you haven’t solved the purpose of the repository. It is more a philosophical concept than a rule. |
Beta Was this translation helpful? Give feedback.
-
Thanks for asking! I asked around in engineering and found the person who came up with that recommendation. According to him, there was a point in time when we were considering whether to auto-close all issues and pull requests when a repository was archived. We felt (and still feel) that not closing issues and pull requests before archiving a repository has drawbacks, foremost among them:
In the end, it was decided to make it a recommendation rather than an automatic behavior. I submitted a suggestion to the documentation team to add this reasoning to that help document for clarity. |
Beta Was this translation helpful? Give feedback.
-
I just ran into this annoyance today, but from the other end :) And unfortunately, by default, the archived issues show up there as well which is a tad annoying. So now I have to unarchive my repos so I can close the issues ;) |
Beta Was this translation helpful? Give feedback.
-
I think it would make more sense to have this as an extra filter. Similar to how we can specify public/private visibility, archived should be an option as well For the time being, here's how I solved it: # Loop through all archived repos
for repo in $(gh repo list --archived | cut -f 1); do
# Unarchive the repo
gh repo unarchive -y $repo
# Sleep a bit because github takes some time to update the archived status
sleep 5
# Get all open issues/pull-requests and close them all
gh issue list --state open -R $repo | cut -f 1 | xargs -L1 gh issue close -R $repo
gh pr list --state open -R $repo | cut -f 1 | xargs -L1 gh pr close -R $repo
# Re-archive the repo
gh repo archive -y $repo
done |
Beta Was this translation helpful? Give feedback.
Thanks for asking! I asked around in engineering and found the person who came up with that recommendation.
According to him, there was a point in time when we were considering whether to auto-close all issues and pull requests when a repository was archived. We felt (and still feel) that not closing issues and pull requests before archiving a repository has drawbacks, foremost among them:
People often assume that open issues and pull requests will eventually be acted upon
The person who opened the issue will forever have it listed as open, and will be unable to close it themselves.
In the end, it was decided to make it a recommendation rather than an automatic behavior. I submit…