feat: add protectedbranches to group class (#3164)#3170
feat: add protectedbranches to group class (#3164)#3170JohnVillalovos merged 1 commit intopython-gitlab:mainfrom
Conversation
d13b0ff to
5f03160
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3170 +/- ##
=======================================
Coverage 97.32% 97.32%
=======================================
Files 98 98
Lines 6046 6056 +10
=======================================
+ Hits 5884 5894 +10
Misses 162 162
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
FYI: This will need to be rebased and the conflicts resolved. |
|
Rebased @JohnVillalovos ready for a squash & merge ✅ |
|
c5bfc06 to
b46f370
Compare
|
@JohnVillalovos ...hmm GitHub is ... different 😁 Anyways.. should be fixed..
|
b46f370 to
66430ea
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for managing protected branches in group objects by introducing the new attribute "protectedbranches" and the corresponding manager classes and tests.
- Implements the new "protectedbranches" attribute in the Group class.
- Introduces the GroupProtectedBranch and GroupProtectedBranchManager classes to handle CRUD operations.
- Adds functional tests and documentation updates for the new functionality.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/functional/api/test_groups.py | Added functional tests for group protected branches. |
| gitlab/v4/objects/groups.py | Added the "protectedbranches" attribute to the Group class. |
| gitlab/v4/objects/branches.py | Introduced GroupProtectedBranch and Manager classes. |
| docs/gl_objects/protected_branches.rst | Updated documentation to include group protected branches. |



Changes
protectedbranchesattr to the Group class objects. This allows one to retrieve (.list()) or set (.create()) protected branches to trickle downstream to sub-groups/projects.Documentation and testing
Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:
Closes #3164