fix: don't attach UserInterruption with null user id on [skip ci] abort#39
Merged
Merged
Conversation
[skip ci] builds are SCM-triggered, so env.BUILD_USER_ID is null. UserInterruption stores the null user id and its hashCode() throws NPE inside FlowInterruptedException.handle() during WorkflowRun.finish(), aborting completion before RunListener.fireCompleted() runs. That skipped the GitHub Branch Source final commit status, leaving [skip ci] commits stuck on a pending status. Throw without a cause and with actualInterruption false instead, and guard against a missing previous build.
- repo.jenkins-ci.org no longer serves plain http (308 redirect) - jenkins-core and servlet-api must be on the compile classpath since main sources import hudson.model.Result and friends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
[skip ci]builds are SCM-triggered, soenv.BUILD_USER_IDis null.UserInterruptionstores that null user id and itshashCode()NPEs insideFlowInterruptedException.handle()duringWorkflowRun.finish(), aborting completion beforeRunListener.fireCompleted()runs. As a result the GitHub Branch Source plugin never posts the final commit status and[skip ci]commits stay stuck on "pending".FlowInterruptedExceptionwithout a cause and withactualInterruption: false, and guard against a missing previous build.providedscope for jenkins-core/servlet-api) somake testcompiles and runs again.Testing
make test: 12 tests run, 11 pass. The one failure (basePipelineSpec) is pre-existing and unrelated — it fails identically with the unmodified plugin code.