Provide default value for requestForTestingPhrase #452
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I configure my Jenkinses via a setup.groovy script and never visit the configuration page.
Builds are never run for people who are not on the white list and the admin is never asked to approve builds for them.
It turns out that the reason is that Jenkins is trying to use the
requestForTesting
phrase but that it has never been set, leading to aNullPointerException
:I'm currently working around the issue like so:
but it seems like it would be safer to provide it with a default value like you do for the other phrases.
Alternatively,
org.jenkinsci.plugins.ghprb.GhprbRepository.addComment
{sh,c}ould check that it's argument is not null before using it. But, that wouldn't help the 'infrastructure as code' crowd as much as my proposed change.It would be really nice if there were a programmatic way to configure the plugin. The
configure
method is tied to a request, so it's not easily usable and using reflection to access the plugin's private bits seems icky.