Commit Graph

15485 Commits

Author SHA1 Message Date
Alexander Zobnin e0ca1e5b1c [release-11.6.3] RBAC: Dont additionally cache all users permissions (#106146)
RBAC: Don't additionally cache all users permissions (#105607)

* RBAC: Don't additionally cache all users permissions

* remove unused tests

(cherry picked from commit cfba630f5c)
2025-05-28 16:45:07 +02:00
Sofia Papagiannaki 1748a14f54 [release-11.6.3]: Fix static tests (#106136) 2025-05-28 16:04:23 +03:00
grafana-delivery-bot[bot] 28e6d9767d [release-11.6.2] Storage: Take migration_locking setting into account (#105950)
Storage: Take `migration_locking` setting into account (#105938)

(cherry picked from commit 392c1a71c9)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
2025-05-23 15:15:38 +02:00
github-actions[bot] e0ba4b4809 apply security patch: release-11.6.2/security-patch-202505051005.patch 2025-05-21 21:12:31 +00:00
github-actions[bot] 679039d525 apply security patch: release-11.6.2/404-202504151210.patch 2025-05-21 21:12:30 +00:00
Michael Mandrus afacebf16e CloudMigrations: Fix issues with snapshot resource limits (#105425) (#105624)
* CloudMigrations: Fix issues with snapshot resource limits (#105425)

* fix bulk inserts

* commit progress so cursor doesn't sabotage me

* add more tests

* get everything working

* rename variable

* update comment

* regen mocks, fix k8s list method maybe

* fix bug with duplicate entries

* lint

* Snapshots: Use slices.Chunk for batching inserts

* remove extra linebreak

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>

* manually add unit tests

* make postgres integration tests happy

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
2025-05-19 15:48:26 -04:00
Artur Wierzbicki 59cdce6127 [release-11.6.2] Live: bump centrifuge (#105471)
* Live: bump centrifuge (#105214)

* bump centrifuge

* make update-workspace

(cherry picked from commit d91e4b0582)

* fix compilation error
2025-05-16 19:44:06 +04:00
Matheus Macabu c2ebce9fa4 [release-11.6.2] Dependencies: Bump packages in modules with incorrect dependencies or outside of workspace (#105458)
* Dependencies: Bump github.com/getkin/kin-openapi from v0.131.0 to v0.132.0

* Dependencies: Bump github.com/openfga/openfga from v1.8.6 to v1.8.12

* Dependencies: Bump golang.org/x to latest
2025-05-15 16:04:43 +03:00
Matheus Macabu bdcc804ca5 [release-11.6.2] Dependencies: Bump github.com/blevesearch/bleve/v2 from v2.4.4-git to v2.5.0 (#105443)
Dependencies: Bump github.com/blevesearch/bleve/v2 from v2.4.4-git to v2.5.0
2025-05-15 12:05:21 +02:00
Matheus Macabu fda0a9a32c [release-11.6.2] Dependencies: Bump github.com/openfga/openfga from v1.8.6 to v1.8.12 (#105369)
Dependencies: Bump github.com/openfga/openfga from v1.8.6 to v1.8.12
2025-05-14 14:17:01 +02:00
William Wernert df92cf28cd [release-11.6.2] Alerting: Ensure field validators return the proper type (#105284)
Alerting: Ensure field validators return the proper type (#104050)

* Ensure field validators return the proper type

This ensures correct error propagation through services up to
the API layer.

* Move error wrapping up to call site

(cherry picked from commit 820c338414)
2025-05-13 08:49:43 -04:00
Matheus Macabu 28a2c941cc [release-11.6.2] Dependencies: Unpin and bump github.com/getkin/kin-openapi from v0.126.0 to v0.132.0 (#105251)
Dependencies: Unpin and bump github.com/getkin/kin-openapi from v0.126.0 to v0.132.0
2025-05-12 14:52:44 +02:00
Matheus Macabu dbf8ab9182 [release-11.6.2] Chore: Bump Go version to 1.24.3 (#105103)
Chore: Bump Go version to 1.24.3
2025-05-08 14:42:34 +02:00
Artur Wierzbicki d62e13f9d0 [release-11.6.2] Live: logging fix (#105075)
Live: logging fix (#105054)

logg fix

(cherry picked from commit c781b0922e)
2025-05-07 21:48:18 +03:00
beejeebus e876303a5e Plugins: Fix support for adhoc filters with raw queries in InfluxDB (#105007)
Plugins: Fix support for adhoc filters with raw queries in InfluxDB  (#101966)

Plugins: Fix support for adhoc filters with raw queries in InfluxDB

Fixes #101635.
2025-05-06 13:31:58 -04:00
Kevin Minehart c28ee853ef [release-11.6.2] Backport workflow fixes (#104695)
* Copy workflows and actions from main

* add zizmor.yml
2025-04-29 19:15:11 +03:00
Todd Treece 2dcbe0b215 Dashboards: Fix lint issue (#104498) 2025-04-25 08:05:43 -04:00
github-actions[bot] cb147983f2 apply security patch: release-11.6.1/394-202504041254.patch
commit 062c1375784db35ff03d410113d104a9eea46475
Author: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
Date:   Fri Apr 4 13:50:50 2025 +0100

    APIs: Remove dashboard and folder registration
2025-04-22 21:24:22 +00:00
github-actions[bot] 5e30a9ec08 apply security patch: release-11.6.1/364-202504020728.patch
commit 5697757c8006732776de7f4385c2029bb01f67c6
Author: Andres Martinez Gotor <andres.martinez@grafana.com>
Date:   Mon Mar 31 12:15:52 2025 +0200

    Sanitize paths before evaluating access to route
2025-04-22 21:24:22 +00:00
Kevin Yu 760b9176fc [release-11.6.1] Prometheus: Add support for cloud partners Prometheus data sources (#103941)
Prometheus: Add support for cloud partners Prometheus data sources (#103482)

* wip

* Add prom flavor support for data source variables and export/import dashboards (#103321)

* add dashboard and data source var selection

* use match plugin id instead

* use updated matchpluginid

* formatting

* cleanup

* regex anchor

* update error msg

* Alerting: Clean up prometheus-flavored types and functions (#103703)

* clean up types and utility functions for dealing with
prometheus-flavored data sources

* Refactor alerting datasource types to use constants as source of truth

* Alerting: Clean up prometheus-flavored types and functions on the bac… (#103716)

Alerting: Clean up prometheus-flavored types and functions on the backend

* add matchPluginId tests

* Update matchPluginId func to bidirectional (#103746)

* update matchpluginid func to bidirectional

* lint

* formatting

* use actual isSupportedExternalRulesSourceType in test

* add tests in datasource_srv

* betterer

* remove type assertion

* remove unnecessary case

* use satisifies to not have to convert tuple to an array of string

* add prometheus_flavor test

---------

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Alexander Akhmetov <me@alx.cx>
(cherry picked from commit fd6fd91115)
2025-04-14 09:47:16 -07:00
xavi f393fb76e4 [release-11.6.1] [IAM] Prepend AppSubURL to redirectURI before validating it (#103875)
[IAM] Prepend AppSubURL to redirectURI before validating it (#103475)

(cherry picked from commit 5053aa576d)
2025-04-11 15:04:26 +02:00
Mariell Hoversholm 7a8ca707f9 [release-11.6.1] Go: Bump to 1.24.2 (#103523)
* Go: Bump to 1.24.2

It is not likely we are actually affected by the CVEs, but updating proactively is not a bad idea nonetheless.

Fixes: CVE-2025-22871
Fixes: https://github.com/grafana/grafana-operator-experience-squad/issues/1311

* CI: Update golangci-lint

* feat: update swagger

* feat: update swagger

* fix: remove enterprise imports
2025-04-09 08:43:59 +02:00
grafana-delivery-bot[bot] 7b6db626ad [release-11.6.1] unistore: use the same connection string as grafana (#103089)
unistore: use the same connection string as grafana (#102387)

(cherry picked from commit 4927376f32)

Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2025-03-31 16:10:49 +02:00
Ashley Harrison afa4843796 [release-11.6.1] Org redirection: Fix linking between orgs (#102870)
Org redirection: Fix linking between orgs (#102021)

* don't trim path

* add unit test

(cherry picked from commit f3fb9592da)
2025-03-26 12:46:29 +00:00
Matheus Macabu 798a546f24 [release-11.6.1] Dependencies: Bump github.com/redis/go-redis/v9 to 9.7.3 to address CVE-2025-29923 (#102863)
Dependencies: Bump github.com/redis/go-redis/v9 from 9.7.0 to 9.7.3
2025-03-26 10:53:50 +01:00
Denis Vodopianov b2605ed292 Chore: Update JWT library (CVE-2025-30204) (#102727)
* Chore: Update JWT library (CVE-2025-30204)

* Chore: Update JWT library (CVE-2025-30204)
2025-03-24 19:19:52 +01:00
Yuri Tseretyan b6bc0eeb3f [release-11.6.0] Alerting: Add migration to clean up rule versions table (#102562)
Alerting: Add migration to clean up rule versions table (#102484)

* add migration to clean up rule versions
* drop index right before creating a new one.
* fetch only rules which version greater than toKeep

(cherry picked from commit 24ebacb10b)
2025-03-20 22:40:47 +02:00
Matheus Macabu fef74521e9 Chore: Bump github.com/expr-lang/expr to v1.17.0 to address CVE-2025-29786 (#102533) 2025-03-20 14:53:25 +01:00
Mariell Hoversholm 5c0ee5cfcc [v11.6] App Platform: Pin bleve to fix CVE-2022-31022 (#102531)
App Platform: Pin bleve to fix CVE-2022-31022

This pins Bleve to a soon-to-be v2.5.0 commit.

Fixes CVE-2022-31022. We can unpin when v2.5.0 releases (likely March 25th).
We do not need any new features or similar, though there are some fixes that are nice to receive.

We will **not** backport this fix farther as we aren't actually vulnerable to anything via CVE-2022-31022; we never use its code, nor does Bleve. The reason we are fixing this is to get Trivy to stop complaining.
2025-03-20 14:19:44 +01:00
Alexander Akhmetov 07698ebbaa Revert "[release-11.6.0] Alerting: Add an index to alert_rule_versiontable on (rule_org_id, rule_uid) (#102353)" (#102367)
Revert "[release-11.6.0] Alerting: Add an index to alert_rule_version table on (rule_org_id, rule_uid) (#102353)"

This reverts commit c3a547e1c9.
2025-03-18 14:40:34 +01:00
Alexander Akhmetov c3a547e1c9 [release-11.6.0] Alerting: Add an index to alert_rule_version table on (rule_org_id, rule_uid) (#102353)
Alerting: Add an index to alert_rule_version table on (rule_org_id, rule_uid) (#102347)

(cherry picked from commit 9491fa1895)
2025-03-18 12:33:51 +01:00
Karl Persson 9a3864e603 Auth: Update to authlib (#101863)
Update to latest authlib
2025-03-10 11:08:40 +01:00
Stephanie Hingtgen b56db69b32 K8s: Dashboard History: Improve Error Handling (#101816) 2025-03-09 12:19:40 +03:00
Stephanie Hingtgen 9651505cb7 K8s: Dashboards: Fix provisioning (#101844) 2025-03-08 09:37:41 +03:00
Stephanie Hingtgen 473c0b5e89 K8s: Fix plugin updater (#101843) 2025-03-08 02:42:20 +02:00
Stephanie Hingtgen bd0c645ff0 K8s: Schema v2: Return 406 in /api (#101842) 2025-03-07 18:20:02 -06:00
Matthew Jacobson 19b878ce66 Alerting: Include time range in template dashboard and panel urls (#101095)
Alerting: Include time range in templated dashboard and panel urls

Time range:
from=Alert.StartsAt-1hr

Firing Alerts: to=Current Timestamp
Resolved Alerts: to=Alert.EndsAt
2025-03-07 15:28:56 -05:00
Juan Cabanas 5e21b9e2d1 Invite User: Add invite user button in top bar (#101809) 2025-03-07 16:09:59 -03:00
Matthew Jacobson b73c59547c Alerting: Re-encrypt existing contact points before get and patch in legacy config API (#101263)
* Test covering Get+Save interaction for newly secret fields

* Alerting: Re-encrypt existing contact points before get and patch
2025-03-07 13:26:48 -05:00
Yuri Tseretyan dc75b454f5 Alerting: Improve performance of the setting GUID during migration (#101800) 2025-03-07 12:28:07 -05:00
maicon 8c22459e1f Add debug info for encodeIdentityInMetadata (#101801)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-03-07 13:40:09 -03:00
Alexander Akhmetov 48ea9b08a2 Alerting: Add recording rule target datasource support to Prometheus conversion API (#101799)
What is this feature?

Adds target datasource UID to the recording rules so that they write to the same datasource used for alerting rule queries after the import.

Why do we need this feature?

Target datasourse support was added in #101678, and under a feature flag grafanaManagedRecordingRulesDatasources (#101778).

This PR makes the importing process:
    Check if the import contains recording rules
    Verify both recording rules and the grafanaManagedRecordingRulesDatasources feature flag are enabled
    If either check fails, return an error
    If both checks pass, create recording rules with the provided datasource UID set as both the query and target datasource
2025-03-07 16:56:24 +01:00
owensmallwood 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
Jean-Philippe Quéméner 2e0d2f3c76 fix(unified-storage): break dependency from dualwriter in resource module (#101788) 2025-03-07 15:27:31 +01:00
Gabriel MABILLE 6a1e5dd128 AuthZ: Test List (#101721)
* Authz: Test List

* Anonymous case

* Cover rendering
2025-03-07 15:01:39 +01:00
Ieva 392124de00 Service Accounts: Don't show error pop-ups for Service Account and Renderer UI flows (#101776)
* don't show error pop-ups for SAs and renderer

* only hide non 4xx error pop'ups

* linting
2025-03-07 13:37:26 +00:00
Steve Simpson 14ebec527c Alerting: Allow selection of recording rule write target on per-rule basis. (#101778)
* Alerting: Allow selection of recording rule write target on per-rule basis.

Introduces a new feature flag (`grafanaManagedRecordingRulesDatasources`),
disabled by default, to enable the ability to write recording rules data using
data source settings, and selecting the data source to use on a per-rule basis.

To cope with the scenario of users upgrading, a configuration file option
allows setting the default data source to use, if none is specified in the rule,
emulating the behaviour of recording rules without the flag enabled.

* Lint

* Update conf/sample.ini

Co-authored-by: Alexander Akhmetov <me@alx.cx>

---------

Co-authored-by: Alexander Akhmetov <me@alx.cx>
2025-03-07 14:30:40 +01:00
Matheus Macabu 5917ed8227 Hackaton: Add more unit tests, take 4 (#101704)
* cloudmigration/cloudmigrationimpl: run integration tests in parallel

* tsdb/mysql: run tests with actual service and instance manager

* pluginsintegration/angulardetectorsprovider: reduce job interval in test

* util: extract test that should only be ran with -race enabled and unskip it
2025-03-07 14:06:47 +01:00
Steve Simpson cc80681beb Alerting: Extend recording rules test to exercise writing with data sources. (#101775)
The change to use WriteDatasource was done in a previous commit, this adds a
test case using DatasourceWriter, in addition to the one using PrometheusWriter.
2025-03-07 13:51:50 +01:00
Will Assis 6544674011 fix(unified-storage): Fix dualwriter DELETE mode3 not returning error from legacy (#101728)
* Fix dualwrite package not returning error when getting a non-not found error from legacy storage in mode
2025-03-07 07:04:59 -05:00