Make DesignManagement::Repository a container for GitRepository
What does this MR do and why?
This MR includes the code that was reverted in !117828 (merged) because of a regression (original MR: !116245 (merged)) and fixes the bug that caused the regression.
The original re-factor introduced a regression where designs could no longer be updated, uploaded or archived.
The last commit in this MR fixes that.
The re-factor makes DesignManagement::Repository
the container for DesignManagement::GitRepository
. But, RepoType#repository_for
, RepoType#project_resolver
and GitAccessDesign#user_can_push?
expect the container to be of type project
.
The fix is to select project
as the container in those spots.
Another way to make it simpler would be to make the repository_resolver
signature more like snippets
. I am working on that in another MR, but Design Repo migration is a higher priority so this further work is stalled for the moment.
Please note Only the last commit needs a review, since the first commit was already reviewed in the original MR.
Related issue: #407752 (closed)
How to set up and validate locally
-
Design uploads
a. Create a new issue or use an already existing one
b. Upload a design - it should upload successfully
c. Archive the design - it should archive successfully
-
Design replication
a. Create an issue with a design on a primary
b. 'Design repositories' should show '100%' on secondary at '/admin/geo/sites'
-
Move issue from one project to another - designs should move with the issue
a. One easy way to do it is to use the
move
quick action in a comment on the issue to be moved:/move /path/to/new-project
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.