Skip to content

traceback if webhook set to "send me everything". #250

@kad

Description

@kad

If webhook is set to "send me everything" instead of just push events, then github-api would crash with something similar to this:

WARNING: Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=xxxx,repository=zzzzzz]
java.lang.IllegalArgumentException: No enum constant org.kohsuke.github.GHEvent.*
        at java.lang.Enum.valueOf(Enum.java:238)
        at org.kohsuke.github.GHHook.getEvents(GHHook.java:30)
        at org.jenkinsci.plugins.github.webhook.WebhookManager$7.applyNullSafe(WebhookManager.java:258)
        at org.jenkinsci.plugins.github.webhook.WebhookManager$7.applyNullSafe(WebhookManager.java:255)
        at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18)


    "events": [
      "*"
    ],

in theory, org.kohsuke.github.GHHook.getEvents should be able to see if "e" == "*", and skip it or add all known enums to return set... not sure about logic/usage of that function in different places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions