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
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
Will Browne
3fbe4801b7
Plugins: Update collect metrics handler to latest signature ( #45166 )
...
* use updated collect metrics handler
* use proto helper
2022-02-09 17:36:53 +01:00
Will Browne
126ed461b1
remove grafana specific config from package ( #44866 )
2022-02-04 18:14:53 +01:00
Marcus Efraimsson
bc7e55d99b
Chore: Fix log filters ( #44681 )
2022-02-03 23:20:02 +08:00
Will Browne
76603b93d6
Plugins: Refactor Grafana and Plugin version update checkers ( #44529 )
...
* refactor
* rework plugin update checking
* make smarter
* simplify
* fix linter issue
* make use of mutex
* apply feedback to simplify
* format imports
* fix tests
2022-01-31 16:06:16 +01:00
Will Browne
bf8694e709
Plugins: Amend plugins loader log statements ( #44652 )
...
* adjust log statements
* Update pkg/plugins/manager/loader/loader.go
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* add errs to logs
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-01-31 14:24:51 +00:00
Marcus Efraimsson
333de57999
Plugins: Fix scanning plugins when permission for directories is lacking ( #44587 )
...
Fixes so that errors (directory not exists, no permission) when scanning plugins are logged as
errors rather than with debug level. In addition, before the scanning would halt in case of
referenced errors, but with these changes the scanning will continue. If any other error
than the referenced error happens the scanning for specific directory would halt and return
the error, e.g. stop Grafana from starting.
Fixes #43012
2022-01-31 14:07:10 +01:00
Marcus Efraimsson
919c451156
Chore: Remove unused sqlstore dependency ( #44583 )
...
Removes unused sqlstore dependency from plugin management.
Ref #44260
2022-01-28 06:38:19 -05:00
Marcus Efraimsson
94edd7a762
Plugins: Refactor plugin dashboards ( #44315 )
...
Moves/refactor Grafana specific functionality related to plugin dashboards
out to specific services for importing dashboards and keep app plugin dashboards
up-to-date.
Fixes #44257
2022-01-28 10:28:33 +01:00
Will Browne
b5dd4842d0
Plugins: Make manager more easily composable ( #44467 )
...
* make more easily composable
* fix build
2022-01-27 18:06:38 +01:00
Ryan McKinley
5d66194ec5
FeatureFlags: define features outside settings.Cfg (take 3) ( #44443 )
2022-01-26 09:44:20 -08:00
Will Browne
124bf413a2
make plugin loading for nested plugins more deterministic ( #44330 )
2022-01-25 16:05:12 +01:00
Agnès Toulet
65bdb3a899
FeatureFlags: Revert managing feature flags outside of settings.Cfg ( #44382 )
...
* Revert "FeatureToggles: register all enterprise feature toggles (#44336 )"
This reverts commit f53b3fb007
.
* Revert "FeatureFlags: manage feature flags outside of settings.Cfg (#43692 )"
This reverts commit f94c0decbd
.
2022-01-24 16:08:05 +01:00
Will Browne
da98ebdcdf
Plugins: Remove old code related to Core plugin installs ( #44311 )
...
* remove old code
* remove even more
* skip flaky test
2022-01-21 13:38:04 +01:00
Will Browne
3cb0fb3ddc
fix and add test ( #44286 )
2022-01-21 11:00:20 +01:00
Ryan McKinley
f94c0decbd
FeatureFlags: manage feature flags outside of settings.Cfg ( #43692 )
2022-01-20 13:42:05 -08:00
Will Browne
7fbc7d019a
Plugins: Core plugins register via backend factory provider ( #43171 )
...
* refactoring store interface and init flow
* fix import
* fix linter
* refactor resource calling
* load with class
* re-order args
* fix tests
* fix linter
* remove old creator
* add custom config struct
* fix some tests
* cleanup
* fix
* tackle plugins
* fix linter
* refactor and fix test
* add connect failure error
* add fix for azure, cloud monitoring and test data
* restructure
* remove unused err
* add fake tracer for test
* fix grafana ds plugin
2022-01-20 18:16:22 +01:00
Will Browne
a65ce992c1
fix delete plugin dashboard ( #44055 )
2022-01-17 10:33:42 +01:00
Will Browne
7694fff0ef
[WIP] Plugins: Refactoring backend initialization flow ( #42247 )
...
* refactoring store interface and init flow
* fix import
* fix linter
* refactor resource calling
* load with class
* re-order args
* fix tests
* fix linter
* remove old creator
* add custom config struct
* fix some tests
* cleanup
* fix linter
* add connect failure error
* remove unused err
* convert test over
2022-01-14 13:30:39 +01:00
Marcus Efraimsson
f6414ea2b2
CodeQL: Try to fix uncontrolled data used in path expression ( #43462 )
...
Ref #43080
2022-01-11 17:37:58 +01:00
Dan Cech
34f757ba5a
switch to using featureEnabled for enterprise features ( #41559 )
...
* switch to using featureEnabled for enterprise features
2022-01-07 15:11:23 -05:00
ying-jeanne
a8eef45a44
Logger migration from log15 to gokit/log ( #41636 )
...
* migrate log15 to gokit/log
* fix console log
* update some unittest
* fix all unittest
* fix the build
* Update pkg/infra/log/log.go
Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com>
* general type vector
* correct the level key
Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com>
2022-01-06 22:28:05 +08:00
Ryan McKinley
b09d498484
Import: fix dashboard imports with expressions ( #43630 )
2022-01-04 08:42:18 -08:00
idafurjes
8e6d6af744
Rename DispatchCtx to Dispatch ( #43563 )
2021-12-28 17:36:22 +01:00
idafurjes
7936c4c522
Rename AddHandlerCtx to AddHandler ( #43557 )
2021-12-28 16:08:07 +01:00
Marcus Efraimsson
7d3bdb6d1b
Plugins: Set backend metadata property for core plugins ( #43349 )
...
Ref #42648
Ref #42781
2021-12-22 17:59:26 +01:00
idafurjes
b8852ef6a3
Chore: Remove context.TODO() ( #43409 )
...
* Remove context.TODO() from services
* Fix live test
* Remove context.TODO
2021-12-22 11:02:42 +01:00
Will Browne
e4ba5f17dd
add core plugins thru store ( #43085 )
2021-12-14 15:22:40 +01:00
Will Browne
6c4555265a
Plugins: Update client to use SDK resource contract ( #42888 )
...
* client uses sdk resource handler
* apply pr feedback
2021-12-14 11:15:49 +01:00
idafurjes
c80e7764d8
Chore: Remove Dispatch and AddHandler ( #42603 )
...
* Remove Dispatch
* Remove context.TODO()
* Remove AddHandler and Dispatch
2021-12-02 18:08:59 +01:00
Will Browne
0921037f32
Plugins: Move logs from globals to fields ( #42141 )
...
* move logs from globals to fields
* fix test
2021-11-23 17:09:52 +01:00
Will Browne
fb2436af18
fix stream handler funcs ( #41800 )
2021-11-17 13:33:00 +02:00
Will Browne
2e3e7a7e55
Plugins: Plugin Store API returns DTO model ( #41340 )
...
* toying around
* fix refs
* remove unused fields
* go further
* add context
* ensure streaming handler is set
2021-11-17 12:04:22 +01:00
Ryan McKinley
1aac13e5d0
MarketTrend: rename to candlestick panel ( #41582 )
2021-11-15 23:09:59 +01:00
Will Browne
8ea75c9401
Plugins: Add SDK stream handler support to plugin.Client ( #41650 )
...
* add stream handler support to plugin.Client
* nil instead of empty resp
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* nil instead of empty resp #2
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-11-15 14:25:13 +01:00
idafurjes
d72e389d3d
Add context for GetAlertNotificationUidQuery ( #41633 )
2021-11-12 14:35:38 +01:00
Will Browne
8adefa32fd
Plugins: Return error from QueryData when plugin is not found ( #41494 )
...
* Plugins: Return error from QueryData when plugin is not found
* use nil for resp
2021-11-10 10:39:32 +01:00
Marcus Efraimsson
36cea0b48e
Cli: Improve error handling for installing plugins ( #41257 )
...
Improves error handling when installing plugins by checking for
error before adding a defer of closing of the zip reader to not
create a panic when there's an invalid zip file.
Fixes #41029
2021-11-09 11:18:21 +01:00
ying-jeanne
54de1078c8
remove the global log error/warn etc functions ( #41404 )
...
* remove the global log error/warn etc functions and use request context logger whenever possible
2021-11-08 17:56:56 +01:00
Leon Sorokin
f0a108afb3
MarketTrend: add new alpha panel ( #40909 )
2021-11-05 18:01:26 -07:00
Will Browne
b80fbe03f0
Plugins: Refactor Plugin Management ( #40477 )
...
* add core plugin flow
* add instrumentation
* move func
* remove cruft
* support external backend plugins
* refactor + clean up
* remove comments
* refactor loader
* simplify core plugin path arg
* cleanup loggers
* move signature validator to plugins package
* fix sig packaging
* cleanup plugin model
* remove unnecessary plugin field
* add start+stop for pm
* fix failures
* add decommissioned state
* export fields just to get things flowing
* fix comments
* set static routes
* make image loading idempotent
* merge with backend plugin manager
* re-use funcs
* reorder imports + remove unnecessary interface
* add some TODOs + remove unused func
* remove unused instrumentation func
* simplify client usage
* remove import alias
* re-use backendplugin.Plugin interface
* re order funcs
* improve var name
* fix log statements
* refactor data model
* add logic for dupe check during loading
* cleanup state setting
* refactor loader
* cleanup manager interface
* add rendering flow
* refactor loading + init
* add renderer support
* fix renderer plugin
* reformat imports
* track errors
* fix plugin signature inheritance
* name param in interface
* update func comment
* fix func arg name
* introduce class concept
* remove func
* fix external plugin check
* apply changes from pm-experiment
* fix core plugins
* fix imports
* rename interface
* comment API interface
* add support for testdata plugin
* enable alerting + use correct core plugin contracts
* slim manager API
* fix param name
* fix filter
* support static routes
* fix rendering
* tidy rendering
* get tests compiling
* fix install+uninstall
* start finder test
* add finder test coverage
* start loader tests
* add test for core plugins
* load core + bundled test
* add test for nested plugin loading
* add test files
* clean interface + fix registering some core plugins
* refactoring
* reformat and create sub packages
* simplify core plugin init
* fix ctx cancel scenario
* migrate initializer
* remove Init() funcs
* add test starter
* new logger
* flesh out initializer tests
* refactoring
* remove unused svc
* refactor rendering flow
* fixup loader tests
* add enabled helper func
* fix logger name
* fix data fetchers
* fix case where plugin dir doesn't exist
* improve coverage + move dupe checking to loader
* remove noisy debug logs
* register core plugins automagically
* add support for renderer in catalog
* make private func + fix req validation
* use interface
* re-add check for renderer in catalog
* tidy up from moving to auto reg core plugins
* core plugin registrar
* guards
* copy over core plugins for test infra
* all tests green
* renames
* propagate new interfaces
* kill old manager
* get compiling
* tidy up
* update naming
* refactor manager test + cleanup
* add more cases to finder test
* migrate validator to field
* more coverage
* refactor dupe checking
* add test for plugin class
* add coverage for initializer
* split out rendering
* move
* fixup tests
* fix uss test
* fix frontend settings
* fix grafanads test
* add check when checking sig errors
* fix enabled map
* fixup
* allow manual setup of CM
* rename to cloud-monitoring
* remove TODO
* add installer interface for testing
* loader interface returns
* tests passing
* refactor + add more coverage
* support 'stackdriver'
* fix frontend settings loading
* improve naming based on package name
* small tidy
* refactor test
* fix renderer start
* make cloud-monitoring plugin ID clearer
* add plugin update test
* add integration tests
* don't break all if sig can't be calculated
* add root URL check test
* add more signature verification tests
* update DTO name
* update enabled plugins comment
* update comments
* fix linter
* revert fe naming change
* fix errors endpoint
* reset error code field name
* re-order test to help verify
* assert -> require
* pm check
* add missing entry + re-order
* re-check
* dump icon log
* verify manager contents first
* reformat
* apply PR feedback
* apply style changes
* fix one vs all loading err
* improve log output
* only start when no signature error
* move log
* rework plugin update check
* fix test
* fix multi loading from cfg.PluginSettings
* improve log output #2
* add error abstraction to capture errors without registering a plugin
* add debug log
* add unsigned warning
* e2e test attempt
* fix logger
* set home path
* prevent panic
* alternate
* ugh.. fix home path
* return renderer even if not started
* make renderer plugin managed
* add fallback renderer icon, update renderer badge + prevent changes when renderer is installed
* fix icon loading
* rollback renderer changes
* use correct field
* remove unneccessary block
* remove newline
* remove unused func
* fix bundled plugins base + module fields
* remove unused field since refactor
* add authorizer abstraction
* loader only returns plugins expected to run
* fix multi log output
2021-11-01 10:53:33 +01:00
ying-jeanne
681218275e
remove crit and trace ( #40320 )
2021-10-26 17:36:24 +02:00
idafurjes
2759b16ef5
Chore: Add context for dashboards ( #39844 )
...
* Add context for dashboards
* Remove GetDashboardCtx
* Remove ctx.TODO
2021-10-05 13:26:24 +02:00
Will Browne
40267f5ea0
Plugins: Fix "too many open files" error when verifying signature of plugin with many files ( #39100 )
...
* close file at loop end
* less tired approach
2021-09-13 17:46:26 +02:00
Will Browne
40643ee023
track signature files + add warn log ( #38938 )
2021-09-08 08:49:05 +02:00
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection ( #32289 )
...
Fixes #30144
Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
Will Browne
08a73a5291
Plugins: Perform plugin update check prior to uninstall ( #36909 )
...
* only uninstall if update is possible
* add .
* update lingo for clarity
2021-07-29 11:52:23 +02:00
Will Browne
94688be398
Plugins: Use plugin.pluginDir as source of truth for plugin location ( #36711 )
...
* use plugin.pluginDir as source of truth for plugin location
* correct the interface
2021-07-15 09:08:25 +02:00
Will Browne
e06335ffe9
Plugins: Improve grafana-cli UX + API response messaging for plugin install incompatibility scenario ( #36556 )
...
* improve UX for plugin install incompatability
* refactor test
2021-07-13 09:58:46 +02:00