Skip to content

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

Closed

Description

@JohnVillalovos

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

Activity

  1. JohnVillalovos commented on Jul 12, 2024

    @JohnVillalovos
    MemberAuthor

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

  2. JohnVillalovos commented on Jul 12, 2024

    @JohnVillalovos
    MemberAuthor

    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")
    
  3. added 2 commits that reference this issue on Aug 9, 2024
    f099108
    1f2da4a
  4. added a commit that references this issue on Aug 9, 2024
    9353f54
  5. locked as resolved and limited conversation to collaborators on Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions