Skip to content

Provides a mechanism to "lock" a source GH repo (#2)#424

Closed
pmartindev wants to merge 8 commits intogithub:mainfrom
pmartindev:main
Closed

Provides a mechanism to "lock" a source GH repo (#2)#424
pmartindev wants to merge 8 commits intogithub:mainfrom
pmartindev:main

Conversation

@pmartindev
Copy link
Copy Markdown

@pmartindev pmartindev commented Jun 2, 2022

Issue #385

Added a flag to allow for archiving the source repository before migration. This will allow migration users to block any changes to their repositories that would normally not be included in the migration. Looking for any feedback and discussion on the issue.

  • Did you write/update appropriate tests
  • Release notes updated (if appropriate)
  • Appropriate logging output
  • Issue linked
  • Docs updated (or issue created)

* Added flag to lock GHES and GEC repos

* Added flag to archive a GitHub Cloud repo

This provides a way to essentially lock the source repo to ensure no changes are made during the migration

* Updated unit tests for new flag

* Address compiler warnings in CI process

Added error handling to provide feedback when the repo cannot be archived.
This is typically a sign of an issue with the PAT
@pmartindev
Copy link
Copy Markdown
Author

cc: @tj-cappelletti @cvega

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 2, 2022

Unit Test Results

480 tests   480 ✔️  30s ⏱️
    1 suites      0 💤
    1 files        0

Results for commit e30c072.

♻️ This comment has been updated with latest results.

@dylan-smith
Copy link
Copy Markdown
Contributor

I think this should be implemented as a separate lock-repo command to be consistent with the design already established in ado2gh lock-repo. There is an issue for this improvement with some guidance on design here: #385

@pmartindev
Copy link
Copy Markdown
Author

Hey @dylan-smith, sorry I linked the wrong issue in the comment 😭 It's corrected now.

TJ Cappelletti and others added 5 commits June 7, 2022 10:54
* Reverted lock repo changes

This will be implemented as a command

* Created archive-gh-repo command

Allows for a user to put a repo into a "read-only" before a migration
The goal is to ensure data integrity during a migration
Added option to the generate-script command to use new command
Created unit tests for new command and updated existing ones
Added an integration test for the new command

* Fixed white space issues

* This fixes code from bad merge up stream

* Reverted archive repo flag change

Co-authored-by: Thomas Cappelletti <thomas.cappelletti@incyclesoftware.com>
continue;
}

errorMessageStringBuilder.AppendLine(message.ToString());

Check notice

Code scanning / CodeQL

Redundant ToString() call

Redundant call to 'ToString'.
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
gei 88% 84% 432
ado2gh 89% 83% 541
Octoshift 87% 76% 492
Summary 88% (4526 / 5131) 82% (936 / 1147) 1465

@robandpdx
Copy link
Copy Markdown
Contributor

A better implementation would be to add the lock_repositories boolean to the StartMetadataArchiveGeneration function and use it in the options object there. Similar to skipRelease boolean.
https://github.com/github/gh-gei/blob/main/src/Octoshift/GithubApi.cs#L461-L476

@dylan-smith
Copy link
Copy Markdown
Contributor

Superseded by #589

@dylan-smith dylan-smith closed this Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants