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

Demonstration that implementing getParentExecutable is necessary #177

Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented Nov 5, 2021

Proves that #170 is necessary to retain compatibility with some rare use cases after jenkinsci/jenkins#5880: for example, Pipeline code coverage without jenkinsci/code-coverage-api-plugin#245 or jenkinsci/cobertura-plugin#130.

main.setDefinition(new CpsFlowDefinition("node('" + s.getNodeName() + "') {writeBack()}", true));
// Normal case: writing to our own build directory
WriteBackStep.controllerFile = new File(main.getBuildDir(), "1/stuff.txt");
r.buildAndAssertSuccess(main);
Copy link
Member Author

Choose a reason for hiding this comment

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

Fails without getParentExecutable override.

FreeStyleProject other = r.createFreeStyleProject("other");
r.buildAndAssertSuccess(other);
WriteBackStep.controllerFile = new File(other.getBuildByNumber(1).getRootDir(), "hack");
r.buildAndAssertSuccess(main);
Copy link
Member Author

Choose a reason for hiding this comment

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

Fails against older Jenkins versions without RunningBuildFilePathFilter.

@jglick
Copy link
Member Author

jglick commented Nov 8, 2021

This is more tests (or dependencies) than enhancement.

@car-roll
Copy link
Collaborator

car-roll commented Nov 8, 2021

makes sense. I just wanted some kind of indicator that the jenkins version was being bumped, but i can also just add that in the changelog as well

@car-roll car-roll merged commit c11a320 into jenkinsci:master Nov 8, 2021
@jglick jglick deleted the accessPermittedOnlyFromCurrentBuild branch November 8, 2021 21:54
jglick added a commit to jglick/workflow-durable-task-step-plugin that referenced this pull request Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants