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

Add support for testing/triggering Project and Group hooks #2924

Closed
JohnVillalovos opened this issue Jul 12, 2024 Discussed in #2923 · 2 comments · Fixed by #2950
Closed

Add support for testing/triggering Project and Group hooks #2924

JohnVillalovos opened this issue Jul 12, 2024 Discussed in #2923 · 2 comments · Fixed by #2950

Comments

@JohnVillalovos
Copy link
Member

JohnVillalovos commented Jul 12, 2024

At the moment there is no support for https://docs.gitlab.com/ee/api/projects.html#trigger-a-test-project-hook

So support would need to be added to gitlab/v4/objects/hooks.py

Probably need to add a method test() to ProjectHookManager ProjectHook and GroupHookManager GroupHook

PRs are welcome.

Discussed in #2923

Originally posted by vasokot July 11, 2024

Description of the problem, including code/CLI snippet

Need to trigget test of project hook https://docs.gitlab.com/ee/api/projects.html#trigger-a-test-project-hook

How I can do it with python-gitlab?

Specifications

  • python-gitlab version: 4.7
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 16.11.6-ee
@JohnVillalovos
Copy link
Member Author

@vasokot Created an issue on missing support. If you would like to do a PR for this it would be great.

@JohnVillalovos
Copy link
Member Author

JohnVillalovos commented Jul 12, 2024

Correction. Probably need to add the test() method to ProjectHook and GroupHook.

I think the API would probably be like:

hook = project.hooks.get(hook_id)
result = hook.test(trigger="the_trigger_value")

JacobHenner added a commit to JacobHenner/python-gitlab that referenced this issue Aug 9, 2024
Add the ability to trigger tests of project and group hooks.

Fixes python-gitlab#2924
JacobHenner added a commit to JacobHenner/python-gitlab that referenced this issue Aug 9, 2024
Add the ability to trigger tests of project and group hooks.

Fixes python-gitlab#2924
JohnVillalovos pushed a commit that referenced this issue Aug 9, 2024
Add the ability to trigger tests of project and group hooks.

Fixes #2924
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 a pull request may close this issue.

1 participant