-
Notifications
You must be signed in to change notification settings - Fork 674
feat(project): add support for pull mirror configuration #3056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3056 +/- ##
==========================================
+ Coverage 96.79% 96.80% +0.01%
==========================================
Files 97 97
Lines 6325 6346 +21
==========================================
+ Hits 6122 6143 +21
Misses 203 203
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Thanks a lot @nicoklaus, looks great in general! I'm just thinking whether we should consolidate the GET, PUT and POST methods for Just have to think about a clean way to do this, maybe |
|
Hi @nejch, I had a little time and reworked the implementation based on your input. 🔨 would be pleased about another review 😄 |
nejch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nejch, I had a little time and reworked the implementation based on your input. 🔨 would be pleased about another review 😄
Thanks a lot @nicoklaus, this is exactly what I had in mind. Looks great! Just a comment on the impact of removing the old code, let me know if you need some help 🙇
Add new pull mirroring api endpoint released in GitLab 17.6.
https://docs.gitlab.com/17.6/ee/api/project_pull_mirroring.html#configure-pull-mirroring-for-a-project
Changes
Adds mirror_pull_configuration to projects.
Related to #3039
Documentation and testing
Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:
Additional Notes
Since the implementation of this API is slightly different from the standard that GitLab uses, there are small drawbacks to disabling pull mirrors.
There is no separate DELETE method, we use the PUT method in both cases to enable and disable pull mirroring. Since a URL is required for activation, this is now also required for deactivation, even though it is not actually needed for this.
I also noticed that the settings for mirror_regex are not deleted when deactivated, unlike the other settings. Therefore there is now an extra if condition for this. I'm not sure if this should be filed as a question / bug to GitLab ?