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-63541] Don't create empty dirs in chooser #948

Merged

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Aug 28, 2020

JENKINS-63541 - Don't create empty dirs in chooser

The git plugin previously created an empty directory in the $JENKINS_HOME/caches directory for any repository URL that it checked for size. Those empty directories are not likely to use too much disc space, but a large installation that clones many different repositories will have many empty directories in the caches directory.

Provides a new getCacheDir API that returns null if the directory does not already exist.

Checklist

  • I have read the CONTRIBUTING doc
  • I have referenced the Jira issue related to my changes in one or more commit messages
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • Documentation in README has been updated as necessary
  • Online help has been added and reviewed for any new or modified fields
  • I have interactively tested my changes
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

The git plugin previously created an empty directory in the
$JENKINS_HOME/caches directory for any repository URL that it checked for
size. Those empty directories are not likely to use too much disc space,
but a large installation that clones many different repositories will
have many empty directories in the caches directory.

Provides a new getCacheDir API that returns null if the directory does
not already exist.
@MarkEWaite MarkEWaite force-pushed the no-empty-dirs-on-cache-lookup branch from 5f897a0 to 2cf7ef7 Compare August 28, 2020 02:26
@MarkEWaite MarkEWaite added the bugfix Fixes a bug - used by Release Drafter label Aug 28, 2020
Copy link
Contributor

@rishabhBudhouliya rishabhBudhouliya left a comment

Choose a reason for hiding this comment

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

Thanks for catching this issue, I had completely forgotten that getCacheDir creates a new directory every time we try to look for one.
I was only concerned of breaking the existing behaviour as the Multi branch project depends on this API but you've taken care of that as well, overall looks great to me.

@fcojfernandez
Copy link
Member

Really good catch!

@MarkEWaite MarkEWaite merged commit 3121391 into jenkinsci:master Aug 28, 2020
@MarkEWaite MarkEWaite deleted the no-empty-dirs-on-cache-lookup branch August 28, 2020 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a bug - used by Release Drafter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants