Render a warning for pull mirroring when the project is read-only
What does this MR do and why?
Contributes to #372200 (closed)
Problem
When the project is read-only, we silently skip the pull mirroring attempt. It's done to support a project migration: !19182 (merged).
Solution
Render a warning describing that the project is read-only instead of a successful update message.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Create a Pull Repository Mirror.
- Observe that the mirror is updated properly.
- Open the Rails Console and set the project/mirror to read only state.
p=Project.find_by_full_path('TESTGROUP/TESTPROJECT')
p.update!(repository_read_only: true)
- Make changes in the upstream repository.
- Force an update in your GitLab mirror by going to
Settings > Repository > Mirroring repositories
and selecting theUpdate Now
button. - You should see a message notifying about the read-only status.
Edited by Vasilii Iakliushin