REST API: add an endpoint to configure pull mirrors
What does this MR do and why?
Contributes to #494294 (closed)
Problem
Currently, pull mirroring configuration is done through Projects API. This is confusing and leads to various problems.
Solution
Create a new endpoint to configure Pull Mirroring for a project.
How to set up and validate locally
-
Enable a pull mirror configuration for the project with
curl -X PUT --data 'enabled=true&url=http://example.com' --header "PRIVATE-TOKEN: <PRIVATE_TOKEN>" http://gdk.test:3000/api/v4/projects/<project_id>/mirror/pull -
You should see a response with
enabled: true. -
Visit project with a new mirror
-
Open
Settings -> Repository -> Mirroring repositories -
Disable a pull mirror configuraton with
curl -X PUT --data 'enabled=false' --header "PRIVATE-TOKEN: <PRIVATE_TOKEN>" http://gdk.test:3000/api/v4/projects/<project_id>/mirror/pull -
The mirror configuration should disappear from UI

