Skip to content

feat: add protectedbranches to group class (#3164) #3170

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

Merged

Conversation

xakepnz
Copy link
Contributor

@xakepnz xakepnz commented Apr 11, 2025

Changes

Documentation and testing

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

Closes #3164

@xakepnz xakepnz force-pushed the feat/group-protected-branches branch 4 times, most recently from d13b0ff to 5f03160 Compare April 11, 2025 11:51
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.32%. Comparing base (98c1307) to head (66430ea).
Report is 1 commits behind head on main.

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           
Flag Coverage Δ
api_func_v4 83.68% <100.00%> (+0.09%) ⬆️
cli_func_v4 84.69% <100.00%> (+0.02%) ⬆️
unit 90.19% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
gitlab/v4/objects/branches.py 100.00% <100.00%> (ø)
gitlab/v4/objects/groups.py 96.00% <100.00%> (+0.04%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JohnVillalovos
Copy link
Member

JohnVillalovos commented Apr 17, 2025

FYI: This will need to be rebased and the conflicts resolved.

@xakepnz
Copy link
Contributor Author

xakepnz commented Apr 22, 2025

Rebased @JohnVillalovos ready for a squash & merge ✅

@JohnVillalovos
Copy link
Member

Rebased @JohnVillalovos ready for a squash & merge ✅

image

@xakepnz xakepnz force-pushed the feat/group-protected-branches branch from c5bfc06 to b46f370 Compare April 23, 2025 11:02
@xakepnz
Copy link
Contributor Author

xakepnz commented Apr 23, 2025

@JohnVillalovos ...hmm GitHub is ... different 😁 Anyways.. should be fixed..

Screenshot 2025-04-23 at 10 51 05 PM Screenshot 2025-04-23 at 10 49 55 PM

@JohnVillalovos JohnVillalovos force-pushed the feat/group-protected-branches branch from b46f370 to 66430ea Compare June 7, 2025 14:27
@JohnVillalovos JohnVillalovos requested a review from Copilot June 7, 2025 14:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @xakepnz

@JohnVillalovos JohnVillalovos enabled auto-merge (rebase) June 7, 2025 14:32
@JohnVillalovos JohnVillalovos merged commit bfd31a8 into python-gitlab:main Jun 7, 2025
17 checks passed
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.

Protected Branches Group Level
3 participants