grafana/apps
Roberto Jiménez Sánchez 185d018a26
Provisioning: Generalize the job admission validator (#125978)
* Provisioning: Generalize the job admission validator (P0.9)

validateExportResourceRefs (shared by push and migrate job options)
hard-rejected anything that wasn't a Dashboard, so job-driven flows for
any newly-supported kind failed at admission.

Validate each resource ref's kind/group against the configured
supported-resource set instead of the dashboard constants. The set is
injected into the job AdmissionValidator and threaded through ValidateJob.
When no set is configured it falls back to the dashboard-only default,
preserving legacy behavior. Disabled resources are not accepted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Provisioning: Integration tests for config-driven job admission validation

Update the existing job-validation integration assertions for the
generalized validator: the default active set is {Folder, Dashboard}, so
Folder is now accepted for export — switch the rejection cases to kinds
that are genuinely outside the active set (declared-but-disabled Playlist
and LibraryPanel, case-mismatched "dashboard") and to the new error
messages.

Add a config-driven integration test that boots Grafana with a custom
[provisioning] resources set and asserts the validator honors it: a kind
added purely through config is accepted for push/migrate, while unknown,
disabled, and wrong-group refs are rejected at admission.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Provisioning: Drop repo dependency from config-driven job validation test

The test created a local repository whose initial sync failed under the
postgres CI runner (the worker's repo status update hit the permitted-path
check), making setup flaky. Job admission only requires a non-empty
repository name and does not check repository existence, so creating Job
objects directly through the resource client exercises the validator in
isolation without a real repository.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 17:44:10 +02:00
..
advisor deps(go): Bump github.com/Masterminds/semver/v3 from 3.4.0 to 3.5.0 (#125490) 2026-06-08 09:53:37 +02:00
alerting fix: make alerting rule sequence informer watch calls cluster scoped (#125947) 2026-06-08 09:10:09 -04:00
annotation Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
collections Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
correlations Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
dashboard Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
dashvalidator deps(go): Bump github.com/Masterminds/semver/v3 from 3.4.0 to 3.5.0 (#125490) 2026-06-08 09:53:37 +02:00
example Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
folder Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
iam Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
live Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
logsdrilldown Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
playlist Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
plugins deps(go): Bump github.com/Masterminds/semver/v3 from 3.4.0 to 3.5.0 (#125490) 2026-06-08 09:53:37 +02:00
preferences Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
provisioning Provisioning: Generalize the job admission validator (#125978) 2026-06-08 17:44:10 +02:00
quotas deps(go): Bump github.com/Masterminds/semver/v3 from 3.4.0 to 3.5.0 (#125490) 2026-06-08 09:53:37 +02:00
scope Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
secret Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
shorturl Dependencies: Bump Go to v1.26.4 (#125848) 2026-06-04 06:36:37 +02:00
sdk.mk chore: bumb app-sdk version (#125399) 2026-05-25 16:40:13 +02:00