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
[JENKINS-69153] Do not call deprecated h.singletonList #71
Conversation
Jenkins 2.358 deprecated the `Functions.singletonList` method because it is not normally needed in JEXL. The `h.singletonList(it)` call in this groovy code reports a null pointer exception in Jenkins 2.358 and later. When the `h.singletonList(it)` call is replaced with `it`, the null pointer exception is not reported and the page loads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a hard time seeing why jenkinsci/jenkins#6740 would have introduced an NPE. Adding @Deprecated
should not change any runtime behavior. The patch to Computer/sidepanel.jelly
of course does, but why would that affect some other sidepanel view? Did you actually verify that the core commit causes the reported error, or could it be caused by some unrelated change?
...esources/org/jenkinsci/plugins/emailext_template/ExtEmailTemplateManagement/sidepanel.groovy
Outdated
Show resolved
Hide resolved
from https://issues.jenkins.io/browse/JENKINS-69707 would seem to implicate jenkinsci/jenkins#6700, also in 2.358: |
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
If this is the only known case where someone was trying to pass |
Seems reasonable. I would just check why this plugin was trying to pass a list consisting of one null element to begin with—it looks like a mistake. |
That is a very good point. The side panel displayed by the plugin seems to be attempting to show the list of executors in an expanding and shrinking box as is done on the main dashboard and on the system info page http://localhost:8080/jenkins/manage/systemInfo page and the http://localhost:8080/jenkins/manage/cli/ page. However, on 2.361.1, even with this change, it still does not show the list of executors. Would it be simpler to switch sidepanel.groovy to be a sidepanel.jelly and have it use a similar implementation to those other pages? |
But it did before 2.358? Was |
Yeah but it does not actually show any executors. Anyway this widget does not make any sense here, looking at the screenshot. So the line should simply be deleted, as I suggested in #71 (comment). |
@slide would you be OK if I released a version of this plugin from the master branch so that this fix is available to users? Comments in the bug report confirm that the fix is an improvement over the current state. |
Go for it, you can do that whenever needed |
JENKINS-69153 Do not call deprecated h.singletonList
Jenkins 2.358 deprecated the
Functions.singletonList
method because it is not normally needed in JEXL. Theh.singletonList(it)
call in this groovy code reports a null pointer exception in Jenkins 2.358 and later.When the
h.singletonList(it)
call is replaced withit
, the null pointer exception is not reported and the page loads.Needs more testing from people that are experienced with email extension template plugin.
Would benefit from a round trip test that checks the page loads.