Skip to content
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

#1259 Add GroupPushRules and GroupPushRulesManager classes #1266

Merged
merged 1 commit into from
Jul 5, 2022
Merged

#1259 Add GroupPushRules and GroupPushRulesManager classes #1266

merged 1 commit into from
Jul 5, 2022

Conversation

gokeefe
Copy link
Contributor

@gokeefe gokeefe commented Jan 13, 2021

Add classes to read and update push rules on groups

Closes #1259.

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

Thanks for this @gokeefe! Just added a small comment. Do you have a link for the upstream issue with the missing response?

We can't really run integration tests at the moment on EE features but if you want to give it a shot you can add some unit tests for this in gitlab/tests/objects. You can look at some existing examples at https://github.com/python-gitlab/python-gitlab/tree/master/gitlab/tests/objects, and use the example responses at https://docs.gitlab.com/ce/api/groups.html#push-rules for mocks.

I rebased your branch on top of master as we switched CI systems recently and this should give you better build results.

gitlab/v4/objects/__init__.py Outdated Show resolved Hide resolved
@gokeefe
Copy link
Contributor Author

gokeefe commented Feb 4, 2021

Thanks for this @gokeefe! Just added a small comment. Do you have a link for the upstream issue with the missing response?

Yes, right here: https://gitlab.com/gitlab-org/gitlab/-/issues/297559

I rebased your branch on top of master as we switched CI systems recently and this should give you better build results.

Awesome, the travis-ci build failed and I had no idea why because the same tests were working fine locally. I'll have a look at the rest next week. Thanks!

@nejch
Copy link
Member

nejch commented Feb 20, 2021

Thanks for this @gokeefe! Just added a small comment. Do you have a link for the upstream issue with the missing response?

Yes, right here: https://gitlab.com/gitlab-org/gitlab/-/issues/297559

I rebased your branch on top of master as we switched CI systems recently and this should give you better build results.

Awesome, the travis-ci build failed and I had no idea why because the same tests were working fine locally. I'll have a look at the rest next week. Thanks!

Just FYI - we've split the objects package into modules now so this will have to be rebased and moved into gitlab/v4/objects/push_rules.py and the manager also imported in groups.py. Take a look at #1304 for an example on how to add it.

I'll assign this to you for now but if you need help just let me know :)

@nejch
Copy link
Member

nejch commented May 7, 2022

Hi @gokeefe are you still interested in finishing this?

I think we're ok without pytest and I can add them later if you're not comfortable doing that. This just needs a rebase to resolve some conflicts and maybe squash into a single commit. Let me know!

@JohnVillalovos JohnVillalovos requested a review from nejch July 4, 2022 15:59
@JohnVillalovos JohnVillalovos marked this pull request as ready for review July 4, 2022 15:59
@JohnVillalovos
Copy link
Member

JohnVillalovos commented Jul 4, 2022

@nejch I rebased this PR, then squashed it down to one commit and cleaned things up a little bit. If you have time to review I can work on it some more if needed.

Add the GroupPushRules and GroupPushRulesManager classes.

Closes: #1259
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

Thanks a lot @gokeefe for the PR and @JohnVillalovos for bringing this up to date! :)


group.pushrules.create({'deny_delete_tag': True})

Get group push rules (returns None is there are no push rules)::
Copy link
Member

Choose a reason for hiding this comment

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

(Edit: ah I realize this is also wrong in the project docs, nvm)

Suggested change
Get group push rules (returns None is there are no push rules)::
Get group push rules (returns ``None`` if there are no push rules)::

@nejch nejch merged commit 768890a into python-gitlab:main Jul 5, 2022
@gokeefe gokeefe deleted the gokeefe/group_push_rules branch September 17, 2022 04:01
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.

Manage push rules on a group
3 participants