Pull mirror GET API
What does this MR do and why?
Creates an GET API endpoint at gitlab.com/api/v4/projects/:id/mirror/pull which provides details related to pull mirror specifications on a project. Pull Mirrors are a premium feature so this is intended to also be a premium feature.
A list of settings exposed with this GET request are as follows:
- id
- remote_mirror_attributes
- mirror
- import_url
- username_only_import_url
- mirror_user_id
- mirror_trigger_builds
- only_mirror_protected_branches
- mirror_overwrites_diverged_branches
- import_data_attributes
The above bolded items are directly related to the pull mirror. The non-bolded elements are extra details pulled in from the serializer used. This uses ProjectMirrorSerializer which gathers entity information from EE::ProjectMirrorEntity and ProjectMirrorEntity.
This MR intends to resolve Issue: #354506 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Run gitlab in premium mode
- Request the API with GET /api/v4/projects/:id/mirror/pull
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/mirror/pull"
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.