Skip to content

feat(api): support list and delete for group service accounts #2963

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

ka28kumar
Copy link
Contributor

add DeleteMixin, ListMixin to GroupServiceAccountManager and ObjectDeleteMixin to GroupServiceAccount

Changes

Documentation and testing

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

@ka28kumar
Copy link
Contributor Author

ka28kumar commented Sep 1, 2024

@nejch ,
Can you check if this is functionally complete?
If it is, I'll start to add tests.

@nejch nejch marked this pull request as ready for review September 1, 2024 13:25
Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.53%. Comparing base (bcef988) to head (b57fbf2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2963   +/-   ##
=======================================
  Coverage   96.53%   96.53%           
=======================================
  Files          94       94           
  Lines        5997     5997           
=======================================
  Hits         5789     5789           
  Misses        208      208           
Flag Coverage Δ
api_func_v4 82.49% <100.00%> (-0.12%) ⬇️
cli_func_v4 83.47% <100.00%> (ø)
unit 88.52% <100.00%> (ø)

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

Files with missing lines Coverage Δ
gitlab/v4/objects/service_accounts.py 100.00% <100.00%> (ø)

@nejch
Copy link
Member

nejch commented Sep 3, 2024

Thanks for the contribution @ka28kumar I just got back to this.

Yes, this looks good! If you could add a few basic tests/asserts to the existing functional tests, this would be really appreciated! Thanks!

@ka28kumar
Copy link
Contributor Author

Will add. Thanks!

@nejch
Copy link
Member

nejch commented Oct 23, 2024

Did you still want to add a few tests here @ka28kumar? Could just be a simple extension of:

service_account = group.service_accounts.create(

E.g.:

def test_group_service_accounts(group):
    service_account = group.service_accounts.create(
        {"name": "gitlab-service-account", "username": "gitlab-service-account"}
    )
    assert service_account.name == "gitlab-service-account"
    assert service_account.username == "gitlab-service-account"

    service_accounts = group.service_accounts.list()
    assert service_accounts[0] == service_account

    service_account.delete()

Or something like that. Let me know otherwise we can also take over here!

@ka28kumar
Copy link
Contributor Author

I'm sorry I got occupied with some tasks. Feel free to take over.

@nejch nejch changed the title feat(api): add DeleteMixin, ListMixin to GroupServiceAccountManager and ObjectDeleteMixin to GroupServiceAccount feat(api): add support list and delete for group service accounts Nov 5, 2024
@nejch nejch changed the title feat(api): add support list and delete for group service accounts feat(api): support list and delete for group service accounts Nov 5, 2024
@nejch
Copy link
Member

nejch commented Nov 5, 2024

Thanks @ka28kumar let's get this merged and I've opened a follow-up for the tests.

@nejch nejch enabled auto-merge (squash) November 5, 2024 16:33
@nejch nejch force-pushed the 2946-extend-support-for-group-level-service-accounts branch from b57fbf2 to 6605d7a Compare November 5, 2024 16:33
@nejch nejch merged commit 499243b into python-gitlab:main Nov 5, 2024
16 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.

2 participants