-
Notifications
You must be signed in to change notification settings - Fork 529
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-50328] [JENKINS-51066] Fix bug where pipeline editor ignores custom Jenkinsfile script path. #2049
Conversation
The test failure appears to be due to a jenkins restart mid-test and unrelated to the change. |
Thanks for the PR! As for the question of adding tests, it might be good to add something to the acceptance tests to run through this. I don't yet know what would be involved in that.
I just relaunched the build. |
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.
This looks like a really good PR. I've tried a silly number of folders for a silly named Jenkinsfile to be in, along with some other setups, and this works really nicely.
I'm looking to see how easy it would be to add a test (or just reconfigure an existing test) in the acceptance-tests to run through a round trip workflow with a non-default Jenkinsfile location. But that aside, this looks like a really great fix for a bug I bet has been annoying a lot of users.
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.
LGTM a test would be good for sure but it's an easy change
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.
Even though an acceptance test would be good for this, I don't think that's worth holding up merge. This is a great fix. Many thanks for the PR!
MultiBranchPipelineImpl mbpi = new MultiBranchPipelineImpl(organization, (MultiBranchProject) item); | ||
if (item instanceof WorkflowMultiBranchProject) { | ||
WorkflowMultiBranchProject wfmbp = (WorkflowMultiBranchProject)item; | ||
WorkflowBranchProjectFactory wbpf = (WorkflowBranchProjectFactory)wfmbp.getProjectFactory(); |
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.
This seems to break "Multibranch with defaults" plugin as its PipelineBranchDefaultsProjectFactory cannot be cast to WorkflowBranchProjectFactory which leads to a ClassCastException.
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.
@kshultzCB Can you look at this plz? :)
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 confirm ... it break Multibranch With Defaults
java.lang.ClassCastException: org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineBranchDefaultsProjectFactory cannot be cast to org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory at io.jenkins.blueocean.rest.impl.pipeline.MultiBranchPipelineImpl$PipelineFactoryImpl.getPipeline(MultiBranchPipelineImpl.java:277) at io.jenkins.blueocean.rest.impl.pipeline.MultiBranchPipelineImpl$PipelineFactoryImpl.getPipeline(MultiBranchPipelineImpl.java:268) at io.jenkins.blueocean.rest.factory.BluePipelineFactory.getPipelineInstance(BluePipelineFactory.java:117) at io.jenkins.blueocean.service.embedded.rest.PipelineContainerImpl.getPipelines(PipelineContainerImpl.java:66) at io.jenkins.blueocean.service.embedded.rest.PipelineSearch.search(PipelineSearch.java:106) at io.jenkins.blueocean.rest.ApiHead.search(ApiHead.java:61) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
Will take a look. Thanks for the bug report. |
…ults This change will stop the failure but also rolls back #2049 when using pipeline-multibranch-defaults
Description
This change fixes a bug where the pipeline editor ignores and therefore fails to load or save custom Jenkinsfile script paths. This is a fix to existing functionality so no new tests have been added.
See JENKINS-50328.
See JENKINS-51066.
Submitter checklist
Reviewer checklist