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

Allow override values in child #80

Merged
merged 3 commits into from
Feb 22, 2023
Merged

Allow override values in child #80

merged 3 commits into from
Feb 22, 2023

Conversation

spinillos
Copy link
Member

@spinillos spinillos commented Feb 22, 2023

Fixes: https://github.com/grafana/schematization-and-as-code-project/issues/59

When a child overrides parent value, instead of put the new value, we were putting the type instead.

This is happening because we have a disjunction in this case and we aren't able to find the reference of this type. For that, we need to iterate a level more to see if its overwriting this value.

The overriding struct is a BottomKind with two elements inside, but it has the same structure than the fields with default values (#AType & "a"). The difference between them is the cue.OrOp operator that we can skip.

Note: When you set an invalid override value, it doesn't write anything in TS file.

Also I added the path in the logs because its easier to identify what was wrong.

Copy link
Contributor

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sdboyer sdboyer merged commit c6dbdd0 into main Feb 22, 2023
@sdboyer sdboyer deleted the allow-override-values branch February 22, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants