Skip to content

Cue: Detect references with unifications#1065

Merged
spinillos merged 4 commits intomainfrom
cue/detect-references-with-unifications
Apr 9, 2026
Merged

Cue: Detect references with unifications#1065
spinillos merged 4 commits intomainfrom
cue/detect-references-with-unifications

Conversation

@spinillos
Copy link
Copy Markdown
Member

@spinillos spinillos commented Apr 8, 2026

Fixes: grafana/grafana-app-sdk#1325

Sometimes because unifications of the schema with other ones, could change the scope and Cuelang interprets it differently. It mainly happen because in App-SDK we have something like spec: _ and we unify it with the schema spec defined in Grafana apps. The result is not spec: MySpec, its spec: _ & MySpec making the spec, and depending if the fields of the schema are inside the Spec or outside, Cuelang could have different behaviour 🤷🏼‍♀️.

So instead of have:

Spec: {
  field: Disj
}

Disj: A | B

Cuelang thinks that Disj is _#def & (_#def & A | B) that its the same as (A | B) & _ (Cuelang puts the _ always at the end). So the first block is the disjunction and the second one, the value unified.

@spinillos spinillos self-assigned this Apr 8, 2026
@spinillos spinillos requested a review from a team as a code owner April 8, 2026 11:16
@spinillos spinillos marked this pull request as draft April 8, 2026 11:19
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Note: the diff show code changes that would be introduced by this PR to the output of the Grafana Foundation SDK codegen pipeline.

See full diff.

🔎 Changes to Grafana Foundation SDK

@spinillos spinillos marked this pull request as ready for review April 8, 2026 11:44
@spinillos spinillos requested a review from amalavet April 8, 2026 11:48
@spinillos spinillos merged commit 777c977 into main Apr 9, 2026
15 checks passed
@spinillos spinillos deleted the cue/detect-references-with-unifications branch April 9, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code generation skips definitions for fields in conjunction types

2 participants