Commit Graph

3712 Commits

Author SHA1 Message Date
idafurjes
e9f8d582c8
Chore: Remove dashboard version from models (#50287)
* Remove dashbpard version from models

* Fix lint

* Fix api & sqlstore tests

* Remove integration tags

* Fix lint again

* Add integration test to correct namespace

* Lont fix 2

* Change Id to ID in dashVersionMeta
2022-06-08 12:22:55 +02:00
idafurjes
a938ae1d9e
Chore: Remove integration tag (#50395) 2022-06-08 12:17:03 +02:00
Gábor Farkas
50145e1617
Loki: remove frontend mode code (#50185)
* feature-flag removed

* loki: remove frontend-mode
2022-06-08 08:14:34 +02:00
Jean-Philippe Quéméner
fd664e4beb
Alerting: replace a duplicated configuration key (#50350)
This PR renames the configuration key enabled to capture. This is needed as we already have a configuration key with the name enabled.

Fixes #50328

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
2022-06-08 11:04:51 +08:00
Alexander Weaver
28a47b56d2
Bump provisioning to admin-only in lieu of dedicated RBAC permissions (#50366) 2022-06-07 17:26:48 -05:00
gotjosh
0cde283505
Alerting: Logs should not be capitalized and the errors key should be "err" (#50333)
* Alerting: decapitalize log lines and use "err" as the key for errors

Found using (logger|log).(Warn|Debug|Info|Error)\([A-Z] and (logger|log).(Warn|Debug|Info|Error)\(.+"error"
2022-06-07 19:54:23 +02:00
George Robinson
c83f84348c
Alerting: Fix database unavailable removes rules from scheduler (#49874) 2022-06-07 16:20:06 +01:00
Dan Cech
9350ab781c
clean up duplicated user creation code (#50178)
* clean up duplicated user creation code

* remove unused duplicate getOrCreateOrg function

* fix up tests
2022-06-07 09:49:18 -04:00
Karl Persson
9fd9a2cded
RBAC: Remove workaround to check permissions on folders for dashboard actions (#50291)
* remove workaround to check permissions on folders for dashboard actions
2022-06-07 13:21:56 +02:00
Karl Persson
c4a75f9eb3
RBAC: Add scope resolvers for dashboards (#50110)
* Inject access control into dashboard service

* Add function to parse id scopes

* Add dashboard as return value

* Update mock

* Return only err to keep service interface

* Add scope resolvers for dashboard id scopes

* Add function to parse uid scopes

* Add dashboard uid scope resolver

* Register scope resolvers for dashboards

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2022-06-07 11:02:20 +02:00
sam boyer
8876d56495
schema: Migrate from scuemata to thema (#49805)
* Remove crufty scuemata bits

Buhbye to: cue/ dir with old definitions, CI steps for checking unnecessary
things, and the original dashboard scuemata file.

* Remove grafana-cli cue subcommand

* Remove old testdata

* Don't swallow errors from codegen

* Small nits and tweaks to cuectx package

* WIP - refactor pluggen to use Thema

Also consolidate the embed.FS in the repo root.

* Finish halfway rename

* Convert all panel models.cue to thema

* Rewrite pluggen to use Thema

* Remove pkg/schema, and trim command

* Remove schemaloader service and usages

Will be replaced by coremodel-centric hydrate/dehydrate system Soon™.

* Remove schemaloader from wire

* Remove hangover field on histogram models.cue

* Fix lint errors, some vestiges of trim service

* Remove unused cuetsify cli command
2022-06-06 17:52:44 -07:00
Kat Yang
31630edf0c
Chore: Remove Wrapf (#50128)
* Chore: Remove Wrapf

* Remove all Wrapf refs

* Remove last Wrapf ref

* Fix lint errors

* Remove Wrap and Wrapf definitions

* Remove unnecessary colon
2022-06-06 22:30:31 +02:00
Ieva
7c800421d3
RBAC: change migration logic (#50187)
* change migration logic

* linting

* linting

* fix an issue with the migration logic

* make tests runnable against other DBs

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-06-06 13:51:07 +02:00
Alexander Emelin
da49f907bb
SearchV2: explicit dashboard loading order and cleanups (#50210) 2022-06-05 23:46:35 +02:00
Jean-Philippe Quéméner
4b8a4449ed
Alerting: remove feature toggle for provisioning API (#50167)
* Alerting: remove feature toggle for provisioning API

* remove missed code parts

* remove unused import

* remove empty line

* mark routes as stable
2022-06-05 07:45:36 +02:00
Jean-Philippe Quéméner
4cc8c6f745
Alerting: Add provenance guard to config api (#50147)
* Alerting: add provenance guard to config api

* add tests

* only guard if config valid

* adapt error message

* simplify logic

* rename arguments

* make logic more straight forward

* rename opt to options

* remove useless maps
2022-06-04 14:55:46 +02:00
Tania
4f8111e24e
Encryption: Fix multiple data keys migration (#49848)
* Add migration

* Migrator: Extend support to rename columns

* Fix getting current key

* Fix column name in migration

* Fix deks reencryption

* Fix caching

* Add back separate caches for byName and byPrefix

* Do not concatenate prefix with uid

* Rename DataKey struc fields

* SQLStore: Add deprecation comments for breaking migrations

* Add comment

* Minor corrections

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
2022-06-04 12:55:49 +02:00
Jean-Philippe Quéméner
8de4ffe61f
Alerting: only delete mute time if not used by route (#50193)
* Alerting: only delete mute time if not used by route

* add a testcase

* import package only once

* replace apimodels with definitions
2022-06-04 07:48:24 +02:00
Joan López de la Franca Beltran
219e848e73
SQLStore: Prevent migration_id duplicates (#47774)
* SQLStore: Prevent migration_id duplicates

* Migrations: Remove non-executed migration (duplicated id)

Co-authored-by: Leonard Gram <leo@xlson.com>
2022-06-04 01:59:49 +02:00
Alexander Emelin
d2868a1ce7
SearchV2: instant local updates, folder events (#50001) 2022-06-03 13:11:32 -07:00
Yuriy Tseretyan
49d93fb67e
Alerting: Update alert rule diff to not see difference between nil and empty map (#50192) 2022-06-03 21:27:29 +02:00
Jean-Philippe Quéméner
d2f3631a47
Alerting: add mute timings provenance to config api (#50149) 2022-06-03 19:32:31 +02:00
Joan López de la Franca Beltran
5f1305d280
SQLStore: Add deprecation comments for breaking migrations (#49740)
* Migrator: Extend support to rename columns

* SQLStore: Add deprecation comments for breaking migrations
2022-06-03 17:42:08 +02:00
Marcus Efraimsson
36c3398c6d
Datasource: Remove support for unencrypted passwords (#49987)
* Datasource: Remove support for unencrypted passwords

* regenerate swagger

* [WIP] Remove references to datasource password and basic auth password fields (#50015)

* try delete moar tings

* delete provisioning stuff

* remove from yaml

* update snapshots

* remove lingering snapshot fields

* fix ds http settings

* Re-generate swagger and fix swagger-api-spec make target

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2022-06-03 17:38:22 +02:00
Tania
7a614fd8a1
Encryption: Stop decrypting EE encrypted secrets with legacy encryption (#50090) 2022-06-03 17:06:00 +02:00
Yuriy Tseretyan
c85567f490
fix logging of resolving scopes (#50173) 2022-06-03 10:53:53 -04:00
Alexander Weaver
67290aa49f
Alerting: Add version segment to all provisioning routes (#49121)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2022-06-03 16:45:08 +02:00
Gilles De Mey
e6ceee501f
Alerting: Use correct permission scope for external AM updates (#50159)
Co-authored-by: konrad147 <konrad.lalik@grafana.com>
2022-06-03 15:12:34 +02:00
Todd Treece
64d93498de
Chore: Update grafana-plugin-sdk-go to v0.136.0 (#50127) 2022-06-03 08:25:52 -04:00
Jean-Philippe Quéméner
468ed68d64
Alerting: allow custom UID for contact points through API (#50089)
* Alerting: allow custom UID for contact points through API

* fix auth
2022-06-03 10:33:47 +02:00
Kat Yang
3c3039f5b3
Chore: Remove Wrap (#50048)
* Chore: Remove Wrap and Wrapf

* Fix: Add error check
2022-06-03 09:24:24 +02:00
Jeff Levin
52ed651958
public dashboards: insert default public dashboard config into database on save (#49131)
This PR adds endpoints for saving and retrieving a public dashboard configuration and and api endpoint to retrieve the public dashboard.

All of this is highly experimental and APIs will change. Notably, we will be removing isPublic from the dashboard model and moving it over to the public dashboard table in the next release.

Further context can be found here: https://github.com/grafana/grafana/pull/49131#issuecomment-1145456952
2022-06-02 18:27:23 -08:00
Ryan McKinley
efca93a3f3
Search: exclude rows from search index (#50124) 2022-06-02 17:29:14 -07:00
Ryan McKinley
d452322aa8
Search (SQL): support dashboardUID query parameter (#50121) 2022-06-02 12:56:01 -07:00
Kat Yang
bc8578524b
Chore: Remove last build tag (#50120) 2022-06-02 17:36:34 +00:00
Ryan McKinley
15b3bbad6b
SearchV2: include appSubUrl in the response URL (#50059) 2022-06-02 17:56:20 +02:00
Karl Persson
896a101f48
RBAC: Extract method from access control impl to a function in domain packge (#49947)
* Remove GetUserBuiltInRoles and create it as a util function in
accesscontrol domain package
2022-06-02 16:10:41 +02:00
Kristin Laemmert
0e991461b0
backend/sqlstore: move GetDashboardTags to dashboard service (#50091)
+ removing some functions that were already copied to the dashboard service in a previous pr.
2022-06-02 10:00:47 -04:00
idafurjes
bdf50f3dd2
Dashboards: Split GetDashboardVersions method (#49967)
* Split GetDashboarVersions method

* Add sqlstore dialect and tests

* Fix signature of PAtchPreference

* Add GetDialect to sqlstore and remove GetDashboardVersions

* Add GetDialect to db interface

* Implement List

* add deleted test function

* Remove GetDialect from sqlstore interface

* Remove deleted method from mock

* Refactor test
2022-06-02 15:59:05 +02:00
Jean-Philippe Quéméner
81d360529b
Alerting: Provisioning API - Alert rules (#47930) 2022-06-02 14:48:53 +02:00
Ieva
5dbea9996b
RBAC: Make RBAC action names more consistent (#49730)
* update action names

* correctly retrieve teams for signed in user

* remove test

* undo swagger changes

* undo swagger changes pt2

* add migration from old action names to the new ones

* rename from list to read

* linting

* also update alertign actions

* fix migration
2022-06-02 13:14:48 +01:00
Joe Blubaugh
9759eeda17
Alerting: Remove Image Upload code from Slack notifier. (#50062)
The image file upload code as it is now simply doesn't work - it's
missing several important steps in the file upload process. There is
more information in the fixed issue as to the steps required.

After this change, screenshots will still be attached to slack messages
when external image storage is used with Grafana (an S3 bucket, for
example).

Fixes #50056
2022-06-02 17:18:35 +08:00
gotjosh
1a50b0dbb7
Alerting: Remove double quotes from matchers (#50038)
* Alerting: Remove double quotes from matchers

With #38629 a new Alertmanager configuration object was introduced with `object_matchers`, it was meant to circumvent around the fact that Prometheus label names don't support a set of characters that Grafana needs to support for alerts, silences, matchers, etc. (with a common example being elasticsearch's `.`).
This new object does not include the label of sanitzation or validation that its Prometheus equivalent supports in `matchers` and therefore are semantically not equivalent.

This triggered the problem that when the migration is run, we use `matchers` as the object to populate in configuration for routing policies, but when the UI does its first save this object is transformed to `object_matchers`.

Matchers that were previously running just fine would immediately stop working as soon as the configuration is saved.

This problem surfaced with the introduction of #49952 where we stopped stripping double quotes from matchers (not just regex but _all_ of them).

* Add comment explaining rationale and future removal

Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
2022-06-01 16:05:24 -05:00
Kat Yang
c63ebc887b
Chore: Run integration tests without grabpl (#49448)
* Chore: Run integration tests without grabpl

* Add new step for integration tests in lib.star

* Remove old integration test step from lib.star

* Change drone signature

* Fix: Edit starlark integration step to not affect enterprise

* Remove all build tags & rename starlark integration test step

* Resync .drone.yml with .drone.star

* Fix lint errors

* Fix lint errors

* Fix lint errors

* Fix more lint errors

* Fix another lint error

* Rename integration test step

* Fix last lint error

* Recomment enterprise step

* Remove comment from Makefile

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2022-06-01 14:55:22 -04:00
Kristin Laemmert
2edfbb7767
sqlstore split: dashboard permissions (#49962)
* backend/sqlstore split: remove unused GetDashboardPermissionsForUser from sqlstore
* remove debugging line
* backend/sqlstore: move dashboard permission related functions to dashboard service
2022-06-01 14:16:26 -04:00
Connor Lindsey
3fff17af63
Tempo: Consider tempo search out of beta and remove beta badge and feature flags (#50030)
* Tempo: Remove beta notice and feature flag for search

* remove unused imports
2022-06-01 11:32:10 -06:00
Yuriy Tseretyan
c8d891785d
Alerting: Ticker to support stopping (#48142)
* add stop for ticker
* stop ticker when scheduler stops
* stop ticker when legacy engine stops
2022-06-01 17:48:10 +02:00
Yuriy Tseretyan
ad25e2a20c
Alerting: Update RBAC for alert rules to consider access to rule as access to group it belongs (#49033)
* update authz to exclude entire group if user does not have access to rule
* change rule update authz to not return changes because if user does not have access to any rule in group, they do not have access to the rule
* a new query that returns alerts in group by UID of alert that belongs to that group
* collect all affected groups during calculate changes
* update authorize to check access to groups
* update tests for calculateChanges to assert new fields
* add authorization tests
2022-06-01 10:23:54 -04:00
Guilherme Caulada
470be98588
Secrets: Fix unified secrets backwards compatibility (#49719)
* Fix unified secrets backwards compatibility

* Add compatibility fix to AddDataSource function

* Allow updating password on fail to decrypt secrets

* If unified secret is corrupt try migrating
2022-06-01 10:45:43 -03:00
Karl Persson
bdff63d4a8
RBAC: Include alert.rules action when setting folder permissions (#49946)
* Generate additional actions when setting folder permissions in acl list

* Add migration for managed folder permissions to include alert rule
actions
2022-06-01 15:29:37 +02:00