-
Notifications
You must be signed in to change notification settings - Fork 294
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
cmd/cue: mod init's DX of "non-conforming path ..." is confusing #3022
Labels
Comments
mvdan
added
modules
Issues related to CUE modules and the experimental implementation
and removed
Triage
Requires triage/attention
labels
May 3, 2024
Agreed - we can do better here, perhaps indeed pointing people towards https://cuelang.org/docs/reference/modules/#module-path |
cueckoo
pushed a commit
that referenced
this issue
Jul 22, 2024
This adds some tests for some errors that will be improved in the next CL in this chain. We also add tests for some of the module path checking functions that were not properly unit tested previously so we can be sure that their behavior does not change (an earlier iteration _did_ unexpectedly change the behavior of `CheckImportPath`). As the test table is shared between several test functions (useful, as it's nice to see the results for each check function across all the input data), we needed to update the `tdtest` package to support tables defined at the top level. We include this change in this CL because then it's clear that it actually works. For #3022 Signed-off-by: Roger Peppe <[email protected]> Change-Id: I7cd5da04858c7610dcadfa6a28dff8a0f2e6ea77 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198135 Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes, 0.8.1.
What did you do?
I opened #3021 because I didn't know that module paths now need to be lower case, and nothing outside the experimentally-scoped documentation at https://cuelang.org/docs/reference/modules/ mentions this.
When attempting to initialise a module with a path that contains upper case letters, this is the current DX:
This is confusing, especially as the only guidance I can recall us giving around module names is that they should generally reflect domains under the user's control or (on shared domains) paths under the user's control. The user "MyUserName", above, doesn't explicitly control the namespace
github.com/myusername/
. In this error message we should give them clear guidance about what's wrong with their proposed module name; and in the case of it being a case issue we should link to guidance about when it's safe to fold case. I.e. there will be services out there where userMyUserName
does not controlservice.example/myusername/
, and we should be cautious in not providing blanket "just lower case the path" guidance.What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: