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

Prevent null pointer exception in docker workflow plugin #44

Merged
merged 9 commits into from
Oct 21, 2023

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Oct 7, 2023

Prevent null pointer exception in docker workflow plugin

A method that expects a non-null job argument was being passed a null job argument. Now returns an empty list when a null job is passed.

This will need to be released so that this plugin can be included in the Jenkins plugin bill of materials. More details are available at:

This pull request should be merged after the merge of:

Testing done

Confirmed that DockerHubTriggerTest fails before this change and passes after the change. Command is:

mvn clean -Dtest=DockerHubTriggerTest verify

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • 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

@MarkEWaite MarkEWaite changed the title Show DockerHubTriggerTest test failure Prevent null pointer exception in docker workflow plugin Oct 21, 2023
DockerImageExtractor.getDockerImagesUsedByJobFromAll expects a non-null
job argument but the test environment on the master branch and on the
test branch were both passing a null job.  When the docker-workflow
plugin is included in the test dependencies, then an implementation of
the abstract method is used that expects the NonNull to be honored.

It seems like this should have been detected by spotbugs, since the
argument is annotated NonNull in the called method and is being passed
a null value from this method.

jenkinsci/bom#2439 is the issue that detected
this implementation problem.
@MarkEWaite
Copy link
Contributor Author

MarkEWaite commented Oct 21, 2023

@rsandell this is ready for your review. It would be nice if the following pull requests were merged before this one.

When this pull request is merged, I can include this plugin in the Jenkins plugin bill of materials.

@rsandell rsandell added the bug label Oct 21, 2023
@rsandell rsandell merged commit 7fc53ac into jenkinsci:master Oct 21, 2023
14 checks passed
@rsandell
Copy link
Member

Please remind me on Monday to make a release unless someone makes a release before that 😊

@MarkEWaite MarkEWaite deleted the show-test-failure branch October 21, 2023 13:29
@MarkEWaite
Copy link
Contributor Author

Please remind me on Monday to make a release unless someone makes a release before that 😊

Will do. Thanks very much for merging the change. I'll use an incremental build from the master branch of this plugin to run a final test of the inclusion in the plugin bill of materials. I won't start that evaluation test until the currently running plugin BOM tests are complete.

@MarkEWaite
Copy link
Contributor Author

MarkEWaite commented Oct 23, 2023

I'll use an incremental build from the master branch of this plugin to run a final test of the inclusion in the plugin bill of materials

@rsandell, the plugin bill of materials draft evaluation of the master branch incremental build was successful. Not a rush, but the next release of the dockerhub-notification will allow it to be added to the plugin bill of materials so that it will be tested in combination with other plugins.

Let me know whenever it is released and I'll complete the changes on the plugin BOM.

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