Commit Graph

3245 Commits

Author SHA1 Message Date
George Robinson
6cccbb5a09
Fix incorrect metric values for scheduler_behind_seconds (#45830) 2022-02-25 11:40:30 +00:00
J Guerreiro
14ec0cbd3b
Service Accounts: Polish service account detail page (#45846)
* ServiceAccounts: add teams to service account DTO

* ServiceAccounts: Add team display to service accounts

* ServiceAccounts: add AC metadata to detail route

* ServiceAccounts: add role picker to detail page

* ServiceAccounts: Add role to profile DTO

* ServiceAccounts: remove wip mention of created by
2022-02-25 11:33:34 +01:00
idafurjes
2334b98802
Use PluginSettingsService instead of SQLStore methods in plugins (#45480)
* Use PluginSettingsService instead of SQLStore in plugins

* Fix pluginproxy use of pluginsettings methods

* Fix additional pluginsettings methods

* Remove dispatch from plugindashboards

* Fix lint and adjust mock

* Remove unused pluginsettings

* Rename pluginsetting Service and ServiceImpl and add binding to wire

* Move pluginsettings binding in wire file
2022-02-25 11:29:18 +01:00
George Robinson
2ca79ca0c7
Rename evalCtx to avoid confusion with context.Context (#45144) 2022-02-25 11:09:20 +01:00
George Robinson
feae959c9d
Alerting: Create annotation if Firing alert is removed (#45703)
This commit changes staleResultsHandler to create an annotation if the current state is Alerting and the result is being removed from the state cache as it has not been updated since 2x the evaluation interval.
2022-02-24 16:25:28 +00:00
Artur Wierzbicki
9e32357e69
Previews: increase crawler timeout (#45848) 2022-02-24 20:17:05 +04:00
George Robinson
8d57318941
Alerting: Use expanded labels in dashboard annotations (#45726) 2022-02-24 10:58:54 +00:00
Nathan Rodman
f9701d78b1
Alerting: add field for custom slack endpoint (#45751)
* add field for custom slack endpoint

* add test for using custom endpoint

* Update pkg/services/ngalert/notifier/channels/slack.go

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>

* specify description for endpoint

* remove brittle string constants

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2022-02-23 14:33:23 -08:00
Yuriy Tseretyan
f75bea481d
Alerting: validate rules and calculate changes in API controller (#45072)
* Update API controller
   - add validation of rules API model
   - add function to calculate changes between the submitted alerts and existing alerts
   - update RoutePostNameRulesConfig to validate input models, calculate changes and apply in a transaction

* Update DBStore
   - delete unused storage method. All the logic is moved upstream.
   - upsert to not modify fields of new by values from the existing alert
   - if rule has UID do not try to pull it from db. (it is done upstream)

* Add rule generator
2022-02-23 11:30:04 -05:00
Ivana Huckova
a3a852be81
Query history: Create API to star and unstar query in query history (#45077)
* Query history: Add starring and unstarring API

* Return dto with starred info when commenting

* Add documentation for starring and unstarring of query

* Return dto when starring/unstarring

* Update documentation

* Update deleting with unstarring

* Check queryUID length in queryhistory

* Fix linting issues

* Update docs/sources/http_api/query_history.md

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2022-02-23 17:03:04 +01:00
Sofia Papagiannaki
3cfbbbdbf2
Skip flaky test (#45785) 2022-02-23 16:56:21 +01:00
Serge Zaitsev
c1239ee67c
Chore: Remove bus from authinfoservice (#45787) 2022-02-23 16:22:16 +01:00
Joan López de la Franca Beltran
e6a85826e9
Encryption: Refine secrets-related commands (#45201)
* CLI: Adjust 're-encrypt-data-keys' command

* CLI: Adjust 're-encrypt' command

* Multiple improvements on re-encrypt secrets migration

* Another bunch of code improvements

* Lint fixes
2022-02-23 16:04:53 +01:00
Sofia Papagiannaki
5a1d8cbea7
Search: fix PostgreSQL query (#45305)
* Search: fix PostgreSQL query

* Apply suggestion from code review
2022-02-23 04:36:37 -08:00
Serge Zaitsev
a231c6861c
Chore: Remove bus.Dispatch from provisioning services (#44989)
* make getordbyname a method

* remove one dispatch from plugins provisioner

* remove bus from the plugins provisioner, skip test for now

* remove bus from datasource provisioning

* resolve tests in notifier provisioning

* remove bus from the dashboards provisioning service

* fix missing struct field

* fix getorgbyid method calls

* pass org store into dashboard provisioner

* fix test function prototype

* fix tests

* attempt to fix tests after the rebase

* fix integration test

* avoid using transaction

* remove comments
2022-02-23 11:12:37 +01:00
J Guerreiro
e201b777c2
Service Accounts: small typo and dto fixes (#45677)
* ServiceAccounts: respect js casing and small fixes to displayed values

* ServiceAccounts: fix typos on service account

* ServiceAccounts: fix missing orgID in service account

* ServiceAccounts: Small fixes to dtos for profile

* ServiceAccounts: use result org id

* ServiceAccounts: return value is always nil
2022-02-22 14:58:42 +01:00
Alexander Emelin
28c30a34ad
Comments: support live comments in dashboards and annotations (#44980) 2022-02-22 10:47:42 +03:00
Ryan McKinley
024194dccd
Search: add URL as linkable field (#45568) 2022-02-18 16:03:49 -08:00
Artur Wierzbicki
c04b0179ff
Previews: prevent scheduler from running when image renderer is outdated (#45623)
* #44449: prevent crawler from running when rendering service is outdated

* #44449: simplify
2022-02-18 21:29:18 +04:00
Artur Wierzbicki
7643ae6c5e
Rendering: periodically refresh remote plugin version (#45505)
* #44449: refresh image renderer version on a schedule

* #44449: simplify
2022-02-18 20:25:01 +04:00
Yuriy Tseretyan
e44ea3d589
Alerting: Rename setting AlertForDuration to DefaultRuleEvaluationInterval (#45569)
* fix AlertForDuration to DefaultRuleEvaluationInterval

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2022-02-18 10:05:06 -05:00
J Guerreiro
0ec21a4ed6
Service accounts: make is_service_account nullable (#45541)
* add base nullable migration to is_service_account

Co-authored-by: Jeremy Price <jeremy.price@grafana.com>

* fix postgres migration

* ServiceAccounts: ensure SA is set to false when creating a user

Co-authored-by: Jeremy Price <jeremy.price@grafana.com>
2022-02-18 13:08:00 +01:00
Gabriel MABILLE
fc514738b2
Chore: fix comment (#45593) 2022-02-18 11:46:52 +01:00
Eric Leijonmarck
c6943797f9
Admin: token expiration colors and calculations (#45231)
* token expiration colorign and calculations

* Update public/app/features/serviceaccounts/ServiceAccountTokensTable.tsx

* removed unused calculation for expiry

* optional attribute

* fix: typo

* implement failing test :thumpsup:

* tests

* refactor: tests to use assertify

* tiem

* refactor: remote porntf

* refactor: make test NOT sleep 1 sec for all builds :D

Co-authored-by: J Guerreiro <joao.guerreiro@grafana.com>
2022-02-18 11:43:33 +01:00
Gabriel MABILLE
14bee49f9a
AccessControl: Compute metadata from context permissions (#45578)
* AccessControl: Compute metadata from context permissions

* Remove nil

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Check user permissions are set

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
2022-02-18 11:27:00 +01:00
Kat Yang
0eb37c08bd
Chore: Add sqlstore dashboard methods to store and mockstore (#45567) 2022-02-18 09:37:49 +01:00
Santiago
a9de33601c
make send_alerts_to field nullable (#45572)
* make send_alerts_to field nullable

* set nullable to true since we have a default value
2022-02-18 01:45:34 -03:00
Karl Persson
f42c830b3c
Inject dashboard provisioning service instead of store (#45533) 2022-02-17 17:18:19 +01:00
Kat Yang
d3ae8939af
Chore: Remove x from health, alert notification, dashboard, stats, user (#45265)
* Chore: Remove x from health

* Chore: Remove x from dashboard and user

* Chore: Remove x from alert notification

* Chore: Remove x from stats

* Fix: Update func signature in stats test

* Refactor: Remove x from GetDashboardTags

* Chore: Remove x from dashboard

* Chore: Remove x from Stats

* Fix: Update refs of HasAdminPermissionInFolders

* Fix: Adjust funcs in tests to be sqlStore methods

* Fix: Fix database folder test sqlstore methods
2022-02-17 16:59:09 +01:00
Sofia Papagiannaki
17dee4700c
SQLStore: Fix migrator locking test for SQLite (#45523)
* SQLStore: Fix migrator locking test for SQLite
2022-02-17 16:12:44 +02:00
J Guerreiro
42d21e1af5
ServiceAccounts: Use http library for status codes (#45525) 2022-02-17 15:00:56 +01:00
Gabriel MABILLE
47e248ceab
AccessControl: Remove permissions on data source delete (#45504)
* AccessControl: Remove permissions on datasource delete

* Ensure legacy behavior is preserved
2022-02-17 14:06:34 +01:00
Karl Persson
cdc08105c2
Access control: Set default permissions for data sources when using access control (#45482)
* Rename interfaces and use then with wire injection

* Set default permissions when creating new data source
2022-02-17 14:03:45 +01:00
J Guerreiro
8afd5d54f7
Service Account detailed edit (#45404)
* ServiceAccounts: Update service account route

* ServiceAccounts: Update service account tests

* ServiceAccounts: remove extraneous file
2022-02-17 12:19:58 +00:00
Artur Wierzbicki
3e53a08090
#44449: hide dashboard preview admin UI (#45493) 2022-02-17 12:34:07 +04:00
ying-jeanne
10b47480eb
add dashboardsnap as service of http server (#45461) 2022-02-17 09:31:26 +01:00
Artur Wierzbicki
6c76aa71e8
Previews: capability check (#44601)
* add SQL migrations

* dashboard previews from sql: poc

* added todos

* refactor: use the same enums where possible

* use useEffect, always return json

* added todo

* refactor + delete files after use

* refactor + fix manual thumbnail upload

* refactor: move all interactions with sqlStore to thumbnail repo

* refactor: remove file operations in thumb crawler/service

* refactor: fix dashboard_thumbs sql store

* refactor: extracted thumbnail fetching/updating to a hook

* refactor: store thumbnails in redux store

* refactor: store thumbnails in redux store

* refactor: private'd repo methods

* removed redux storage, saving images as blobs

* allow for configurable rendering timeouts

* added 1) query for dashboards with stale thumbnails, 2) command for marking thumbnails as stale

* use sql-based queue in crawler

* ui for marking thumbnails as stale

* replaced `stale` boolean prop with `state` enum

* introduce rendering session

* compilation errors

* fix crawler stop button

* rename thumbnail state frozen to locked

* #44449: fix merge conflicts

* #44449: remove thumb methods from `Store` interface

* #44449: clean filepath, defer file closing

* #44449: fix rendering.Theme cyclic import

* #44449: linting

* #44449: linting

* #44449: mutex'd crawlerStatus access

* #44449: added integration tests for `sqlstore.dashboard_thumbs`

* #44449: added comments to explain the `ThumbnailState` enum

* #44449: use os.ReadFile rather then os.Open

* #44449: always enable dashboardPreviews feature during integration tests

* #44449: add /previews/system-requirements API

* #44449: remove sleep time, adjust number of threads

* #44449: review fix: add `orgId` to `DashboardThumbnailMeta`

* #44449: review fix: automatic parsing of thumbnailState

* #44449: update returned json

* #44449: UI changes - dashboard previews sytem req check

* #44449: lint fixes

* #44449: fix tests

* #44449: typo

* #44449: fix getSystemRequirements API: return 200 even if we plugin version is invalid

* #44449: fix getSystemRequirements API: don't return SemverConstraint on error

* #44449: fix getSystemRequirements API

* #44449: fix previews sytem requirements text

* #44449: add `doThumbnailsExist` to repo

* #44449: remove redux api

* #44449: add missing model

* #44449: implement frontedsettings-driven capability check

* #44449: simplify

* #44449: revert test changes

* #44449: add dummy setup settings

* #44449: implicit typing over `FC<Props>`

* #44449: refactor conditionals

* #44449: replace `getText` with a react component

* #44449: fix component interface

* #44449: add onRemove to `PreviewsSystemRequirements` alert

* #44449: add bottom/top margin to previewSystemRequirements modal

* #44449: merge conflict fix

* #44449: remove console.log

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2022-02-16 21:49:50 +04:00
Ryan McKinley
1554bffcb8
Search: apply security in before returning results (#45430)
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
2022-02-16 09:47:41 -08:00
Selene
d5b98772ed
Dashboards: Refactor service to make it injectable by wire (#44588)
* Add providers to folder and dashboard services

* Refactor folder and dashboard services

* Move store implementation to its own file due wire cannot allow us to cast to SQLStore

* Add store in some places and more missing dependencies

* Bad merge fix

* Remove old functions from tests and few fixes

* Fix provisioning

* Remove store from http server and some test fixes

* Test fixes

* Fix dashboard and folder tests

* Fix library tests

* Fix provisioning tests

* Fix plugins manager tests

* Fix alert and org users tests

* Refactor service package and more test fixes

* Fix dashboard_test tets

* Fix api tests

* Some lint fixes

* Fix lint

* More lint :/

* Move dashboard integration tests to dashboards service and fix dependencies

* Lint + tests

* More integration tests fixes

* Lint

* Lint again

* Fix tests again and again anda again

* Update searchstore_test

* Fix goimports

* More go imports

* More imports fixes

* Fix lint

* Move UnprovisionDashboard function into dashboard service and remove bus

* Use search service instead of bus

* Fix test

* Fix go imports

* Use nil in tests
2022-02-16 14:15:44 +01:00
Sofia Papagiannaki
6a38ce2307
Resolve depedency cycle (#45427) 2022-02-16 10:59:34 +02:00
Yuriy Tseretyan
02f8e99ca1
Alerting: move fake stores to store package (#45428)
* make fake storage public
* move fake storages to store package
2022-02-15 17:24:39 -05:00
Ryan McKinley
d665306ad1
Search: add feature flag and basic service (#45112)
Co-authored-by: Artur Wierzbicki <artur@arturwierzbicki.com>
2022-02-15 10:26:03 -08:00
Ieva
11433cba97
Team access changes for editors when editorsCanAdmin is enabled (#45405)
* filter teams for editors to only show the teams that they are members of

* frontend changes to only allow clicking on teams that the user can edit

* update frontend test snapshots

* extend docs

* reword

* remove the comment for now

* Update backend tests

* reword the warning, and add it back in

* docs feedback

Co-authored-by: gamab <gabi.mabs@gmail.com>
2022-02-15 17:09:03 +00:00
Sofia Papagiannaki
d718ee1918
SQLStore: Prevent concurrent migrations (#44101)
* SQLStore: Prevent concurrent migrations

* Hide behind a feature toggle

* Configurable locking attempt timeout

* Update docs/sources/administration/configuration.md

Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-02-15 18:54:27 +02:00
Ivana Huckova
636a45f065
Query history: Create API to patch comment of query in query history (#44981)
* Query history: Patch comment

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Remove redundant check

* Use WithTransactionalDbSession to update comment

* Fix status code in test

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-02-15 15:43:17 +01:00
Serge Zaitsev
b9e5bae51f
Chore: Remove bus.Dispatch from cleanup service (#45401) 2022-02-15 14:56:19 +01:00
Gábor Farkas
a612087c63
loki: remove fullRangeLogsVolume feature flag (#45286) 2022-02-15 09:05:03 +01:00
Yuriy Tseretyan
095ea44e97
Alerting: Move BaseInterval and MinInterval to UnifiedAlerting config (#45107)
* use base interval if legacy value is less than the base interval
2022-02-11 16:13:49 -05:00
Ezequiel Victorero
4f815e3d8e
Access control: adding FGAC to annotation GET endpoints and fixed roles (#45102)
* Access control: adding FGAC to annotation GET endpoints and fixed roles

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2022-02-11 15:43:29 -03:00
Gabriel MABILLE
6fbf346747
AccessControl: Add endpoint to get user permissions (#45309)
* AccessControl: Add endpoint to get user permissions

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>

* Fix SA tests

* Linter is wrong :p

* Wait I was wrong

* Adding the route for teams:creator too

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2022-02-11 17:40:43 +01:00