-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt repositories #12920
Adopt repositories #12920
Conversation
Prior to this PR Gitea would delete any repository files if they are present during creation or migration. This can in certain circumstances lead to data-loss and is slightly unpleasant. This PR provides a mechanism for Gitea to adopt repositories on creation and otherwise requires an explicit flag for deletion. PushCreate is slightly different - the create will cause adoption if that is allowed otherwise it will delete the data if that is allowed. Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Only offer to adopt or overwrite if the user can do that. Allow the site administrator to adopt or overwrite in all circumstances Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #12920 +/- ##
==========================================
- Coverage 43.06% 42.82% -0.25%
==========================================
Files 658 661 +3
Lines 72477 72974 +497
==========================================
+ Hits 31214 31252 +38
- Misses 36200 36653 +453
- Partials 5063 5069 +6
Continue to review full report at Codecov.
|
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
@zeripath one thing: the addoption task has to ensure to not set a not existing default branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit about unneeded commented out code but otherwise lg-tm
Signed-off-by: Andrew Thornton <[email protected]>
This PR is a rewrite of #12409 to remove the adopt/overwrite option as per @6543 and @lunny.
Prior to this PR Gitea would delete any repository files if they are
present during creation or migration. This can in certain circumstances
lead to data-loss and is slightly unpleasant.
This PR provides a mechanism for Gitea to adopt repositories or delete unadopted repositories by creating a new page
/admin/repos/unadopted
which allow the administrator to search for unadopted repositories.If normal users are allowed to adopt and/or delete unadopted repositories these will appear on
/user/settings/repos
There is an API for the (administrator user only)
/api/v1/admin/unadopted
to list unadopted and POSTing to/api/v1/admin/unadopted/:username/:reponame
will adopt whilst DELETE will delete them.Closes #12409
Signed-off-by: Andrew Thornton [email protected]