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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JENKINS-61474 Improve null safety of the tool step #302

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

duemir
Copy link
Member

@duemir duemir commented Mar 5, 2024

Tools page doesn't prevent submission of empty tool names. Some tools (e.g. Allure Commandline) use Util.fixEmptyAndTrim on the name, so there is a possibility of NPE when comparing the tool names. By flipping the comparison we avoid NPE since tool step requires name argument.

This most likely fixes https://issues.jenkins.io/browse/JENKINS-61474

Testing done

Submitter checklist

Tools page doesn't prevent submission of empty tool names. Some tools (e.g. Allure Commandline) use `Util.fixEmptyAndTrim` on the name, so there is a possibility of NPE when comparing the tool names. By flipping the comparison we avoid NPE since `tool` step requires `name` argument.
@duemir duemir requested a review from a team as a code owner March 5, 2024 05:06
@jtnord jtnord added the bug label Mar 5, 2024
Copy link
Member

@jtnord jtnord left a comment

Choose a reason for hiding this comment

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

Some tools (e.g. Allure Commandline) use Util.fixEmptyAndTrim on the name

sounds like a UX bug should be filed for these plugins? How does that render / work in dropdowns etc...

@jtnord jtnord merged commit 257ae6b into jenkinsci:master Mar 5, 2024
14 checks passed
@duemir duemir deleted the JENKINS-61474 branch March 5, 2024 23:38
@duemir
Copy link
Member Author

duemir commented Mar 5, 2024

@jtnord it is either shown as blank item if plugin stores it as empty string or as null:

2024-03-06-tool-snippet-generator

@jtnord
Copy link
Member

jtnord commented Mar 6, 2024

@jtnord it is either shown as blank item if plugin stores it as empty string or as null:

2024-03-06-tool-snippet-generator

please file bugs for the plugins that support null or the blank string then that you are aware of (or a general one for Jenkins core to prevent this - but this would break those tools installation definitions if/when merged without plugin changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants