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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly ignore non-label events in label event handler #66

Conversation

pascal-hofmann
Copy link
Contributor

This fixes the following error that occurs in our jenkins log on each GitHub event that is not of action labeled:

SEVERE  o.j.p.g.e.GHEventsSubscriber$4#applyNullSafe: Subscriber com.adobe.jenkins.github_pr_comment_build.IssueLabelGHEventSubscriber failed to process SCMEvent{type=UPDATED,鈥 hook, skipping...

net.sf.json.JSONException: null object
at net.sf.json.JSONObject.verifyIsNull(JSONObject.java:2688)
at net.sf.json.JSONObject.getString(JSONObject.java:2035)
at com.adobe.jenkins.github_pr_comment_build.IssueLabelGHEventSubscriber.onEvent(IssueLabelGHEventSubscriber.java:96)
at org.jenkinsci.plugins.github.extension.GHEventsSubscriber.onEvent(GHEventsSubscriber.java:142)
at org.jenkinsci.plugins.github.extension.GHEventsSubscriber$4.applyNullSafe(GHEventsSubscriber.java:241)
at org.jenkinsci.plugins.github.extension.GHEventsSubscriber$4.applyNullSafe(GHEventsSubscriber.java:237)
at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18)

Testing done

Tested on our internal jenkins test instance.

Tasks

No tasks being tracked yet.

@sparrowt
Copy link

sparrowt commented Mar 1, 2024

Yes! Thank you. This is exactly the kind of change I was about to make having hit the same issue & realised it was exploding on other random events that don't have label in the top-level payload.

Copy link

@sparrowt sparrowt left a comment

Choose a reason for hiding this comment

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

Apparently I have the ability to approve this - LGTM! 馃憤 No idea about how a new release of this plugin gets made though.

@bluesliverx bluesliverx merged commit d5ca828 into jenkinsci:master Mar 1, 2024
14 checks passed
@bluesliverx
Copy link
Contributor

Thanks for the contribution! I don't remember how new releases get done either (hopefully it's just built into GitHub actions but this is an older repo for me), but I'll work on that.

@bluesliverx
Copy link
Contributor

This is released in 103.vc8919acf2a6b

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.

None yet

3 participants