Skip to content

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
Screenshot_2024-12-06_at_14.32.36 Screenshot_2024-12-06_at_14.32.40

How to set up and validate locally

  1. Create a Pull Repository Mirror.
  2. Observe that the mirror is updated properly.
  3. 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)
  1. Make changes in the upstream repository.
  2. Force an update in your GitLab mirror by going to Settings > Repository > Mirroring repositories and selecting the Update Now button.
  3. You should see a message notifying about the read-only status.
Edited by Vasilii Iakliushin

Merge request reports

Loading