-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(clone): turbo clone #9904
base: main
Are you sure you want to change the base?
feat(clone): turbo clone #9904
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…er finding bugs via tests
@@ -1274,7 +1285,6 @@ pub async fn run( | |||
}; | |||
|
|||
cli_args.command = Some(command); | |||
cli_args.cwd = Some(repo_root.as_path().to_owned()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I can tell, we don't actually use the cwd as repo root anywhere. can correct if this isn't true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a necessary change for this PR? repo_root
looks like a bad name since it can get it's value from cli_args.cwd
. This value will now no longer be made absolute if it is given as a relative value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it is necessary, although I can just save the old cwd instead. We don't want the repo root to be our cwd and in fact, we probably don't want to be in a repo in the first place for turbo clone. This is a pretty big departure from our other commands.
Make sure we allow partial clones | ||
|
||
Do a blobless clone | ||
$ ${TURBO} clone file://$(pwd)/basic-monorepo.t basic-monorepo-blobless --local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced we're actually doing a real blobless clone here. If anybody has ideas for better testing that doesn't involve hitting a remote git repo (unless we really have to ig), I'm open to ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the config claims it's blobless but my suspicion is that git only does a blobless clone if you really need it. For trivial repos it just doesn't make sense. I tried adding a test that adds a file, then deletes in in a second commit, and then does a blobless clone, with the idea that the file should not be included in the clone since it's not a blob that is reachable from HEAD. But the file was indeed cloned, so who knows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're not convinced this test is actually testing the behavior we want than we shouldn't include it. Only suggestion for testing would be to set up a local git server and clone from that, but that feels a bit like overkill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could try to clone against GitHub but that's a little sketchy for a test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new tests seem to be unhappy
@@ -1274,7 +1285,6 @@ pub async fn run( | |||
}; | |||
|
|||
cli_args.command = Some(command); | |||
cli_args.cwd = Some(repo_root.as_path().to_owned()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a necessary change for this PR? repo_root
looks like a bad name since it can get it's value from cli_args.cwd
. This value will now no longer be made absolute if it is given as a relative value.
Make sure we allow partial clones | ||
|
||
Do a blobless clone | ||
$ ${TURBO} clone file://$(pwd)/basic-monorepo.t basic-monorepo-blobless --local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're not convinced this test is actually testing the behavior we want than we shouldn't include it. Only suggestion for testing would be to set up a local git server and clone from that, but that feels a bit like overkill.
Description
Implements
turbo clone
, essentially a small wrapper aroundgit clone
that does simple optimizations like blobless clones for local development and treeless clones for CI.Testing Instructions
Wrote some tests but not convinced they're actually effective. See comments below