Skip to content
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

evalv3: "field not allowed" regression with definition fields #3491

Closed
mvdan opened this issue Oct 10, 2024 · 2 comments
Closed

evalv3: "field not allowed" regression with definition fields #3491

mvdan opened this issue Oct 10, 2024 · 2 comments
Labels
closedness evaluator evalv3 issues affecting only the evaluator version 3

Comments

@mvdan
Copy link
Member

mvdan commented Oct 10, 2024

env CUE_EXPERIMENT=evalv3=0
exec cue export

env CUE_EXPERIMENT=evalv3=1
exec cue export

-- file.cue --
package p

#Schema: {
	schemaField?: {}
}

config: #Schema & {
	schemaField: {}
}

config: config2

config2: {
	#Extra: {}
}

As of 44cceca:

> env CUE_EXPERIMENT=evalv3=0
> exec cue export
[stdout]
{
    "config": {
        "schemaField": {}
    },
    "config2": {}
}
> env CUE_EXPERIMENT=evalv3=1
> exec cue export
[stderr]
config.#Extra: field not allowed:
    ./file.cue:11:9
[exit status 1]
FAIL: repro-evalv3.txtar:5: unexpected command failure

As far as I can tell, evalv2 is right in accepting this configuration. In fact, the error config.#Extra: field not allowed feels like it should be impossible; as far as my understanding of the spec goes, definitions and hidden fields should not be affected by closedness at all.

@mpvl
Copy link
Member

mpvl commented Oct 10, 2024

This is related to this: #543

This behavior was proposed, but it should not be implemented by v3 yet or at all.

@mvdan
Copy link
Member Author

mvdan commented Oct 10, 2024

Agreed. Even if we did want to do this soon, it should be as a separate experiment. We want to make the transition from v2 to v3 as smooth as possible first.

cueckoo pushed a commit that referenced this issue Oct 11, 2024
To be immediately followed with fix.

Issue #3491

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I86d2bfaa20600956bd3118fce07f71d1c4bff9f5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202460
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
vanhtuan0409 pushed a commit to anduintransaction/cue that referenced this issue Oct 15, 2024
To be immediately followed with fix.

Issue cue-lang#3491

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I86d2bfaa20600956bd3118fce07f71d1c4bff9f5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202460
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
vanhtuan0409 pushed a commit to anduintransaction/cue that referenced this issue Oct 15, 2024
This was currently not always allowed due to
an inconsistency in the logic.

Issue cue-lang#543
Fixes cue-lang#3491

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: If5404d8adbe0ac13a665579e6d273722d54ef268
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202461
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
@mvdan mvdan added the evalv3 issues affecting only the evaluator version 3 label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closedness evaluator evalv3 issues affecting only the evaluator version 3
Projects
None yet
Development

No branches or pull requests

2 participants