-
Notifications
You must be signed in to change notification settings - Fork 49
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
Sparse checkout feature - Download subdirectory #387
Sparse checkout feature - Download subdirectory #387
Conversation
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
// ForceGitUrl will add the branch, tag or commit to the git URL and force it to the git protocol | ||
// `<URL>` will return `Git::<URL>?ref=<branch|tag|commit>` | ||
// ForceGitUrl will add the subpackage and branch, tag or commit to the git URL and force it to the git protocol | ||
// `<URL>` will return `Git::<URL>//<SubPackage>?ref=<branch|tag|commit>` |
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.
You might need to make sure that go-getter
can do subdirectory download directly in this form
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.
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
PR conflicted cc @officialasishkumar |
Hi @officialasishkumar 😃 Is this part of the work ready to be reviewed? If you finish or run into any difficulties, feel free to ping me. |
Sure thing, I will finish it up during the weekends and open for review. |
2024-08-14.00-31-29.mp4 |
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@@ -482,10 +482,11 @@ func (deps *Dependencies) loadLockFile(filepath string) error { | |||
func ParseOpt(opt *opt.RegistryOptions) (*Dependency, error) { | |||
if opt.Git != nil { | |||
gitSource := downloader.Git{ |
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.
Add more test cases for GitDownloader
to test the field you added.
@@ -67,6 +67,7 @@ func (registry *Registry) MarshalTOML() string { | |||
const GIT_URL_PATTERN = "git = \"%s\"" | |||
const TAG_PATTERN = "tag = \"%s\"" | |||
const GIT_COMMIT_PATTERN = "commit = \"%s\"" | |||
const GIT_SUB_PACKAGE_PATTERN = "sub-package = \"%s\"" |
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 think use package
is better.
a = { git = "https://github.com/test/test.git" package = "test" } # means select the package called "test" from git repo.
newRepoUrl := cloneOpts.RepoURL | ||
if cloneOpts.SubPackage != "" { | ||
newRepoUrl += "//" + cloneOpts.SubPackage | ||
} |
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 implementation idea here is still wrong, the idea we mentioned before is clone the entire repo. Recursively finds the dependency with the specified package name and loads it
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.
Okay will open a PR with that changes.
I am still not sure why we are discarding downloading a subdirectory (this method )? In case of large repo (let's say 100 MB +) with only one directory of kcl dependecies, it will defeat the purpose of sparse checkout since it will download the entire repo when the user only needs that particular subdirectory any day in the future.
#453 is merged. Do we need this PR? @officialasishkumar |
I don't think so |
#335 Can you modify the description in the plan to identify which tasks have been completed and which ones are not yet completed? |
However, the PR conflicted.
However, the PR conflicted. |
@Peefy Fixed the conflict. |
Done |
Where? |
In the design doc, Implementation and conclusion |
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
2. What is the scope of this PR (e.g. component or file name):
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links: