Artur Wierzbicki
644503f5e6
Previews: use ETag header ( #51008 )
...
* use etag header for previews
* use unix millis rather than tz-dependant string
2022-06-17 18:02:03 +04:00
Kristin Laemmert
1df340ff28
backend/services: Move GetDashboard from sqlstore to dashboard service ( #48971 )
...
* rename folder to match package name
* backend/sqlstore: move GetDashboard into DashboardService
This is a stepping-stone commit which copies the GetDashboard function - which lets us remove the sqlstore from the interfaces in dashboards - without changing any other callers.
* checkpoint: moving GetDashboard calls into dashboard service
* finish refactoring api tests for dashboardService.GetDashboard
2022-05-17 14:52:22 -04:00
Artur Wierzbicki
7a05941ea0
Previews: improve logging, add time measurements to the crawler ( #49043 )
...
* #44449 : log times taken for various things in previews service / crawler
* #44449 : remove stale log
2022-05-16 18:09:46 -07:00
Artur Wierzbicki
736be74128
Chore: Add Usage stats providers registry ( #48357 )
...
* add usage stats providers
* migrate thumbnails service to `registry.ProvidesUsageStats`
* snake -> camel
* lint fix
* migrate accesscontrol to `registry.ProvidesUsageStats`
* add accesscontrol to usage stats providers registry
* fix test
* added a note about errors
2022-04-28 13:06:49 +04:00
Artur Wierzbicki
2e599643f6
Previews: refactor ( #47728 )
...
* #44449 : return standard thumb service even if auth setup fails
* #44449 : remove dashboardPreviewsScheduler feature flag
* #44449 : externalize dashboardPreviews config
* #44449 : disable previews by default
* #44449 : rename logger
* #44449 : dashboardPreviewsAdmin feature requires dev mode
* #44449 : retrigger CII
2022-04-25 01:55:10 +04:00
ying-jeanne
7ddae870e7
fix status code 200 ( #47818 )
2022-04-15 08:01:58 -04:00
Artur Wierzbicki
46dc1e98fa
Previews: track oss adoption
2022-04-13 11:54:49 +02:00
Artur Wierzbicki
a4381ebc91
Previews: create crawler auth setup service ( #47349 )
...
* #46968 : add `RetrieveServiceAccountIdByName` to serviceaccounts service
* #46968 : improve error logging in rendering service
* #46968 : add oss crawler account setup
* #46968 : fix tests
* #46968 : switch back to ROLE_ADMIN
* #46968 : rename to crawlerAuth
* comment crawler_auth.go
2022-04-12 19:34:04 +02:00
Serge Zaitsev
df465ccad3
Chore: Remove bus from thumbs service ( #46772 )
2022-03-21 14:15:31 +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
Artur Wierzbicki
0276b029fc
Previews: crawler as a background service ( #44891 )
...
* 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 : remove sleep time, adjust number of threads
* #44449 : review fix: add `orgId` to `DashboardThumbnailMeta`
* #44449 : review fix: automatic parsing of thumbnailState
* #44449 : lint fixes
* #44449 : crawler as a background service v0.1
* #44449 : use ServerLockService
* #44449 : use ServerLockService
* #44449 : review fix: prefer `WithDbSession` over `WithTransactionalDbSession`
* #44449 : review fix: add a comment explaining source of the filepath
* #44449 : review fix: added filepath validation
* #44449 : fix FindDashboardsWithStaleThumbnails to include `theme` and `kind` in search params
* #44449 : fix FindDashboardsWithStaleThumbnails to include `theme` and `kind` in search params
* #44449 : create function for crawler on demand
* #44449 : improve crawler logging
* #44449 : fix wire
* #44449 : uncomment dummy thumb service, fix ticker interval
* #44449 : prevent race condition
* #44449 : improve logging
* #44449 : fix theme
* #44449 : review fixes https://github.com/grafana/grafana/pull/45063/files @fzambia
* #44449 : add missing unlock
* #44449 : merge
* #44449 : review fix - logger @fzambia https://github.com/grafana/grafana/pull/45063/files
* #44449 : formatting
* #44449 : merge conflict fix
* #44449 : merge conflict fix
* #44449 : merge conflict fix
* #44449 : naming fix
* #44449 : update authOpts
* #44449 : change authOpts.role back to admin
* #44449 : fix `walk` signature, move ctx to a first argument
* #44449 : add `dashboardPreviewsScheduler` feature flag
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2022-02-10 22:45:00 +04:00
Artur Wierzbicki
a025109647
Dash previews: populate crawler queue from SQL query ( #44083 )
...
* 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 : remove sleep time, adjust number of threads
* #44449 : review fix: add `orgId` to `DashboardThumbnailMeta`
* #44449 : review fix: automatic parsing of thumbnailState
* #44449 : lint fixes
* #44449 : review fix: prefer `WithDbSession` over `WithTransactionalDbSession`
* #44449 : review fix: add a comment explaining source of the filepath
* #44449 : review fix: added filepath validation
* #44449 : review fixes https://github.com/grafana/grafana/pull/45063/files @fzambia
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2022-02-09 13:23:32 +04:00
Ryan McKinley
5d66194ec5
FeatureFlags: define features outside settings.Cfg (take 3) ( #44443 )
2022-01-26 09:44:20 -08: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
Ryan McKinley
f94c0decbd
FeatureFlags: manage feature flags outside of settings.Cfg ( #43692 )
2022-01-20 13:42:05 -08:00
Ryan McKinley
b404aae9c3
Crawler: use existing render service to generate dashboard thumbnails ( #43515 )
...
Co-authored-by: Artur Wierzbicki <artur@arturwierzbicki.com>
2022-01-10 08:21:35 -08:00
idafurjes
8e6d6af744
Rename DispatchCtx to Dispatch ( #43563 )
2021-12-28 17:36:22 +01:00
Ryan McKinley
4233a62aeb
DashboardPreviews: add dashboard previews behind feature flag ( #43226 )
...
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Artur Wierzbicki <artur@arturwierzbicki.com>
2021-12-23 09:43:53 -08:00