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

add local directory support #101

Merged
merged 13 commits into from
May 2, 2023
Merged

add local directory support #101

merged 13 commits into from
May 2, 2023

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Apr 25, 2023

This adds the ability to copy a local directory into the updater to be used as the repository to be updated. The file fetcher will prefer to use the locally cloned repository and won't hit GitHub to fetch the files.

Copying in the directory has certain workflow advantages:

  • Currently to test an update, you have to make a commit and push it to GItHub so the CLI can get to the files.
  • Testing a small change to the repo also requires a new commit and push.
  • It can save time if you have to run more than once.

Previously we tried using -v to mount the directory but this didn't work very well:

  • Mounting the directory as writable could change the contents of what you're testing since some of the ecosystems do a git reset between dependency updates.
  • Mounting as read-only also won't work since file operations are required.
  • The mounting syntax is not easy to type -v "$(pwd):/home/dependabot/dependabot-updater/repo:ro"

The flag I chose for now is --local, but if you have a better idea let me know. The terms "directory", "repo", "path" are overloaded already so it was difficult to find a new term.

@jakecoffman jakecoffman requested a review from a team as a code owner April 25, 2023 13:01
Copy link
Contributor

@brrygrdn brrygrdn 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 this, it makes a ton of sense.

I'm 👍🏻 on --local as the flag as we don't really have any other context other than local-dir right now, running against a local-host ( e.g. GHES? ) seems way out of scope and I think it can be achieved via the job definition if we needed to in a pinch.

Base automatically changed from jakecoffman/user-friendly to main May 2, 2023 19:10
# Conflicts:
#	cmd/dependabot/internal/cmd/update.go
#	cmd/dependabot/internal/cmd/update_test.go
@jakecoffman jakecoffman merged commit db448c6 into main May 2, 2023
@jakecoffman jakecoffman deleted the jakecoffman/local-dir branch May 2, 2023 19:21
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.

2 participants