Commit Graph
739 Commits
Author SHA1 Message Date
Ryan McKinley ebeb0c67be merge main 2025-02-13 17:17:46 +03:00
Ryan McKinley 06de4c0041 Provisioning: legacy → git → unified (#100481) 2025-02-13 17:13:32 +03:00
Mariell Hoversholm 45a586c725 feat: regen openapi 2025-02-13 13:25:21 +01:00
Tito Lins ae9837b793 Alerting: Add alertmanager integration tests (#100106) 2025-02-13 11:36:45 +01:00
Ryan McKinley f2911bdebb Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-02-13 09:45:28 +03:00
Sergej-Vlasov d1dee968c3 Schema V2: Adjust quick_ranges in time settings and remove time_options (#100135)
* adjut quickRanges type in v2

* clean up unused time_options property

* remove deprecated time_options property on time picker

* add schema migration for time_options

* adjust test
2025-02-12 19:23:09 +00:00
Alex KhomenkoandRyan McKinley ecca6d32af POC/Provisioning: Combine owner/repo into URL field (#100397)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-02-11 16:34:57 +03:00
Clarity-89 da4b2e1534 Merge branch 'main' into grafana-git-ui-sync
# Conflicts:
#	pkg/storage/unified/resource/go.sum
2025-02-11 07:33:55 +02:00
Moustafa Baiou 7dee4d1808 Alerting: Allow specifying uid for new rules added to groups (#99858)
When modifying rule groups the `uid` can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected.

This updates the RuleGroup provisioning apis to allow specifying the `uid` when creating/updating rule groups. 

Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group.

Context: https://github.com/grafana/terraform-provider-grafana/pull/1971#issuecomment-2599223897
Relates to: https://github.com/grafana/terraform-provider-grafana/issues/1928

Fixes: #98283
2025-02-10 10:28:34 -05:00
Roberto Jiménez SánchezandClarity-89 2a220b530d [Prototyping] Github Spec to allow push to main or force to use pull requests (#97001)
* Change to have workflows

* Update Frontend

* Run generation

* Add openapi file

* Revert unexpected changes

* Add enum

* Add description to workflows

* Add mapper function to please ESLint

* Remove pull request option

* Remove leftovers

* Configure sync interval in frontend

* Address most comments

* Regenerate client

* Fix compile issue

* Update WorkflowOption type

---------

Co-authored-by: Clarity-89 <homes89@ukr.net>
2025-02-10 15:23:49 +01:00
Ryan McKinley ea38dfcbdc Provisioning: Refactor export to simplify loading from legacy storage (#100335) 2025-02-10 14:21:14 +03:00
Sam Jewell 45775dd6ad Skip flakey test (#100251) 2025-02-10 07:40:32 +00:00
Ryan McKinley 24cfb93ef6 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-02-07 23:28:21 +03:00
Fayzal Ghantiwala 7ae8058c8b Alerting: Return 404 when /api/ruler/grafana/api/v1/rules/{Namespace}/{Groupname} does not exist (#100264)
* Return a 404 when rule group doesn't exist

* Update tests

* Update swagger doc and tests
2025-02-07 16:24:28 +00:00
Mariell Hoversholm bd261794b2 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-02-07 15:39:00 +01:00
Mariell Hoversholm dfaa12b800 Provisioning: Sync API with current feature branch (#100252)
* Provisioning: Jobs: Define repository name field

* Provisioning: Jobs: Separate options per job type

* Provisioning: Define a sanitised settings resource

* Provisioning: Jobs: Define a job summary

* Provisioning: Remove linting

* Provisioning: Update docs for a few fields

* Provisioning: Remove HelloWorld

* Provisioning: Replace Repository with Message in job info

* Provisioning: Remove YAML support

* Provisioning: Remove custom folder specification

* Provisioning: Support read-only repositories

* Provisioning: Remove edit options

* Provisioning: Add sync options for repositories

* Provisioning: Add resource statistics

* Provisioning: Make slices atomic lists

* Provisioning: Message list needs to exist even if empty

If we don't do this, we can't clear the messages field, leading to buggy UX.

* Provisioning: Support incremental syncing

* Provisioning: Remove the 'items' subresource workaround

* Provisioning: Add resource list

* Provisioning: Reformat

* Provisioning: Declare new types

* OpenAPI: Generate openapi JSON spec from generated code

* Codegen: Generate OpenAPI spec

* Provisioning: Support generating frontend API

* Codegen: Generate Go code

* Provisioning: Define the base API

* Codegen: Generate frontend endpoints for provisioning

* Refactor: yarn prettier:write

* Provisioning: Tiger team takes ownership

* Chore: Remove dir we haven't added yet

* Provisioning: Remove frontend

* Test: Update example repositories
2025-02-07 15:35:55 +01:00
Mariell Hoversholm 4d732cb005 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-02-07 14:14:54 +01:00
Mariell Hoversholm e815a2850e Provisioning: Integration test that Repository resources work (#100197)
* Provisioning: Set up server in practice

* Provisioning: Integration test that Repository resources work
2025-02-07 12:04:58 +01:00
Ryan McKinleyandRoberto Jiménez Sánchez 13b607875b POC/Provisioning/Syncer: keep progress while running a sync job (#100017)
* same replicate

* with feedback

* one pass

* so close... but delete error

* fix api

* keep hash

* incremental works

* cleanup

* cleanup

* UID cleanup

* err style

* split the two changes

* openapi

* fix timestamps

* sort deletes first

* changes

* make sure to keep folders

* cleanup

* cleanup

* tested complete

* incremental

* Update pkg/apis/provisioning/v0alpha1/jobs.go

Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>

* incremental

* complete

* lint fix

* use constant

* Update pkg/registry/apis/provisioning/jobs/syncer.go

Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>

* Update pkg/registry/apis/provisioning/jobs/syncer.go

* use currentRef

---------

Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>
2025-02-07 09:23:07 +01:00
Clarity-89 4dfaebc5f3 Update codegen 2025-02-07 08:08:11 +02:00
Clarity-89 8d041bb8ba Merge branch 'main' into grafana-git-ui-sync
# Conflicts:
#	.betterer.results
#	public/app/core/components/NestedFolderPicker/NestedFolderPicker.tsx
2025-02-06 08:04:13 +02:00
Yuri Tseretyan f7d476e408 Alerting: Remove id and org_id from grafana alert rule API model (#100139) 2025-02-05 23:13:22 +02:00
Todd Treece 69e4d8468b Dashboard: Add v1alpha1 test coverage (#100149) 2025-02-05 23:01:51 +02:00
Ryan McKinley e1f075bdde Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-02-04 12:42:22 +03:00
Ryan McKinleyandClarity-89 ca3db84d99 POC/Provisioning: Use RepositoryViewList for /settings endpoing (#99978)
* frontend settings as list

* frontend settings as list

* remove weird comment

* remove metadata

* lint

* Add hooks back

---------

Co-authored-by: Clarity-89 <homes89@ukr.net>
2025-02-04 07:53:11 +02:00
Yuri Tseretyan ac41c19350 Alerting: Rule version history API (#99041)
* implement store method to read rule versions

* implement request handler

* declare a new endpoint

* fix fake to return correct response

* add tests

* add integration tests

* rename history to versions

* apply diff from swagger CI step

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-02-03 13:26:18 -05:00
Clarity-89 e995715bb9 Merge branch 'main' into grafana-git-ui-sync
# Conflicts:
#	public/app/core/reducers/root.ts
#	scripts/generate-rtk-apis.ts
2025-02-03 17:48:23 +02:00
Ashley HarrisonandRyan McKinley e0151528a4 API client generation: Update iam client (#99963)
* update generated iam client

* update API

* with meta api

* regenerate client

* with identify ref

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-02-03 13:40:36 +00:00
Mariell Hoversholm 8109fd0226 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-02-03 13:18:25 +01:00
Ryan McKinley b636b81b16 K8s/IAM: Use raw handler for display (not rest.Connector) (#99898) 2025-02-03 14:24:35 +03:00
Ryan McKinley 344ba34409 Provisioning: Fix missing openapi (#99951) 2025-02-03 13:14:04 +03:00
Ryan McKinley b70219b345 update config form+better 2025-02-03 00:10:38 +03:00
Ashley Harrison 9693212475 API client generation: Create new IAM api client and use in query library (#99888)
* create new generated iam api client and use in query library

* update betterer

* use new createBaseQuery method

* update CODEOWNERS

* fix unit tests

* use shared type

* update comment

* fix test
2025-01-31 17:12:55 +00:00
Ryan McKinley b8da28d7fd Provisioning: Export with write (#99853) 2025-01-31 16:16:12 +03:00
Ryan McKinley 966bb8a1e4 POC/Provisioning: Expose repositories without the full configuration details (#99791) 2025-01-31 10:43:14 +03:00
Ryan McKinley f5ef63bcec POC/Provisioning: Replace EditingOptions with a readOnly flag (#99859) 2025-01-31 10:07:33 +03:00
Ryan McKinley edef4d1426 remove watch from openapi 2025-01-30 21:05:06 +03:00
Ryan McKinley 861939f395 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-01-30 21:00:36 +03:00
Ryan McKinley 9e14a5b046 Provisioning: Move sync options to a special section of the spec (#99691)
* sync options

* working ish

* move folder property

* more tests

* create at the beginning of sync

* error rather than update meta

* only one target root

* update comment/kick CI

* with admission controller

* with UI updaates

* few fixes

* use repo name

* use radio group

* use radio group

* use radio group

* more fixes
2025-01-30 15:24:19 +01:00
Ryan McKinley 9d5af95565 K8s/OpenAPI: Remove /watch/ from the openapi spec (#99793) 2025-01-30 12:51:55 +03:00
Mariell Hoversholm 69027482b7 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-01-30 08:35:14 +01:00
Ryan McKinley 3c0383f0d5 K8s/Test: Allow setting license path in test helper (#99786) 2025-01-30 08:59:00 +02:00
Moustafa Baiou b820fd6bef Alerting: Fix Alertmanager configuration updates (#99610)
* Alerting: Fix Alertmanager configuration updates

Alertmanager configuration updates would behave inconsistently when performing no-op updates with `mysql` as the store.

In particular this bug manifested as a failure to reload the provisioned alertmanager configuration components with no changes to the configuration itself. This would result in a 500 error with mysql store only.

The core issue is that we were relying on the number of rows affected by the update query to determine if the configuration was found in the db or not.
While this behavior works for certain sql dialects, mysql does not return the number of rows matched by the update query but rather the number of rows actually updated.

Also discovered and fixed the mismatched `xorm` tag for the `CreatedAt` field to match the actual column name in the db.

References: https://dev.mysql.com/doc/refman/8.4/en/update.html
2025-01-29 23:00:45 +02:00
Ryan McKinley eccd8e5638 merge main 2025-01-29 23:49:57 +03:00
Ryan McKinley 931daf0121 Provisioning: Rename JobOptions (#99771) 2025-01-29 21:20:38 +03:00
Alex KhomenkoandRyan McKinley 9f4e8ee206 Query Library: Update API client (#99382)
* Add process script

* Working version

* Use new types

* Use new types

* Update client

* Tweaks

* Process multiple specs

* Remove 'any' types

* Use BASE_URL

* Update CODEOWNERS

* Fix filename

* add openapi

* update CODEOWNDER

* use JSONeq

* Use existing specs

* Filter ForAllNamespaces

* Add instructions

* Switch to tsx

* Use openapi-types

* Update src path

* Expand docs

* Update docs

* Rename script

* codeowners

* More docs

* Move openapi-types to dev deps

* Update error message

* Update doc

* Fix typo

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-01-29 18:05:40 +02:00
Ryan McKinley 0fece88980 Provisioning: Support finalizers in our controller (#99532) 2025-01-29 18:22:10 +03:00
Mariell Hoversholm cd2ad22c06 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2025-01-29 09:33:02 +01:00
Mariell Hoversholm 74edadb379 Provisioning: Remove linting option (#99630)
* feat: remove linting option

* feat: drop linting from spec

* chore: regen code

* feat: remove linting spec option from apiserver

* chore: regen code

* test: update examples for removing the lint option
2025-01-29 09:20:10 +01:00
Ryan McKinley 8415059290 K8s/OpenAPI: Move openapi snapshots out of the root (#99728) 2025-01-29 09:26:17 +02:00