161 Commits

Author SHA1 Message Date
b2f80d4dca Dashboards: Add Dashboard API Validation tests and fix underlying issues (#103502) 2025-04-07 05:44:28 +03:00
364247e26b Provisioning: add most mocks to unit test provisioning jobs (#103446)
* Use interface for factories

* Add most mocks to unit test jobs

* Generate more mocks for main jobs package

* Interface for parser

* Use clients directly without parser

* Regenerate mock

* Eliminate resource clients from Parser

* Interface for folder tree
2025-04-04 15:42:20 +03:00
04fb9f534e Dashboards: Only expose LibraryPanels and search on v0 (not v1+v2) (#103335) 2025-04-03 20:24:12 +03:00
4918d8720c Dashboard Restore: Remove experimental functionality under feature flag dashboardRestore for now - this will be reworked (#103204) 2025-04-03 02:52:54 -05:00
08042ae827 search: add legacy id for all resources in bleve (#103206)
* add legacy id for all resources in bleve
2025-04-02 08:20:23 -04:00
4cb756c5d1 K8s: Fix error conversion for provisioned dashboards (#103074) 2025-03-31 14:34:54 +01:00
f84654d162 Stats: Optimize getting folder stats (#103033) 2025-03-28 20:17:50 -05:00
12c5b81850 K8s: Dashboards: Reduce db calls to get users on list (#103020) 2025-03-27 22:57:49 +02:00
7c2890384a K8s: Dashboards: Set v1alpha1 as priority (#102729) 2025-03-25 10:32:49 -06:00
4d79d5e80c K8s: Fix legacy dashboard folder check (#102660) 2025-03-22 06:22:59 +03:00
08bbd7a536 fix (unified-storage): always do perm filtering in bleve by default (#102541)
* make unifiedStorageSearchPermissionFiltering default true
2025-03-21 10:06:01 -04:00
e2737f195b RBAC: Remove dashboard guardians pt 2 (#102556)
* remove NewByDashboard guardian

* remove unused authorizer

* more cleanup

* simplify canAdmin evaluation
2025-03-21 10:32:27 +00:00
2e2b5942c8 K8s/Unified: Consolidate generation logic in apistore client (#102260) 2025-03-21 10:45:25 +02:00
da95ee22cc K8s: Fix dashboard creation timestamp (#102578) 2025-03-21 07:47:09 +02:00
c33a53a47a K8s: Remove restore functionality; can be done with list (#102560) 2025-03-20 16:38:32 -05:00
6c704484e9 K8s: Add sorting by more than titles (#102403) 2025-03-18 20:23:43 -05:00
6019b21cc5 K8s: Dashboards: Fix multi-org provisioning flow (#102266) 2025-03-17 20:20:03 +02:00
bb881f38bb K8s/Dashboards: Remove uid+version from spec (#101992) 2025-03-16 20:46:12 -05:00
5c24312625 Dashboards: Fix duplicate provisioning when errors occur on title-only based provisioning (#102249)
Dashboards: fix title based provisioning
2025-03-15 21:12:48 -06:00
2456eeb69b fix(unified-storage): Improve test coverage on legacy searcher and parse result helper (#102147)
* include TotalHits when searching for provisioning information and improve tests

* return err when parsing search results with mismatch number of columns and cells and add tests for it
2025-03-14 08:25:59 -04:00
5d2ba10113 K8s/Dashboards: Extract Dashboard APIs to an app submodule (#102029)
* Move dashboard k8s APIs to a separate app

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Copy dashboard code in Dockerfile

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Fix conversion generation

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Update OpenAPI snapshot for dashboard/v0alpha1

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-03-13 11:05:01 +02:00
edb331dc00 fix(unified-storage): Fix legacysearch returning mismatched cell/column count in response (#102044)
Fix legacysearch returning less cells than column count in search response
2025-03-12 13:00:22 -07:00
bfedf0b512 Dashboard: Redirect between v1alpha1 and v2alpha1 depending on stored version (#101292)
* wip: Create a proxy state manager to avoid complexity

* Read path redirecting

* add tests for unified dashboard API

* add tests

* Contemplate both formats in DashboardProxy

* Fix force old

* Fix tests for proxy

* catch errors

* Save as V2 when dynamic dashboard is enabled

* Improve tests

* Remove feature toggle

* Use kubernetesDashboards for e2e suite

* Fix issue when loading snapshots

* Fix typescript errors

* Integrate with backend conversion error

* Remove legacy annotation

* fix snapshot loading; lint

* Add missing hideTimeControls

* fix test

* make setupDashboardAPI to all suites

* refactor getDashboardAPI

* Add tests

* fix DashboardScenePage tests

* fix tests

* fix go tests

* Refactor to understand better the need of transforming to v2 to compare

* Fix detect changes logic

* yes status from schema gen

---------

Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-03-12 11:43:32 -06:00
42ae2fb026 fix(unified-storage): add missing dashboard legacy_id when in legacy read mode (#101944)
* add missing dashboard legacy_id when in modes 0-2
2025-03-11 12:56:34 -04:00
ea89a68028 K8s/Dashboards: Generate Dashboards k8s APIs using Grafana App SDK (#99966)
* Generate Dashboard kinds with `grafana-app-sdk`

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Hack together a fix for invalid TS codegen for v0 & v1

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Address Go linter issues

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Address TS linter issues

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Add new app to CODEOWNERS

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Fix a couple of issues detected by tests

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Update OpenAPI definitions and test files

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Remove title from Dashboard v1alpha1 spec

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Remove unused CUE schemas

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* remove unrelated files

* allow any in the generated betterer

* Add a comment explaining why we don't use deepcopy-gen

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Default to v2alpha1 if dashboards v2 FF is enabled

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-03-11 13:00:37 +02:00
64f1df69d5 Search: Rename managed object index (#101856) 2025-03-10 19:48:53 +03:00
827da46c51 Unified Storage: Remove wildcard queries (#101441)
* WIP adding custom analyzer so we can do substring search efficiently

* Adding unit tests for title search

* formatting

* adds more title search unit tests

* organize helpers

* fixes issue caused by having two title mappings

* Removes camelcase token filter since it prevents you from searching for a substring of chars and numbers. Adds regression test.

* adds back mapping for title_phrase

* use simple analyzer for input query string so it doesn't filter out english stop words

* ran bleve tests, table snapshots updated

* ignore linter for "unused" test functions. They are very helpful for troubleshooting search. Keeping them.

* only log total hits and query cost if result not nil

* fixes failing test - one more field because there are two title mappings now

* fix test

* fixes test - only take first item when its the title

* Adds separate internal field for title ngram mapping.

When searching with a query, results are sorted by score desc.

When searching without a query, results are sorted by title desc.

Adjusts ngram max to be 10.

Text queries are a disjunction of an exact match, phrase match, and a match. Boosted to have priority in that order.

Adds more unit tests for searching.

* linter

* fix test

* ran tests - generated new test dash json

* sort by title phrase instead of title

* fix test - not relying on /apis/dashboard/search to apply title sorting anymore
2025-03-07 09:51:15 -06:00
2e0d2f3c76 fix(unified-storage): break dependency from dualwriter in resource module (#101788) 2025-03-07 15:27:31 +01:00
dc2defd84f K8s/Annotations: Use manager/source annotations rather than repo (#101313)
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-03-05 08:54:20 +02:00
c1b48cc488 Dashboards: Add apiVersion to dashboard table (#100845) 2025-03-04 07:47:45 +03:00
5652e0b835 K8s/Dashboard/SQL: Support ascending order query (#101363) 2025-02-28 11:34:09 +03:00
806c043e45 UnifiedStorage: Rename Batch processing to Bulk (#101413) 2025-02-28 08:41:08 +03:00
58457d41d3 K8s/DualWriter: Remove legacy interface (#101395) 2025-02-27 13:27:28 +03:00
3992ac2ac1 Dashboard: Multi-version builder (#100305) 2025-02-21 06:50:29 -05:00
b4c4b9abbd Remove embedded WriteEvent from WrittenEvent struct, to avoid having unnecessary fields. (#101081) 2025-02-20 17:34:25 +01:00
74e621f377 fix(unified-storage): "sharedwithme" search in legacy modes returns everything (#101054)
* fix "sharedwithme" search returning everything when user does not have any shared dashboards
2025-02-20 09:53:06 -05:00
5a40c84568 DualWriter: Support managed DualWriter (#100881) 2025-02-19 17:50:39 +03:00
67be9aeed6 K8s: Search fallback: Support all sort by methods (#100776) 2025-02-18 12:30:11 -06:00
78ef9fd9d9 QueryLibrary: rename API from peakq to querylibrary (#100813) 2025-02-17 17:49:11 +01:00
9494e6eb37 K8s: Search fallback: Support tag search (#100767) 2025-02-14 16:57:10 -05:00
b89fd287c7 K8s: Dashboards: Fix history list (#100763) 2025-02-14 22:12:18 +02:00
1856d47e47 Remove GetResourceClient hack from unified package. (#100636)
* Remove GetResourceClient hack from unified package.
2025-02-14 12:34:52 +01:00
c963032915 search: handle "sharedwithme" use-case in both legacy/US modes (#100286)
* handle "sharedwithme" use-case in both legacy/US modes

* display "Shared with me" as location in dashboard list

* fix missing "TotalHits" prop in mode 2
2025-02-13 15:56:29 -05:00
e2081c3e0c K8s: Fix legacy fallback provisioning (#100566) 2025-02-13 21:32:25 +02:00
155492c8a5 search: handle "permission" query param in search (#100607)
handle "permission" query param in search
2025-02-13 11:35:53 -05:00
df84d928e2 K8s: Folders: Fix legacy search (#100393) 2025-02-11 13:14:25 -06:00
a5355fd66c Storage: Add command line tool to migrate legacy dashboards (and folders) to unified storage (#99199) 2025-02-11 19:57:46 +02:00
378bb6ea3f [search] folder name lookup performance (#100154)
[search] use search for folder name lookup
2025-02-07 17:19:23 -05:00
7e11e604c7 [search] fix offset param in finddashboards (#100302)
* fix offset param in finddashboards

* separate offset from page in k8s search endponit
2025-02-07 13:24:27 -05:00
bf27e6d3ed Unified Storage: Fix legacy dashboard query when using continue token (#100244)
* query for rows less than the continue token LastID since the queries are sorted by dash ID in DESC order

* run dashboard query tests
2025-02-07 12:16:41 -06:00