extract kindsys to external library (#64562)

* extract kindsys

* reinstate kindsys report

This may end up living somewhere else (or not! who knows!), but the important part is that I don't get rid of it right now :)

I hate the package layout (kindsysreport/codegen) for the main function and will take pretty much any alternative suggestion, but we can change also change it later.

Note that the generated report.json is in a different location - anything using this (ops something) needs to be updated.

* kindsysreport in codeowners
This commit is contained in:
Kristin Laemmert
2023-03-15 12:04:28 -04:00
committed by GitHub
parent 3f5acf346d
commit 8745d7ef1b
70 changed files with 390 additions and 1515 deletions

View File

@@ -7,6 +7,7 @@ import (
"cuelang.org/go/cue/ast"
tsast "github.com/grafana/cuetsy/ts/ast"
"github.com/grafana/grafana/pkg/plugins/pfs"
)
@@ -16,7 +17,7 @@ import (
var importMap = map[string]string{
"github.com/grafana/thema": "",
"github.com/grafana/grafana/pkg/kindsys": "",
"github.com/grafana/kindsys": "",
"github.com/grafana/grafana/pkg/plugins/pfs": "",
"github.com/grafana/grafana/packages/grafana-schema/src/common": "@grafana/schema",
}

View File

@@ -2,9 +2,10 @@ package pfs
import (
"cuelang.org/go/cue/ast"
"github.com/grafana/grafana/pkg/kindsys"
"github.com/grafana/grafana/pkg/plugins/plugindef"
"github.com/grafana/kindsys"
"github.com/grafana/thema"
"github.com/grafana/grafana/pkg/plugins/plugindef"
)
type PluginDecl struct {

View File

@@ -7,7 +7,7 @@ import (
"path/filepath"
"sort"
"github.com/grafana/grafana/pkg/kindsys"
"github.com/grafana/kindsys"
"github.com/grafana/thema"
)

View File

@@ -1,7 +1,7 @@
package pfs
import (
"github.com/grafana/grafana/pkg/kindsys"
"github.com/grafana/kindsys"
)
// GrafanaPlugin specifies what plugins may declare in .cue files in a

View File

@@ -15,13 +15,14 @@ import (
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/parser"
"cuelang.org/go/cue/token"
"github.com/grafana/grafana/pkg/cuectx"
"github.com/grafana/grafana/pkg/kindsys"
"github.com/grafana/grafana/pkg/plugins/plugindef"
"github.com/grafana/kindsys"
"github.com/grafana/thema"
"github.com/grafana/thema/load"
"github.com/grafana/thema/vmux"
"github.com/yalue/merged_fs"
"github.com/grafana/grafana/pkg/cuectx"
"github.com/grafana/grafana/pkg/plugins/plugindef"
)
// PackageName is the name of the CUE package that Grafana will load when
@@ -57,7 +58,7 @@ func loadGP(ctx *cue.Context) cue.Value {
func PermittedCUEImports() []string {
return []string{
"github.com/grafana/thema",
"github.com/grafana/grafana/pkg/kindsys",
"github.com/grafana/kindsys",
"github.com/grafana/grafana/pkg/plugins/pfs",
"github.com/grafana/grafana/packages/grafana-schema/src/common",
}

View File

@@ -2,7 +2,8 @@ package pfs
import (
"cuelang.org/go/cue/ast"
"github.com/grafana/grafana/pkg/kindsys"
"github.com/grafana/kindsys"
"github.com/grafana/grafana/pkg/plugins/plugindef"
)

View File

@@ -5,7 +5,7 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/grafana/grafana/pkg/kindsys"
"github.com/grafana/kindsys"
)
// This is a brick-dumb test that just ensures known schema interfaces are being