Repository navigation
DRAFT - remove restriction on github only dagger modules - #6895
purpleclay wants to merge 1 commit into
Conversation
Signed-off-by: purpleclay <[email protected]>
| parsed.isGitHub = strings.HasPrefix(parsed.modPath, "github.com/") | ||
|
|
||
| if !parsed.hasVersion && !parsed.isGitHub { | ||
| if _, err := os.Stat(refString); err == nil { |
There was a problem hiding this comment.
From initial testing, I can successfully use dagger modules hosted on other VCS platforms like GitLab. However, I have broken ModuleSourceKindLocal. I have left this change here for discussion purposes.
Some examples, with debug output attached:
./bin/dagger call --debug -m gitlab.com/purpleclay/daggerverse/[email protected] --src . mod-version
1.21.6./bin/dagger call --debug -m gitlab.com/testing5740411/another/another2/another3/daggerverse/[email protected] --src . mod-version
1.21.6Looking at the current logic and how this function is used, I feel there must be a better way to detect a local path provided to the -m flag on the CLI. I completely understand I lack knowledge of how the Dagger engine works. And there might be an easy way of doing this, which isn't that obvious to me.
There was a problem hiding this comment.
I suspect currently if you had a local module in ./github.com/foo/bar and called -m github.com/foo/bar that would probably break for the same reason. Maybe local modules should always be prefixed by ./ or absolute path?
There was a problem hiding this comment.
I was toying with using a convention like / or ./ to denote that the module is local, but omitting those is also a valid way of indicating a file path. Of course, it would be much better than making a remote module identifiable through a convention such as https://. The typing of those extra characters feels like a bad developer experience.
Could a distinction be made through the CLI itself? For example, could introducing a new flag for a local module be done? Of course, that would be a breaking change to the CLI.
I am happy to make the change you suggested for local module testing with the abovementioned prefixes to see how it looks and behaves.
There was a problem hiding this comment.
I agree requiring https:// doesn't feel great. I think the lookup needs to happen both from the CLI directly and also during runtime for loading dependencies, so a different flag may not work anyway. Any ideas @jedevc @vito @sipsma @shykes ?
|
cc @vito @kpenfound, I know there's a few internal discussion around this 🎉 |
|
For continuity, the last time I looked into this I put together a proposal for "v2 refs". It's a really tricky topic, and also ties in to potential product-level decisions like short-refs to modules in the Daggerverse - so just to manage expectations, I'm a little skeptical that we'll be able to resolve this quickly in a single PR, but I'm very happy that someone else is trying to move the needle here. 🙂 The sneaky hard part is that we need to distinguish the repo root ( I'm not totally sure where we go from here, but I'm glad it's active again, since I know we don't want to be married to Thanks! |
|
@vito Thanks for the link to the I agree that this should be resolved in a series of smaller PRs, introducing functionality in tiny chunks to gauge its impact. I have some thoughts and questions (please be mindful that I haven't trawled through the entire code base 😄):
My naive solution allowed me to work with GitLab nested groups and was designed to promote discussion and increase my understanding of how Dagger resolves the identified Git ref. |
|
@purpleclay re: detecting local references, yeah I agree that seems worth a quick Also: what if I say Worth noting that we also now support having re: the proposal in general, we never reached consensus on it, so I wouldn't hold it up as the golden standard, but I'm glad it made sense to you too. :P I think the most controversial parts are a) the various URL shorthands and b) the use of @shykes Have you had any new thoughts re: shorthand for Daggerverse modules? |
|
@vito Can I ask how a named module is resolved? |
|
@purpleclay Sure thing - so in that case the CLI will look upward from the current directory until it finds the nearest |
|
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 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. |
|
@purpleclay Letting the stale bot close this one out seems OK - conversation is active in #7218 now and @grouville is actively working on this. Thanks for getting the ball rolling! 🙏 |
closes #6890