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

[JENKINS-73929] Handle custom buildsDir #588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dohbedoh
Copy link
Contributor

In case buildsDir is customize, relativize against the buildsDir root directory to calculate the prefix.

Testing done

Tested with / without custom buildsDir
Tested with Multibranch branch job builds and standalone pipeline job builds

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

@Dohbedoh Dohbedoh requested a review from a team as a code owner October 15, 2024 05:14
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Good though it does not handle all cases.

@@ -97,6 +91,26 @@ public boolean understandsSymlink() {
}
}

private static String getBuildRelativePath(@NonNull Run item, @NonNull File itemRootDir) {

// See Jenkins#isDefaultBuildDir that has restriction and cannot be used outside Jenkins core
Copy link
Member

Choose a reason for hiding this comment

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

I think it is Jenkins.getBuildDirFor you want to look at. What if Jenkins.buildsDir is set to, e.g., ${ITEM_ROOTDIR}/all-the-builds?

@jglick jglick added the bug label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants