gh-gei
gh-gei copied to clipboard
Option to lock source repos when migrating org
Description
Similar to the --lock-source-repo option available in the migrate-repo command, we need an option to lock source repos when migrating an org.
Here is the PR for --lock-source-repo option for migrate-repo command.
@timrogers : what is the current general guidance for post-migration around gh gei migrate-org regarding the organization itself?
@andyfeller Can you give a bit more of a sense of what you're looking for? I'm not sure I understand the question.
@timrogers : absolutely! So, the question is about what guidance is being offered for migrators following an organization migration, limiting impact from people continuing to make changes to source org.
When using gh gei migrate-repo for production migrations, the person performing the migrations would use the --lock-source-repo flag to prevent additional changes to the source repository. That is not available for gh gei migrate-org migrations as is self evident by this issue.
@andyfeller Thanks - makes sense! My best advice right now would be to archive the repos, I think. How does that sound? We definitely need to add source locking to org-to org as well!
@timrogers : that makes sense to me, thank you!
Just to help others, I imagine that might look like this including updating the description to tell people where to go for the new repository:
for repo in $(gh repo list SOURCE_ORG --json nameWithOwner --jq '.[] | .nameWithOwner'); do
gh repo archive $repo -y
gh repo edit $repo -d 'This repo has been migrated to https://github.com/NEW_ORG/'
done
with rolling back looking like:
for repo in $(gh repo list SOURCE_ORG --json nameWithOwner --jq '.[] | .nameWithOwner'); do
gh repo unarchive $repo -y
done