TestData: Introduce schema types (#62130)

* schematize data query

* add the stuff you dingus

* feat(testdatasource): add scenario to generated types

* use generated testdata query in frontend

* update code owners

* Add path exception for testdata datasource

* use specific numeric data types

* fix test

* fix e2e smoketest

* add test data query type

* use test data query type

* fix betterer

* Fix typo

* move to experimental

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: sam boyer <sdboyer@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
Will Browne
2023-01-26 16:31:34 +01:00
committed by GitHub
parent 0cd14091c4
commit 42732539ed
30 changed files with 876 additions and 225 deletions

View File

@ -51,6 +51,11 @@ func (j *pgoJenny) Generate(decl *pfs.PluginDecl) (*codejen.File, error) {
}
pluginfolder := filepath.Base(decl.PluginPath)
// hardcoded exception for testdata datasource, ONLY because "testdata" is basically a
// language-reserved keyword for Go
if pluginfolder == "testdata" {
pluginfolder = "testdatasource"
}
filename := fmt.Sprintf("types_%s_gen.go", slotname)
return codejen.NewFile(filepath.Join(j.root, pluginfolder, "kinds", slotname, filename), byt, j), nil
}