Commit Graph

110 Commits

Author SHA1 Message Date
Serge Zaitsev
faa1244518
Chore: Replace sqlstore with db interface (#85366)
* replace sqlstore with db interface in a few packages

* remove from stats

* remove sqlstore in admin test

* remove sqlstore from api plugin tests

* fix another createUser

* remove sqlstore in publicdashboards

* remove sqlstore from orgs

* clean up orguser test

* more clean up in sso

* clean up service accounts

* further cleanup

* more cleanup in accesscontrol

* last cleanup in accesscontrol

* clean up teams

* more removals

* split cfg from db in testenv

* few remaining fixes

* fix test with bus

* pass cfg for testing inside db as an option

* set query retries when no opts provided

* revert golden test data

* rebase and rollback
2024-04-04 15:04:47 +02:00
Ryan McKinley
3e86a4edc8
PanelTitleSearch: Show datasource usage in plugins (#83922) 2024-03-05 22:20:38 +02:00
김은빈
96dfb385ca
Grafana: Replace magic number with a constant variable in response status (#80132)
* Chore: Replace response status with const var

* Apply suggestions from code review

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

* Add net/http import

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-02-27 18:39:51 +02:00
Dan Cech
790e1feb93
Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db

* clean up test databases

* introduce testsuite helper

* use testsuite everywhere we use a test db

* update documentation

* improve error handling

* disable entity integration test until we can figure out locking error
2024-02-09 09:35:39 -05:00
idafurjes
cb419e799b
Remove folderid service test (#80433)
* Remove FolderID from service tests

* Add models

* Add folderID pack to publicdashboard tests

* Remove folderID from dashboard tests

* Remove folderID from folders

* Remove folderID from ngalert tests

* Remove nolint comment

* Add back some tests after rebase
2024-01-12 16:43:39 +01:00
Kat Yang
3a2e96b0db
Chore: Deprecate FolderID from Dashboard (#77823)
* Chore: Deprecate FolderID from Dashboard

* chore: add two missing nolint comments
2023-11-15 10:28:50 -05:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
Ryan McKinley
3509a5abb9
FeatureFlags: Cleanup usage of cfg.IsFeatureToggleEnabled (#78014) 2023-11-13 07:55:15 -08:00
Jo
dcd0c6b11e
Identity: Unfurl OrgID in pkg/services to allow using identity.Requester interface (#76113)
Unfurl OrgID in pkg/services to allow using identity.Requester interface
2023-10-09 10:40:19 +02:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Serge Zaitsev
bd12ce0cbc
Chore: capitalise log messages for app platform (#74336) 2023-09-04 18:46:08 +02:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
Ieva
6885b3d577
Chore: remove checks for whether RBAC is disabled (#73812)
* remove checks for whether access control is disabled, as it is always enabled now

* linting
2023-08-25 14:19:58 +01:00
Ieva
25c4292a5f
RBAC: search v1 permission filter part 1 - cleanup & updating tests (#71913)
* update tests and remove some AC disabled checks

* remove test for old permission filter builder
2023-07-19 10:37:27 +01:00
Carl Bergquist
692bb9ed1a
Instrumentation: Add support for instrumenting database queries (#66022)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-04-28 15:19:06 +02:00
Artur Wierzbicki
4274b9414f
Chore: remove querylibrary feature toggle (#65021)
* chore: remove querylibrary

* chore: remove querylibrary

* chore: remove querylibrary
2023-03-20 20:00:14 +04:00
Ryan McKinley
fcffedbbf9
Search: Include panel_type in query (#63229) 2023-03-01 11:13:09 -08:00
Kyle Brandt
52ed297ed5
Backend: Use latest plugin-sdk-go v0.149.1 (#63498)
Use latest github.com/grafana/grafana-plugin-sdk-go which includes changes to the TypeVersion property (always present in JSON).

Also included is squtil changes: SQL util - allow using the database scan type for converters
2023-02-21 09:06:15 -05:00
Ieva
49ccae7489
RBAC: cascaded nested folder permissions for search v2 (#62608)
* fetch inherited folder scopes for search v2

* fix error and don't fetch parents for the general folder

* remove feature toggle check and lower log level
2023-02-06 17:38:15 +00:00
Serge Zaitsev
907e2a840e
Chore: Fix goimports grouping (#62429)
* fix goimports ordering

* fix goimports order
2023-01-30 09:57:50 +01:00
Ieva
1865205d68
Benchmarks for searchv2 (#60730)
* bench-test

* cleanup

* more simplification

* fix tests

* correct wrong argument ordering & use constant

* fix issues with tests setup

* add benchmark results

* reuse Gabriel's concurrent setup code

* correct error logs for ac benchmarks
2023-01-27 15:42:08 +00:00
Karl Persson
c931b8031e
SearchV2: Set correct batch limit when loading dashboards (#62314)
SearchV2: Set correct limit
2023-01-27 14:40:04 +01:00
Ieva
eb9ef34272
RBAC: Permission check performance improvements for the new search (#60729)
* Add checker and update the resource filter function for new search

* Add tests for checker

* small fixes

* handle location for panels correctly

* clean up checker code and extend the tests for it

* more fixes, but tests don't quite work yet

* a small change to return error

* cleanup

* more simplification

* fix tests

* correct wrong argument ordering & use constant

* Apply suggestions from code review

Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>

* import

* check general folder from permission checker function

* handle root folder aka general folder properly

* update tests

* clean up

* lint

* add fix from main

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
2023-01-27 12:12:30 +00:00
idafurjes
6c5a573772
Chore: Move ReqContext to contexthandler service (#62102)
* Chore: Move ReqContext to contexthandler service

* Rename package to contextmodel

* Generate ngalert files

* Remove unused imports
2023-01-27 08:50:36 +01:00
Kristin Laemmert
e8b8a9e276
chore: move dashboard_acl models into dashboard service (#62151) 2023-01-26 08:46:30 -05:00
Ryan McKinley
46c828c2d8
EntityAPI: Rename references from kind to family (#62044) 2023-01-25 23:42:04 +00:00
Kristin Laemmert
dd147a3c31
chore: move entity models into entity store service (#62145) 2023-01-25 12:43:22 -05:00
Ryan McKinley
624e5dbed2
EntityAPI: Save nested summary info in the SQL database (#61732) 2023-01-21 00:00:17 +00:00
Denis Limarev
e6dee8a723
Perfomance: Preallocate slices (#61580) 2023-01-17 11:50:17 +00:00
Karl Persson
68b43a24e2
RBAC: dashboard permission filter (#60582)
* PermissionFilter: Handle all search type and only check one action for dashboards

* PermissionFilter: Still handle multiple action but take short cut when
only one action is required
2023-01-09 14:38:57 +01:00
Ryan McKinley
5dc7b01f9d
EntityStore: Rename ObjectStore to EntityStore (part 1) (#59613) 2022-11-30 13:42:42 -08:00
Artur Wierzbicki
eff5450ff1
Search: Revert "load dashboard performance improvements" (#58730)
Revert "Search: load dashboard performance improvements (#57509)"

This reverts commit 1df8a85a42.
2022-11-15 02:25:13 -05:00
Giuseppe Guerra
7996a1c8ad
Chore: Update grafana-plugin-sdk-go to v0.142.0 (#58115)
* Chore: Update grafana-plugin-sdk-go to v0.142.0

* Update tests and golden files for 207 status code

* Chore: Move update flag definition at the top in response_parser_test.go

* retrigger

Co-authored-by: Will Browne <will.browne@grafana.com>
2022-11-03 18:34:27 +01:00
Artur Wierzbicki
1df8a85a42
Search: load dashboard performance improvements (#57509)
* fix windows storage init

* fixxx

* close session asap

* fix span end

* error handling

* add comment

* simplify

* simplify

* fix limit

* pass readDashboardCtx to summary builder

* add string slice validation
2022-10-27 14:52:42 +08:00
Artur Wierzbicki
e485ddd13d
Store: don't marshall/unmarshall the dashboard when building a summary (#57520)
* dont pretty print the dashboard

* stop marshalling the dashboard

* do not sanitize for searchV2

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-10-25 09:39:17 +08:00
Kristin Laemmert
05709ce411
chore: remove sqlstore & mockstore dependencies from (most) packages (#57087)
* chore: add alias for InitTestDB and Session

Adds an alias for the sqlstore InitTestDB and Session, and updates tests using these to reduce dependencies on the sqlstore.Store.

* next pass of removing sqlstore imports
* last little bit
* remove mockstore where possible
2022-10-19 09:02:15 -04:00
Artur Wierzbicki
984ec00aac
Search: load dashboards optimization (#56933)
* search: load dashboards optimization

* search: load dashboards optimization

* search: close dashboard channel, return error when context is done

* search: refactor

* search: return err on ctx done

* search: remove sleep
2022-10-18 23:53:15 +08:00
Ryan McKinley
3b4b528993
Storage: Dashboard summary builder cleanup (#56665) 2022-10-13 09:29:19 -04:00
idafurjes
ef651daed2
Use org service instead of sqlstore (#56407)
* Use org service instead of sqlstore

* Remove methods from sqlstore

* Remove commented out code

* Fix lint

* Fix lint 2
2022-10-13 08:40:46 -04:00
Ryan McKinley
b24be6c0fc
ObjectStore: add a kind registry (#56507) 2022-10-08 12:05:46 -04:00
Nathan Marrs
ac91df0ea2
Canvas: Add demo dashboards (#56351)
Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-10-07 21:34:18 -04:00
Artur Wierzbicki
bf264d2f76
Query library: requiresDevMode dummy backend (#56466)
* query library - dummy backend

* fix tests

* dont explicitly marshall backend dataresponse

* skip integration tests

* null check for tests

* added query library to codeowners

* null check for tests

* lint
2022-10-07 11:31:45 -07:00
Ryan McKinley
97d19830cf
ObjectStore: rename modified to updated (#56420) 2022-10-05 14:58:46 -04:00
Kat Yang
7715672fb3
Chore: use org service methods (#55768)
* Chore: use org service methods

* fix tests

* fix errors

* adjust func signatures for getbyname

* 💩

* Use the same fake service to get the user in AC and in HS

* Fix middleware test

* Fix more middleware test

* Fix api tests

Co-authored-by: gamab <gabi.mabs@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2022-10-04 14:48:02 -04:00
Ryan McKinley
385ebea540
Devenv: move timeseries dashboards to a timeseries folder (#56131) 2022-09-30 13:10:20 -07:00
Ryan McKinley
268a49cb38
Devenv: add dashboard showing timeseries out of range points (#56130) 2022-09-30 15:47:23 -04:00
Ryan McKinley
e7e7763252
Store/Search: Explore a general interface to extract summary data from a blob (#55598) 2022-09-27 18:08:47 -04:00
Artur Wierzbicki
814211282a
Search: Fix tags query (#55851)
* Search: fix tags query

* Search: fix type
2022-09-27 21:16:49 +04:00
Kristin Laemmert
701f6d5436
UserService: use the UserService instead of calling sqlstore directly (#55745)
* UserService: update callers to use the UserService instead of calling sqlstore directly

There is one major change hiding in this PR. UserService.Delete originally called a number of services to delete user-related records. I moved everything except the actual call to the user table, and moved those into the API. This was done to avoid dependencies cycles; many of our services depend on the user service, so the user service itself should have as few dependencies as possible.
2022-09-27 07:58:49 -04:00
Artur Wierzbicki
f8d69415ca
Search: create a separate HTTP endpoint (#55634)
* search: create a separate http endpoint

* search: extract api uri

* search: rename uri

* search: replicate the readiness check

* search: replicate the readiness check metric

* search: update mock
2022-09-22 19:02:09 -04:00