gh-gei icon indicating copy to clipboard operation
gh-gei copied to clipboard

Option to lock source repos when migrating org

Open robandpdx opened this issue 3 years ago • 5 comments

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.

robandpdx avatar Nov 01 '22 15:11 robandpdx

@timrogers : what is the current general guidance for post-migration around gh gei migrate-org regarding the organization itself?

andyfeller avatar May 16 '23 12:05 andyfeller

@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 avatar May 16 '23 12:05 timrogers

@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 avatar May 16 '23 12:05 andyfeller

@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 avatar May 16 '23 12:05 timrogers

@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 

andyfeller avatar May 16 '23 13:05 andyfeller