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

Tone down warning about rawWorkspaceDir from WorkspaceLocatorImpl #258

Merged
merged 2 commits into from
Jul 14, 2021

Conversation

jglick
Copy link
Member

@jglick jglick commented Jul 6, 2021

In the case of JFR https://github.com/jenkinsci/jenkinsfile-runner/blob/69c70e5c6ae070151cf2890f96ae60031aae9d23/bootstrap/src/main/java/io/jenkins/jenkinsfile/runner/bootstrap/commands/PipelineRunOptions.java#L16-L24 + https://github.com/jenkinsci/jenkinsfile-runner/blob/69c70e5c6ae070151cf2890f96ae60031aae9d23/bootstrap/src/main/java/io/jenkins/jenkinsfile/runner/bootstrap/commands/RunJenkinsfileCommand.java#L18-L41 this warning

WARNING	j.branch.WorkspaceLocatorImpl#getWorkspaceRoot: JENKINS-2111 path sanitization ineffective when using legacy Workspace Root Directory ‘/jenkins_build_data/build’; switch to ‘${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}’ as in JENKINS-8446 / JENKINS-21942

is just noise.

if (rawWorkspaceDir.startsWith("${ITEM_ROOTDIR}/")) {
LOGGER.log(Level.WARNING, "JENKINS-2111 path sanitization ineffective when using legacy Workspace Root Directory ‘{0}’; switch to ‘$'{'JENKINS_HOME'}'/workspace/$'{'ITEM_FULL_NAME'}'’ as in JENKINS-8446 / JENKINS-21942", rawWorkspaceDir);
} else {
LOGGER.log(Level.FINE, "JENKINS-2111 path sanitization ineffective when using unrecognized Workspace Root Directory ‘{0}’; switch to ‘$'{'JENKINS_HOME'}'/workspace/$'{'ITEM_FULL_NAME'}'’", rawWorkspaceDir);
Copy link
Member

Choose a reason for hiding this comment

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

IDK how useful this message was in the first place or whether this branch is a case we would ever expect non-JFR users to run into. Would it make sense to have JFR set a generic (IsJenkinsfileRunner=true) system property or something like that, and then we could check for that in these kinds of cases instead to avoid affecting non-JFR users? Or do we only expect this branch to be hit by JFR users?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. I just know that in case neither the old nor new default workspace dir pattern match, you are probably in some special setup and did not really care about the refined behavior of WorkspaceLocatorImpl. Especially on the controller node—none of this applies to agents.

@jglick jglick requested a review from car-roll July 12, 2021 19:51
@jglick
Copy link
Member Author

jglick commented Jul 12, 2021

Could I get someone to merge & release this please?

@car-roll car-roll merged commit 1575ce6 into jenkinsci:master Jul 14, 2021
@jglick jglick deleted the rawWorkspaceDir branch July 14, 2021 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants