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

Enable Git Includes (Sparse Checkout) #637

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jplindquist
Copy link

@jplindquist jplindquist commented May 2, 2024

Summary

Enable git sparse-checkout when :includes are defined

Additional Context

The goal here is to enable sparse-checkout on a git repository when :includes are defined. This allows you to only include certain files or directories as needed, or when working in a monorepo for example.

I was able to test this out locally and it seems to function as I'd expect, only checking out specific files or directories on multiple versions of git, and triggers updates (checkout) if the list of includes changes. I'm not terribly familiar with rspec tests, but I did my best to add a couple unit tests to verify the functionality as well. Let me know if there's anything missing. Thank you!

Related Issues (if any)

Resolves #636

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@jplindquist jplindquist requested review from bastelfreak, smortex and a team as code owners May 2, 2024 17:34
@jplindquist jplindquist changed the title Git sparse checkout Enable Git Includes (Sparse Checkout) May 2, 2024
Copy link
Collaborator

@smortex smortex left a comment

Choose a reason for hiding this comment

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

Looks great 😍! I added some in-line comments for minor points to check.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
lib/puppet/provider/vcsrepo/git.rb Outdated Show resolved Hide resolved
lib/puppet/provider/vcsrepo/git.rb Outdated Show resolved Hide resolved
lib/puppet/provider/vcsrepo/git.rb Outdated Show resolved Hide resolved
@jplindquist
Copy link
Author

Thanks for reviewing! Pushed a couple updates and tweaks based on your suggestions. Let me know if you'd prefer me to clean up the commits or rebase or anything.

Copy link
Collaborator

@smortex smortex left a comment

Choose a reason for hiding this comment

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

That looks good. I think you can squash your commits if you feel this is ready.

@smortex smortex added the feature label May 2, 2024
@jplindquist
Copy link
Author

Awesome. I think I've got them squashed into logical groupings at least (feature, docs, tests), but let me know if you want it squashed further. Thanks again for looking this over.

Copy link
Collaborator

@smortex smortex left a comment

Choose a reason for hiding this comment

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

LGTM! I would merge that if I was not the only reviewer, so let's wait for more review/feedback.

Thanks!

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.

Enable Git Sparse Checkout
4 participants