Commit Graph

14250 Commits

Author SHA1 Message Date
Georges Chaudy
d999b415df
UniStore: Use epoch with microsecond resolution as RV (#92638)
* Use epoch with microsecond resolution as RV

* fix backend tests

* Add solution for when the clock goes back

* Add solution for when the clock goes back

* generate mocks

* go lint

* remove comment

* Use Greatest instead of max in msyql and postgres

* update tests

* Update pkg/storage/unified/sql/sqltemplate/dialect_sqlite.go

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>

* cast to bigint

* add additional round trip

* increment the RV using 2 sql round trips instead of 3

* cleanup comments

* cast unix timestamp to integer

* fix postgres query

* remove old increment test data

* remove greatest

* cast unix_timestamp to signed

* Use statement_timestamp instead of clock_timestamp

---------

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-10-11 12:11:33 +03:00
Laura Benz
4092741f24
RestoreDashboards: Merge both feature toggles to dashboardRestore (#94412)
* refactor: remove FE feat toggle from BE

* refactor: remove FE toggle and adjust roles

* refactor: replace feat toggle in tracking events

* refactor: remove FE feat toggle

* refactor: remove FE feat toggle

* fix: autogenerated file
2024-10-11 10:29:58 +02:00
owensmallwood
3d59d3b40f
Search poc: Initial index paginates list response (#94582) 2024-10-11 10:13:10 +02:00
Misi
4eab10eaa1
Auth: Add missing Name property to SAML strategy (#94565)
Add Name to SAML strategy
2024-10-11 08:45:36 +02:00
Syerikjan Kh
f8748f0724
ref: pass tracer to plugin factory func (#93701)
* ref: pass tracer to plugin factory func

* fix: add tracer to coreplugin

* test: fix test, generate wire

* test: ignore trace field in loader_test

* ref: pass tracer as dependency, don't store in plugin

* ref: wrap tracer with tracer provider to satisfy WithTracerProvider

* ref: use otel trace.Tracer type for tracer
2024-10-10 20:30:56 -04:00
Yuri Tseretyan
27c44f4709
Alerting: Update notification policy service to check provenance status (#94359)
* update ResetPolicyTree to accept provenance status

* update methods to check for provenance status use relaxed validation
2024-10-10 16:26:30 -04:00
Santiago
75d42d82a3
Alerting: Make Google Chat URL a secure field (#94499) 2024-10-10 21:30:16 +02:00
Yuri Tseretyan
0418a7bc0a
Chore: Turn off apiserver tracing when embedded in Grafana (#94574)
turn off apiserver tracing when embedded in Grafana to make it reuse Grafana initiated trace context
2024-10-10 14:40:16 -04:00
owensmallwood
d96baaa878
Search PoC: Add logging (#94567) 2024-10-10 20:34:57 +03:00
Alexander Zobnin
e642e1a804
Zanzana: Pass parent folder for the checks in search queries (#94541)
* Pass parent folder as a contextual tuple in Check request

* Search by listing folders and dashboards

* skip dashboards listing if limit reached

* remove unused

* add some comments

* only add ContextualTuples if parent provided

* Remove parent relation for dashboards from schema and perform separate checks
2024-10-10 17:38:15 +02:00
Prem Saraswat
5c03c14b25
resource-api: Loosen name validation to match K8s requirements (#93404)
* resource-api: Loosen name validation to match K8s requirements

This patch modifies some of the requirements for name validation of
objects in Resource API to match Kubernetes.

The limit we have on characters in name is 64, but some resources allow
upto 253 characters. Similarly we also include `:` in the regex, as many
objects in default K8s setup use it in the name (the group
`system:masters` for example)

Signed-off-by: Prem Kumar <prem.saraswat@grafana.com>

* Update the name column length in migrator and update e2e test to verify

---------

Signed-off-by: Prem Kumar <prem.saraswat@grafana.com>
2024-10-10 11:03:18 -04:00
linoman
21d26de4d8
Session Refactor: Add SAMLSession (#94490)
* add saml session struct

* resolve saml session

* Add NameID

---------

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2024-10-10 16:57:34 +02:00
Karl Persson
86fc8da703
RBAC: Add legacy authorization checks to teams (#94524)
* Setup team authorization for teams

* Add list filter for teams
2024-10-10 16:47:31 +02:00
Misi
c872cad879
OrgSync: Do not set default Organization for a user to a non-existent Organization (#94537)
Do not set default org for a user to a missing org

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-10-10 15:31:30 +02:00
owensmallwood
8e667c4165
Search POC: Fixes search request tenant id (#94511)
fixes search request tenant id
2024-10-10 08:43:16 -04:00
Arati R.
011978e81b
K8s/Folders: Remove folder service from client (#94450)
* Support getting full path of UIDs
* Use full path to set parents field
* Update get folder test
* Add folder store test for getting with full path UIDs
* Add test for parsing parent titles
* Test nested folder create payload
2024-10-10 13:22:57 +02:00
Gabriel MABILLE
6dbd324ef9
Fix: Actually call the DedupOrgInLogin migration (#94520) 2024-10-10 10:53:31 +02:00
Karl Persson
9ece88d585
Zanzana: bump openfga version (#94485)
* Bump openfga

* Remove internall sqlite implementation for openfga

* Use sqlite implementation from openfga
2024-10-10 09:07:40 +02:00
Marcus Andersson
bc7386e815
PluginExtension: Added debug log (#94146)
* wip

* add simple scenes object with logs panel

* return hardcoded log message from runtime ds

* simplify log entry

* use log in links registry

* wired the log together.

* wip

* Connected the extensions log to the runtime datasource to steam logs

* wired the other registies.

* implemented child function.

* set right field type on labels

* set meta type

* using the logger in various places.

* added type of onclick.

* removed time picker.

* removed imports.

* passing log to functions where they are needed.

* moved scene into admin page.

* minor improvement to the message.

* added possibility to update query with values based on the data.

* added filter suppoert.

* wip

* wip

* fixed so extension points are displayed.

* use log level from grafana data

* fixed bugs with the filtering.

* Fixed some logs.

* only register extensions page in development mode.

* fixed filtering.

* added on click debug log.

* PluginExtensions: Add debug log to Grafana (Rewrite to scenes-react) (#93954)

* refactoring.

* simplify it even more.

* Update public/app/features/plugins/extensions/logs/LogViewer.tsx

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>

* used VizGridLayout instead of VizGrid component.

* Fixed feedback and fixed bug in filtering logic.

* fixed another nit.

* empty string instead of title.

* Added tests and fixed error.

* added test file.

* regenerated yarn.lock

* Update public/app/features/plugins/extensions/logs/filterTransformation.test.ts

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* fixed nit.

* more nits.

* added more test cases.

* simplified filtering logic.

* removed unused dep.

* defined broadcast channel in jest setup.

* added tests for datasource.

* fixed failed tests.

* fixed tests.

* fixing go lint issue.

* silent go lint.

* fixed lint issue.

---------

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2024-10-10 09:27:57 +03:00
Gábor Farkas
0a7b731242
datasources: querier: request parsing failures are not http 500 (#94488)
* datasources: querier: request parsing failures are not http500

* fix test

---------

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
2024-10-10 00:28:27 +03:00
Diego Augusto Molina
4a800eda9f
Unistore Chore: add inocuous preparative changes for otel-based db observability (#94473)
add inocuous preparative changes for otel tracing
2024-10-09 20:32:09 +00:00
owensmallwood
612b864772
Indexing PoC: Add search/browse (#94126)
* adds Filter gRPC and make protobuf

* adds route for querying the filter gRPC

* wires up Filter gRPC call

* [WIP] index from start

* renames gRPC endpoint to "Search"

* adds /apis/search route into k8s routes. Hacky for now.

* updates readme - wrong casing

* adds feature toggle for unified storage search

* hides US search behind feature flag. Clean up print statements.

* removes indexer - will be added in another PR

* Search: Add API Builder

* adds required method

* implementing UpdateAPIGroupInfo (WIP)

* adds groupversion

* commenting out for now

* remove unneeded code from experimenting and update register.go to match interface required

* list resources and load into index

* pass context

* namespaces search route

* lint

* watch

* add todo

* add todo

* merge

* cleanup

* add todo

* gen protobuf

* lint; fix migration issue

* Updates index mapping function to map unified storage object Value

* Changes Index() to pointer receiver - fixes panic

* add delete

* cleanup

* gets search/browse functioning. Results show up as base64 encoded. Still a WIP.

* Doesnt json re-encode gRPC response in search handler

* add kind to SearchRequest proto

* Updates query interface to be more generic. Make proto. Parses query params in api server.

* make protobuf

* removes unused method and imports

* Returns all indexed fields in search results. Adds pagination support (limit + offset).

* remove comment

* remove unused struct

* gets tenant in search k8s api handler

* adds hardcoded spec field mappings - starting with playlists

* adds all spec fields to search results

* moved helper function for field mappings into index

* only includes allowed spec fields in search results

* cleans up error handling

* removes debug log

---------

Co-authored-by: leonorfmartins <leonorfmartins@gmail.com>
Co-authored-by: Todd Treece <todd.treece@grafana.com>
Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
2024-10-09 11:20:05 -06:00
Scott Lepper
c86c4ca65a
[unified search] fix: remove unified searcher (#94492) 2024-10-09 12:02:52 -04:00
Karl Persson
ace177f20a
AuthN: Set access token name (#94471)
* Set access token name
2024-10-09 17:08:11 +02:00
Andreas Christou
97a90591ca
AzureMonitor: Fix App Insights portal URL for multi-resource trace queries (#94119)
* Retrieve the resource in the query

* Appropriately construct url

* Update tests
2024-10-09 14:21:10 +01:00
Scott Lepper
a3764ebeba
[Search] fix: add and delete (#94438)
[search] fix: add and delete from index
2024-10-08 16:17:31 -04:00
Karl Persson
2d0ea60017
ServiceAccounts: Run migration in batches (#94429)
* ServiceAccounts: Run migration in batches
2024-10-08 19:53:23 +02:00
Scott Lepper
c2fb2dcfbe
wire up unified search from the ui; add basic search support (#94358)
* wire up search from the ui;  add basic search support
2024-10-08 13:09:56 -04:00
Ezequiel Victorero
19844220db
Playlists: Remove from menu for users without permissions (#94403) 2024-10-08 13:04:18 -03:00
Scott Lepper
52b70ca976
Grafana indexing poc - load and watch index (#93843)
* list resources and load into index
* watch for changes and update index
2024-10-08 09:43:23 -04:00
Matheus Macabu
96384b5181
CloudMigrations: cover cases where library panel has no folder (#94405) 2024-10-08 15:14:23 +02:00
Andres Martinez Gotor
02f5e1f930
Add Sandbox settings feature flag (#94388) 2024-10-08 13:38:54 +01:00
Gabriel MABILLE
b90e09e966
Fix: Deduplicate OrgID in SA logins (#94378)
* Fix: Deduplicate OrgID in SA logins
2024-10-08 13:35:08 +02:00
Misi
bd7850853e
Auth: Attach external session info to Grafana session (#93849)
* initial from poc changes

* wip

* Remove public external session service

* Update swagger

* Fix merge

* Cleanup

* Add backgroud service for cleanup

* Add auth_module to user_external_session

* Add tests for token revocation functions

* Add secret migration capabilities for user_external_session fields

* Cleanup, refactor to address feedback

* Fix test
2024-10-08 11:03:29 +02:00
Jo
9eea0e99fc
Chore: Use UIDs as identifiers for teams frontend (#94345)
* Team frontend now uses UIDs as identifiers. Safe to revert
2024-10-08 09:48:35 +02:00
Jo
945dd052b1
Fix: Ensure SA migrations doesn't hit migrated SAs if rerun (#94347)
* ensure mig doesn't hit migrated SAs if rerun

* Fix small issue with the test

---------

Co-authored-by: gamab <gabriel.mabille@grafana.com>
2024-10-08 09:45:14 +02:00
Yuri Tseretyan
b8df574aba
Alerting: Support optimistic concurrency in notification policies service (#93932)
* update notification policy provisioning service to support optimistic concurrency
* rewrite tests and include concurrency tests
2024-10-08 00:09:02 +03:00
Yuri Tseretyan
4c1cb79069
Alerting: Add access control to receiver status API (#94287) 2024-10-07 15:21:29 -04:00
Arati R.
ea5cf7c51f
Unified Storage /Folders: Allow Unified Storage subfolders creation (#94327)
* Add parents field to folder DTO
* Allow subfolder creation when folder flag is enabled
* Update UnstructuredToLegacyFolder
* Include parents field when creating folder
2024-10-07 16:48:56 +02:00
Ieva
d7aca7d0fe
Role mapping: Add group_mapping_uid column to user_role table (#93810)
* add group_mapping_uid column to user_role table

* add group mapping UID to user role struct
2024-10-07 15:47:16 +01:00
Misi
0539ccf10d
Auth: Fix redirection when auto_login is enabled (#94311)
* Fix for SAML auto login

* Fix for OAuth auto login
2024-10-07 14:59:00 +02:00
Matheus Macabu
6bd2f9f3ea
CloudMigrations: remove duplicated import on test (#94322) 2024-10-07 15:32:52 +03:00
Matheus Macabu
712314e832
CloudMigrations: create onPremToCloudMigrationsAlerts feature toggle in experimental stage (#94257)
CloudMigrations: create onPremToCloudMigrationsAlerts feature toggle in experimental stage

This feature toggle requires the `onPremToCloudMigrations` toggle to be enabled in order to work.

Given migration of Alerts (and child resources) is more critical, this flag was separated from
the main one.
2024-10-07 12:53:24 +02:00
Matheus Macabu
e89aef57cb
CloudMigrations: wire ngalert to cloud migration service and add slicesext.Map helper (#94254)
* CloudMigrations: add slicesext.Map function to simplify dto creation

* CloudMigrations: wire ngalert to cloud migration service
2024-10-07 12:53:14 +02:00
Matheus Macabu
9af095d730
CloudMigrations: Add data types for alerts resources (#94251) 2024-10-07 12:52:31 +02:00
Dana Axinte
d88be2819d
CloudMigrations: Store parent folder name in cloud_migration_resource table (#94009)
* use name in fe

* store parent folder name in local db

* clean up

* tiny test

* trial react

* rename to parent name

* go lint

* generate api and ts

* go tests

* rearrange

* clean

* update with suggestions from josh

* make library elements work

* updates from comments

* global migration types

* parent name for alter table
2024-10-07 11:35:08 +01:00
Arati R.
5a9bd1d1cf
K8s/Folders: Fix folder create payload (#94273)
* Fix createdBy and updatedBy
* Fix refreshing permission cache
* Update created time
* Fix user identifier parsing
2024-10-07 13:32:25 +03:00
maicon
261be0facd
UniStore: Evaluate Folder DTO attributes (#93968)
* UniStore: Evaluate Folder DTO attributes

* Handle AccessControl

* Reduce the number of parameters to newToFolderDto

* Detach Metadata helpers from HTTPServer

* Add tests

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-07 12:08:16 +02:00
Roberto Jiménez Sánchez
19c77eaae1
CloudMigrations: Fix traceability & HTTP Client initialisation (#94141)
* Add traceability to Migration Assistant feature

* Fix some compilation errors

* Fix lint issues

* Use async context

* Add trace for LibraryElements
2024-10-07 11:31:45 +02:00
Matheus Macabu
4bc7a35f56
UnifiedStorage: fix watcher test (#94301) 2024-10-07 12:07:48 +03:00