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

feat: start workspace in a subpath #898

Merged
merged 9 commits into from
Feb 15, 2024

Conversation

89luca89
Copy link
Contributor

@89luca89 89luca89 commented Feb 12, 2024

Initial draft to support specifying a subpath where to start a workspace

When specified the subpath will be used as:

  • default workdir via ssh
  • default workspace for IDEs
  • default path where to search for devcontainer.json

Full project will anyway be cloned and mounted into the container

Useful for monorepos

Resolves ENG-1976

I'm still not sure if this is the best way to do it, but it works for now, want to discuss here the implementation in the GUI, and if there are missing pieces

EDIT: to change subfolder, you use --recreate also, so it can switch also container

Copy link

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

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

Lgtm

pkg/provider/workspace.go Outdated Show resolved Hide resolved
@ThomasK33
Copy link

This looks good if we want to fork the entire repo.

For larger monorepos we might be interested in implementing sparse checkouts.

Signed-off-by: Luca Di Maio <[email protected]>
@89luca89
Copy link
Contributor Author

This looks good if we want to fork the entire repo.

For larger monorepos we might be interested in implementing sparse checkouts.

Yea was thinking about this but maybe as a separate option?

Like --sparse-checkout SUBDIR which will both do the sparse checkout and the subpath option

This way it could be useful to have a full-checkout+subdir (maybe to access the rest of the project?), or a sparsecheckout that will automatically do also the subdir

Signed-off-by: Luca Di Maio <[email protected]>
@ThomasK33
Copy link

Yeah, adding sparse checkout later makes more sense. You're right.

Like --sparse-checkout SUBDIR which will both do the sparse checkout and the subpath option

I probably wouldn't do that. Assuming one might want to check out multiple folders, args should accept a comma-delimited list or paths to checkout, and then one can use the flag from this PR to change the working directory.

e2e/tests/ssh/ssh.go Outdated Show resolved Hide resolved
@89luca89 89luca89 force-pushed the feat/git_subfolder branch 2 times, most recently from 388e962 to 2cb2ce4 Compare February 14, 2024 17:46
Signed-off-by: Luca Di Maio <[email protected]>
@89luca89 89luca89 merged commit 00fe721 into loft-sh:main Feb 15, 2024
23 checks passed
pascalbreuninger pushed a commit to pascalbreuninger/devpod that referenced this pull request Feb 18, 2024
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.

3 participants