* Docs: Manual backport of alert list panel docs rewrite (#50512) * Updating migration docs to include most relevant breaking changes (#50356) (#50515) (cherry picked from commitcd01eb541a) Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com> * ReleaseNotes: Updated changelog and release notes for 9.0.0-beta2 (#50398) (#50521) Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com> (cherry picked from commita6943cb399) * Alerting: Fix force_migration when alerting is disabled (#50431) (#50481) (#50565) This pull request fixes a bug where force_migration must be set to true when both unified and legacy alerting is disabled. (cherry picked from commitc312188cb2) * [release-v9.0.0] Grafana UI: Fix nonexistent indexof module for plugin tests (#50573) * Grafana UI: Fix nonexistent indexof module for plugin tests (#50529) * fix(grafana-ui): prevent module resolution failure where component-indexof appears as indexof * chore(grafana-ui): update comment explaining need for alias plugin (cherry picked from commit6a4906ef7e) * chore: refresh yarn.lock Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> * [release-v9.0.0] Grafana UI: Put back production build in rollup config (#50581) * Grafana UI: Put back production build in rollup config (#50575) (cherry picked from commit2d1ab27636) * chore: refresh yarn.lock Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> * [release-v9.0.0] Alerting: use "find" to wait for expression editor to load (#50604) Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com> * Docs: Backport 49739 to v9.0.x (#50123) (#50614) Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> (cherry picked from commit49b20ad76c) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Alerting: improve provisioning docs (#50347) (#50619) * Alerting: improve provisioning docs * add new provisioning page * add api docs * fix formatting and add better descriptions * fix typo (cherry picked from commit862f51216b) Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com> * Backport docs changes for Grafana Alerting (#50620) * doc fix (#50624) (#50627) (cherry picked from commit336c9fd513) Co-authored-by: Ieva <ieva.vasiljeva@grafana.com> * RBAC: Inheritance permission migration should handle empty managed roles (#50611) (#50622) * Make inheritance permission migration more robust * Better fix * Add more tests to the migration * Add removed test case * Add test case for empty role in empty org * Handling the role.ID 0 case with a log Co-authored-by: Jguer <joao.guerreiro@grafana.com> Co-authored-by: Jguer <joao.guerreiro@grafana.com> (cherry picked from commit307a0d4538) Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> * "Release: Updated versions in package to 9.0.0" (#369) Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com> Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com> Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com> Co-authored-by: Armand Grillet <2117580+armandgrillet@users.noreply.github.com> Co-authored-by: Ieva <ieva.vasiljeva@grafana.com> Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
What
This aims to define the unified alerting API as code. It generates OpenAPI definitions from go structs. It also generates server/route stubs based on our documentation.
Running
make - regenerate everything - documentation and server stubs.
make serve - regenerate the Swagger document, and host rendered docs on port 80. view api
Requires
Why
The current state of Swagger extraction from golang is relatively limited. It's easier to generate server stubs from an existing Swagger doc, as there are limitations with producing a Swagger doc from a hand-written API stub. The current extractor instead relies on comments describing the routes, but the comments and actual implementation may drift, which we don't want to allow.
Instead, we use a hybrid approach - we define the types in Golang, with comments describing the routes, in a standalone package with minimal dependencies. From this, we produce a Swagger doc, and then turn the Swagger doc back into a full-blown server stub.
Stability
We have some endpoints that we document publically as being stable, and others that we consider unstable. The stable endpoints are documented in api.json, where all endpoints are available in post.json.
To stabilize an endpoint, add the stable tag to its route comment:
// swagger:route GET /api/provisioning/contact-points provisioning stable RouteGetContactpoints