Repository navigation
Conversation
There was a problem hiding this comment.
Hm, this shouldn't be a valid syntax.
The supported syntaxes should either be:
- The older buildkit ref style
- The newer module ref style
I don't think this is either of the above?
There was a problem hiding this comment.
Ok 👌
I wanted to cover all the test cases of the current TestParseGit whilst adding the version / subdir:
https://github.com/dagger/dagger/blob/main/cmd/dagger/module_test.go#L148
As they seemed permitted, some users might be using such implicit ssh ref, with the version in old style I agree ?
I understand, so no ssh ref style on the new ref scheme ?
There was a problem hiding this comment.
Oh agreed, it's just that this specific case isn't in there.
e54954a to
f22fa51
Compare
…directory ref style This reimplements in a far better way the conversion logic from previous ref to the new ref scheme. As part of it, we move the parseRefString implementation to the vcs package, to avoid dependency hell issue between the core and the CLI. We introduce a ParseRef Func type, aimed to be used by ConvertToBuildKitRef to handle the two specific use-cases: parseRefStringDir and parseRefStringFile We rename parseRefString to parseRefStringDir, as it was intended for directory ref parsing, and we duplicate its logic for files. The only difference is the stat type: parseRefStringFile makes sure that the file exists locally as part of the implicit local file interpolation An in-depth test suite is also implemented to ensure retrocompatibility as well as proper conversion of those local / remote refs Signed-off-by: Guillaume de Rouville <[email protected]>
There used to be a few cases in which the repoRoot.Repo did not have a .git suffix (e.g. GitLab). We unify its output to manually make sure it is never present: Signed-off-by: Guillaume de Rouville <[email protected]>
c731862 to
e493cff
Compare
Signed-off-by: Guillaume de Rouville <[email protected]>
e493cff to
138f114
Compare
The CLI now relies on modulesourcekind to isolate the kind of module being loaded. This helps us have a consistent behavior regarding local file / dir refs that resembles remote ones However, as the enum implementation was part of the core package, it introduced build constraints. Moving the implementation to the core/modules subpackage solves it Signed-off-by: Guillaume de Rouville <[email protected]>
|
Failure seems unrelated to implementation |
|
Want to rebase @grouville as soon as we have upgraded our CI to |
I think we should review / rebase it once #7708 gets merged as it will impose the ref style for private git repo |
|
x-linking #6957 - not entirely sure how these should interact. |
| if subdir := parsedGit.Fragment.Subdir; subdir != "" { | ||
| gitDir = gitDir.Directory(subdir) | ||
| bk := &osBuildkitClient{} | ||
| ref, kind := vcs.ConvertToBuildKitRef(ctx, v.String(), bk, vcs.ParseRefStringDir) |
There was a problem hiding this comment.
We should be able to remove this function. Instead, we have parseGit call vcs.ParseRef, and then we can extract host, subpath, etc from there 🎉
We should avoid the dance of converting a parsed string into a raw string to parse it again - that's going to more error prone and difficult to follow 😱
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
Follow-up of #7511 (rebased on top of it)
This applies the new ref scheme to directories and files (moving out from the buildkit syntax), whilst remaining retrocompatible
Implementation
This does not change the cmd/flags logic as we only convert the new ref scheme to buildkit's ref scheme whilst remaining retrocompatible
As part of the implementation, we move the parseRefString implementation to the vcs package, to avoid dependency hell issue between the core and the CLI.
We introduce a ParseRef Func type, aimed to be used by ConvertToBuildKitRef to handle the two specific use-cases:
parseRefStringDir and parseRefStringFile
We rename parseRefString to parseRefStringDir, as it was intended for directory ref parsing, and we duplicate its logic for files. The only difference is the stat type: parseRefStringFile makes sure that the file exists locally as part of the implicit local file interpolation