Skip to content

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.

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- ~~[ ] Link to relevant issues in GitHub or Jira~~
- ~~[ ] Link to relevant pull requests, esp. upstream and downstream changes~~
- ~~[ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue~~

@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
@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.

3 participants