grafana/pkg/models
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
..
address.go feat(organization): added update org address to http api and to org details settings view, closes #2672 2015-09-08 14:22:44 +02:00
alert_notifications.go API: Extract OpenAPI specification from source code using go-swagger (#40528) 2022-02-08 13:38:43 +01:00
alert_test.go Chore: Rewrite models alert test to standard library (#30021) 2021-01-01 13:18:47 +01:00
alert.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in alert files (#43815) 2022-01-19 19:25:52 +00:00
apikey.go Add/Delete API keys to Service accounts (#44871) 2022-02-07 14:51:54 +01:00
context_test.go Chore: replace macaron with web package (#40136) 2021-10-11 14:30:59 +02:00
context.go Application: Make error-template title configurable (#40310) 2021-10-13 08:35:01 +02:00
dashboard_acl_test.go Chore: Rewrite models dashboard acl test to standard library (#30022) 2021-01-01 13:22:48 +01:00
dashboard_acl.go Forbid creation of dashboard permissions with both a user and a team (#40104) 2021-10-13 12:16:58 -06:00
dashboard_snapshot.go API: Extract OpenAPI specification from source code using go-swagger (#40528) 2022-02-08 13:38:43 +01:00
dashboard_thumbs.go Previews: crawler as a background service (#44891) 2022-02-10 22:45:00 +04:00
dashboard_version.go Chore: Fix staticcheck issues (#28860) 2020-11-05 13:07:06 +01:00
dashboards_test.go Chore: Rewrite models dashboards test to standard library (#30023) 2021-01-01 13:29:40 +01:00
dashboards.go Previews: crawler as a background service (#44891) 2022-02-10 22:45:00 +04:00
datasource.go API: Extract OpenAPI specification from source code using go-swagger (#40528) 2022-02-08 13:38:43 +01:00
folders.go API: Extract OpenAPI specification from source code using go-swagger (#40528) 2022-02-08 13:38:43 +01:00
health.go feat: added api health endpoint that does not require auth and never creates sessions, returns db status as well. #3302 2017-04-25 17:17:45 +02:00
helpflags.go Chore: Remove unused Go code (#28852) 2020-11-17 11:51:31 +01:00
jwt.go Migrate to Wire for dependency injection (#32289) 2021-08-25 15:11:22 +02:00
libraryelements.go LibraryElements: Creates usage stats for panels and variables (#34476) 2021-05-24 06:11:01 +02:00
licensing.go FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382) 2022-01-24 16:08:05 +01:00
live.go Live: proxy subscribe data for subscribe and runstream plugin calls (#42824) 2021-12-14 20:12:00 +03:00
login_attempt.go login: uses epochs for login throtting. 2018-02-16 17:25:46 +01:00
models.go Okta OAuth provider (team sync support) (#22972) 2020-04-02 17:35:48 +03:00
notifications.go Email: Allow configuration of content types for email notifications (#34530) 2021-07-19 13:31:51 +03:00
org_user.go ServiceAccounts: Add detail view of service account (#44164) 2022-01-19 10:23:46 +01:00
org.go Chore: Fix staticcheck issues (#28860) 2020-11-05 13:07:06 +01:00
playlist.go Chore: Remove unused Go code (#28852) 2020-11-17 11:51:31 +01:00
plugin_settings.go Encryption: Refactor securejsondata.SecureJsonData to stop relying on global functions (#38865) 2021-10-07 17:33:50 +03:00
preferences.go Dashboard: Add week start option to global and dashboard preferences (#40010) 2021-10-18 10:27:14 -03:00
quotas.go Alerting: Remove ngalert feature toggle and introduce two new settings for enabling Grafana 8 alerts and disabling them for specific organisations (#38746) 2021-09-29 16:16:40 +02:00
search_user_filter.go Create search filters by interface (#39843) 2021-10-07 16:06:16 +02:00
shorturl.go Short URL: Cleanup unvisited/stale short URLs (#28867) 2020-11-09 18:08:16 +01:00
star.go Chore: Fix staticcheck issues (#28860) 2020-11-05 13:07:06 +01:00
stats.go Usage stats: Count API keys (#42883) 2021-12-22 17:37:45 +01:00
tags_test.go Chore: Rewrite models tags test to standard library (#30041) 2021-01-05 17:20:41 +01:00
tags.go Create annotations (#8197) 2017-10-07 10:31:39 +02:00
team_member.go AccessControl: Implement SQL filters for team members filtering (#44898) 2022-02-09 17:46:37 +01:00
team.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
temp_user.go Users: Expire old user invites (#27361) 2020-10-13 12:30:09 +02:00
theme.go Dash previews: populate crawler queue from SQL query (#44083) 2022-02-09 13:23:32 +04:00
user_auth.go LDAP: Use an interface instead of a bus to get group teams (#42165) 2022-02-01 12:03:21 +01:00
user_token.go Migrate to Wire for dependency injection (#32289) 2021-08-25 15:11:22 +02:00
user.go AccessControl: Present user edit actions according to AC metadata (#43602) 2022-01-05 09:59:17 +01:00
validations.go Plugins: Requests validator (#30445) 2021-02-03 20:47:45 +01:00