You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cue version
cue version v0.0.0-20240819151828-81d6f8bfcd61
go version go1.23.0
-buildmode exe
-compiler gc
DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1
CGO_ENABLED 1
GOARCH arm64
GOOS linux
GOARM64 v8.0
vcs git
vcs.revision 81d6f8bfcd61eeff2ec60ac71c8cc9867e6853e9
vcs.time 2024-08-19T15:18:28Z
vcs.modified false
cue.lang.version v0.11.0
Does this issue reproduce with the latest release?
Yes
What did you do?
cue help flags says the following about how non-CUE files are handled:
Non-CUE files are merged at their roots by default.
The can be combined differently or treated as different files
by using a combination of the following flags.
Individual files
To treat non-cue files as individual files, use --no-merge flag.
This is the default for vet. This flag only applies to data files
when used in combination with the --schema/-d flag.
Noting firstly that --no-merge does not exist as a flag: it is spelt --merge=false.
Also there doesn't appear to be a way to override the fact that vet does not merge non-CUE files:
i.e. --merge=false appeared to result in the multiple values from a single non-CUE file not being "merged". This overloading however presents a problem when it comes to multiple multi-document non-CUE files - what should the result be then?
So now --merge=false does not produce multiple output values, it produces one with the merged result of the merged result from each multi-document file.
What did you expect to see?
Given the above explanation, unclear. We need to clarify the interaction of these flags and fix the implementation and documentation to match.
The current help text appears to imply that --merge has some effect on cue import for non-CUE files. Given that command is file-oriented in the first place, I'm not clear it means anything to specify (by default or otherwise) --merge. The existing --files does make sense for multi-document non-CUE files, regardless of how many are specified as arguments to cue import.
Deciding if --merge(=false) should only apply at the non-CUE file level, or whether it can also apply to the multiple values from multi-document files. Per above however, overloading in this way appears to conflate two apparently orthogonal concerns: 1) whether to merge the (multiple) values from multiple non-CUE files, 2) whether to merge the multiple values from a single multi-document non-CUE file.
Depending on the answer to the previous point, we need to ensure we have test coverage for the matrix of scenarios in which --merge can be used (answering the previous point might give birth to another flag). Specifically, we need to ensure that we have coverage for the case where we specify multiple multi-document files to, say, cue export. Because in that situation there are two "points" at which we might want to control a merge. The interaction (or lack thereof) with --path and --list (we ignore --files because that only applies to cue import) needs to be tested.
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
cue help flags
says the following about how non-CUE files are handled:Noting firstly that
--no-merge
does not exist as a flag: it is spelt--merge=false
.Also there doesn't appear to be a way to override the fact that
vet
does not merge non-CUE files:cue/cmd/cue/cmd/common.go
Line 653 in 81d6f8b
The documentation above seems to imply that
--merge
applies at the non-CUE file-level. However this appears to be contradicted by the following:This fails with:
i.e.
--merge=false
appeared to result in the multiple values from a single non-CUE file not being "merged". This overloading however presents a problem when it comes to multiple multi-document non-CUE files - what should the result be then?This fails with:
So now
--merge=false
does not produce multiple output values, it produces one with the merged result of the merged result from each multi-document file.What did you expect to see?
Given the above explanation, unclear. We need to clarify the interaction of these flags and fix the implementation and documentation to match.
What did you see instead?
A confused user looking at me in the mirror.
There are various points that I think need clarifying here ahead of addressing #3369 and completing https://review.gerrithub.io/c/cue-lang/cue/+/1199496. Here is an incomplete list:
--merge
has some effect oncue import
for non-CUE files. Given that command is file-oriented in the first place, I'm not clear it means anything to specify (by default or otherwise)--merge
. The existing--files
does make sense for multi-document non-CUE files, regardless of how many are specified as arguments tocue import
.--merge(=false)
should only apply at the non-CUE file level, or whether it can also apply to the multiple values from multi-document files. Per above however, overloading in this way appears to conflate two apparently orthogonal concerns: 1) whether to merge the (multiple) values from multiple non-CUE files, 2) whether to merge the multiple values from a single multi-document non-CUE file.--merge
can be used (answering the previous point might give birth to another flag). Specifically, we need to ensure that we have coverage for the case where we specify multiple multi-document files to, say,cue export
. Because in that situation there are two "points" at which we might want to control a merge. The interaction (or lack thereof) with--path
and--list
(we ignore--files
because that only applies tocue import
) needs to be tested.--merge
(and any related flags) should work, with whatever default, forvet
and other commands.It is highly likely that the above analysis is incomplete. I've started this issue mainly as a result of my response to https://review.gerrithub.io/c/cue-lang/cue/+/1199496 getting out of control!
The text was updated successfully, but these errors were encountered: