Adopt repositories#12920
Merged
Merged
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 <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath
commented
Sep 21, 2020
zeripath
commented
Sep 21, 2020
Signed-off-by: Andrew Thornton <art27@cantab.net>
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 <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Member
|
@zeripath one thing: the addoption task has to ensure to not set a not existing default branch |
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
6543
approved these changes
Sep 24, 2020
lafriks
reviewed
Sep 24, 2020
Member
lafriks
left a comment
There was a problem hiding this comment.
Small nit about unneeded commented out code but otherwise lg-tm
Signed-off-by: Andrew Thornton <art27@cantab.net>
lafriks
approved these changes
Sep 24, 2020
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/unadoptedwhich 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/reposThere is an API for the (administrator user only)
/api/v1/admin/unadoptedto list unadopted and POSTing to/api/v1/admin/unadopted/:username/:reponamewill adopt whilst DELETE will delete them.Closes #12409
Signed-off-by: Andrew Thornton art27@cantab.net