add keep-git-dir and submodules controls for Git querystring URLs#6173
add keep-git-dir and submodules controls for Git querystring URLs#6173tonistiigi merged 3 commits intomoby:masterfrom
Conversation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
| if err != nil { | ||
| return errors.Errorf("invalid submodules value: %q", v[0]) | ||
| } | ||
| gf.Submodules = &vv |
There was a problem hiding this comment.
For boolean values, probably value-less query (v[0] == "") can be allowed
https://example.com/foo.git?keep-git-dir
| if !gs.src.SkipSubmodules { | ||
| _, err = git.Run(ctx, "submodule", "update", "--init", "--recursive", "--depth=1") | ||
| if err != nil { | ||
| return nil, errors.Wrapf(err, "failed to update submodules for %s", urlutil.RedactCredentials(gs.src.Remote)) | ||
| } |
There was a problem hiding this comment.
Maybe that's an edge case but was wondering if we could have submodules being either a bool to enable/disable init submodules but also a list to init some of them only like submodules=./sub1,./sub2?
There was a problem hiding this comment.
Possible problems:
- more idiomatic querystring would be
submodules=./sub1&submodules=./sub2 - what if submodule path is
trueorfalse - should this support pattern matching
Because of this would make more sense as a different builtin key that can be added later in a follow-up?
There was a problem hiding this comment.
Because of this would make more sense as a different builtin key that can be added later in a follow-up?
Mostly looking at reusing the same key but the query form you suggest submodules=./sub1&submodules=./sub2 makes more sense. So yeah we might need another key.
What do you think of init-submodules=<true|false> default to true and another one filter-submodules=<pattern>?
There was a problem hiding this comment.
Yes, was thinking smth like submodules-filter. Don't know if we would need init- prefix
There was a problem hiding this comment.
Yes submodules=<bool> and submodules-filter=<pattern> LGTM
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
|
Added the valueless versions per #6173 (comment) |
<!--Delete sections as needed --> ## Description <!-- Tell us what you did and why --> BuildKit v0.24 introduces URL like `https://github.com/example/example.git?tag=v0.0.1&checksum=deadbeef` ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> - moby/buildkit#6172 - moby/buildkit#6173 ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [X] Technical review - [X] Editorial review - [ ] Product review --------- Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> Co-authored-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>
follow-up #6172
fixes #4974
@tianon