This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
POC: Generate jsonnet library from upstream schema #376
POC: Generate jsonnet library from upstream schema #376
Changes from 4 commits
806fdce
4ce2c86
52b698f
da54d8b
95f721f
0732695
8b5616b
72533fb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just very clearly not what you're looking for here. And it's equally clear to me that we do not currently have sufficient information available in Go scope to organize these outputs by Grafana release version.
That said, working on this gave me a thought about how we might be able to make that information available in a tidy way that would be useful here and elsewhere. Might be a good thing for @malcolmholmes to look at, as it straddles some known overlaps with release engineering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this will be covered by grafana/grafana#58498, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the main thing that using the
kind
as represented in Go offers is all the cue metadata/DSL we'll be wrapping around the kind declarations. In a Go context, these structs will be kept in sync with what's in those cue framework definitions, and are easy to access. It will still probably be possible with generic CLI tooling - usethema
to grab out lineages from known subpaths, and thencue
to extract certain known metadata from other subpaths, emit it as JSON, etc. But i suspect that will get increasingly unwieldy compared to just using the system designed to make this all easy to access from Go, in an external repo, as we're doing here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main area of interest right now with this is probably maturity flags, btw - it seems wise to indicate something about the maturity levels and corresponding guarantees that come with them for each schema.
My stance on grok is that i'm not willing to put it out at all until we have clear comms in that regard. I understand how there are different considerations here, where there were never guarantees in the first place. So probably fine to not consider that part of MVP here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is uncommented, then we get errors like the following:
This happens because of a fugly hack i have to do in Thema in order to be able to generate OpenAPI at all, because the OpenAPI encoder uses the old, deprecated
cue.Instance
. Basically, that func writes out a text version of the lineage and recompiles it through a backdoor - but when recompiling, external imports can't be sanely satisfied.They fixed the API in the recent alpha release, so i no longer have to export, but...well, there's another problem, and i probably just need to submit a patch upstream. Hoping to do that this week - this is also a prerequisite for grok, so it needs to get done regardless.