cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
4.84k stars 279 forks source link

cmd/cue: mod publish fails with VCS State is not clean #3110

Closed DavidGamba closed 1 month ago

DavidGamba commented 1 month ago

What version of CUE are you using (cue version)?

$ cue version
cue version v0.9.0-alpha.3

go version go1.22.2
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH arm64
            GOOS darwin

Does this issue reproduce with the latest stable release?

This is for v0.9.0-alpha.3 only.

What did you do?

Publishing a module after setting the source to git tells me that the VCS state is not clean and won't let me proceed even with the -i flag. I work in monorepos so I always have a dirty VCS state. I can't see myself ever changing that. All the files within the cue module scope are commited.

What did you expect to see?

The -i flag or a --force flag allowing me to bypass that error.

What did you see instead?

Had to change my source to self with cue mod edit --source self for it to allow me to publish.

mvdan commented 1 month ago

Had a brief chat with @myitcv on this - we should only care about "dirty" or "unclean" VCS files if they are part of the CUE module being published. If I have a monorepo at /mono and I am publishing a CUE module at /mono/cuemod, and there are uncommitted new files or changed files in /mono/dirty, we should not require the user to use --force or any flag like that.

myitcv commented 1 month ago

Thanks for raising, @DavidGamba