Skip to content

Conversation

@nejch
Copy link
Member

@nejch nejch commented Dec 20, 2024

Changes

Gitlab changed from the REST container registry protection endpoint from
/projects/{project_id}/registry/protection/rules
to
/projects/{project_id}/registry/repository/protection/rules

Not great, but can't blame them as it's still behind a feature flag. This adds the new endpoint pretty much with a copy paste. As of GitLab 17.7 the old endpoint no longer works.

Looked at a few ways to deprecate all the methods but not sure it's worth it, but might do it in a follow-up.
https://www.geeksforgeeks.org/attaching-a-decorator-to-all-functions-within-a-class-in-python/ might work.

Documentation and testing

Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:

@nejch nejch force-pushed the feat/new-registry-rule-endpoint branch from 1a1a31a to 526f0a8 Compare December 20, 2024 14:16
@nejch nejch force-pushed the feat/new-registry-rule-endpoint branch from 526f0a8 to b35389c Compare December 20, 2024 14:27
@codecov
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.68%. Comparing base (9439132) to head (b35389c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3067   +/-   ##
=======================================
  Coverage   96.67%   96.68%           
=======================================
  Files          95       96    +1     
  Lines        6197     6213   +16     
=======================================
+ Hits         5991     6007   +16     
  Misses        206      206           
Flag Coverage Δ
api_func_v4 82.68% <100.00%> (-0.06%) ⬇️
cli_func_v4 82.69% <100.00%> (+0.04%) ⬆️
unit 89.02% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
gitlab/v4/objects/__init__.py 100.00% <100.00%> (ø)
gitlab/v4/objects/projects.py 98.84% <100.00%> (+<0.01%) ⬆️
...v4/objects/registry_repository_protection_rules.py 100.00% <100.00%> (ø)

@max-wittig max-wittig merged commit 40af1c8 into main Dec 20, 2024
18 checks passed
@max-wittig max-wittig deleted the feat/new-registry-rule-endpoint branch December 20, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants