Commit Graph

1732 Commits

Author SHA1 Message Date
Kristina
914df157d6 Correlations: Add E2E tests (#119339)
* WIP

* Make transformations properties optional, create correct object for partial spec

* update the generated client type, fix logic for submission of transformations

* Update readme with what is needed for updating the client

* Move logic to utils, add test

* Add tests to increase coverage

* continue to build out test coverage

* Add tests

* Add create correlation

* WIP improve function coverage

* fix test

* wip add notification on edit

* Moving directories

* Move back as we are no longer rendering with a wrapper

* Run the generator

* Add scaffolding and reorganize tests

* WIP

* WIP

* add meta property to prevent error

* Move handler logic to support different list scenarios

* Add create scenario, turn on the tests

* fix the casing

* Cleanup

* Lint cleanup

* test files must contain tests…

* fix the import

* Move handlers out of test-utils

* empty commit

* add remaining tests from correlationspage legacy, add other endpoint scenarios

* WIP - work on fixtures

* Remove debugging garbage, turn on all tests, get editing working

* Clean up some unneeded boilerplate, consolidate fake correlation stuff

* more cleanup found by linter

* WIP - have datasources lookup actually apply to set, skip test to debug later, fix renaming requirements for datasources

* Add note about skipping provisioning tests for now and unskip this test that actually works fine

* Reorganize to simplify and remove circ dependency

* Rename directory to exclude it from code coverage test

* cleanup
2026-03-10 09:28:36 -05:00
Hugo Häggmark
67e565af2e e2e: add tests for new plugin meta api (#119060)
* e2e: add tests for new plugin meta api

* chore: remov aggregation feature toggle

* chore: yarn generate:openapi
2026-03-10 13:14:31 +01:00
Matheus Macabu
9b1e10c249 Go: Update to 1.25.8 (#119692) 2026-03-06 10:27:09 +01:00
Josh Hunt
23c6c1e50b CI: Speed up Playwright e2e tests workflow (#119277)
* CI: Replace Dagger builds with native make for Playwright e2e tests

Switch from Dagger-based builds to native Go/JS builds for the
Playwright e2e test pipeline. Grafana now runs as a native binary
on the CI runner instead of in a Docker container.

Key changes:
- build-backend: actions/setup-go + make build-go (instead of Dagger)
- build-frontend: actions/setup-node + make build-js + yarn e2e:plugin:build
- run-playwright-tests: downloads artifacts, uses start-server script
  to run Grafana natively (instead of Docker container from GHCR)
- build-grafana: standalone full Dagger build, off the Playwright
  critical path (still produces Docker/tarball for push-docker-image
  and run-a11y-test)
- required-playwright-tests: no longer depends on build-grafana
- Remove debug env vars (ACTIONS_STEP_DEBUG, RUNNER_DEBUG)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Fix zizmor template-injection: use docker/login-action for GHCR login in Playwright job

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Replace GHA service container with docker run for Grafana

GHA service containers start before any step (including checkout), so
volume-mounted config files don't exist yet and Grafana crashes. The
health check never passes, blocking all steps from running.

Switch to docker run -d in a step after checkout, so all files are
available when the container starts. This eliminates the need for the
docker restart workaround and the zizmor unpinned-images suppression.

Verified locally: built all three Dagger steps (backend, frontend,
assembly with --import-dir + chmod +x), loaded the Docker image, and
confirmed Grafana starts successfully with volume-mounted config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Fix Docker image binary permissions lost by actions/upload-artifact

actions/upload-artifact strips execute permissions (all files become 644).
The backend binaries need +x restored before Dagger packages them into the
Docker image, otherwise the container fails with "Permission denied" when
trying to exec the grafana binary.

Verified locally: pulled the CI-built image from GHCR, confirmed binaries
had 664 permissions, added chmod +x, and tested the full service container
restart flow successfully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Fix CI failures: pin docker/login-action, fix docker tarball glob, suppress zizmor unpinned-images

- Pin docker/login-action@v3 to hash @5e57cd118135c172c3672efd75eb46360885c0ef
- Use glob *.docker.tar.gz in push-docker-image (Dagger produces versioned filenames)
- Add unpinned-images ignore for pr-e2e-tests.yml (dynamic build output image)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

CI: Fix missing bundled-plugins directory in build-grafana

actions/upload-artifact skips empty directories, so the bundled-plugins
dir (empty in OSS builds) doesn't exist after download. Create it before
running Dagger to prevent the --import-dir from failing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

CI: Speed up Playwright e2e tests workflow

Split the monolithic Grafana build into three Dagger jobs (backend, frontend, assembly) with granular caching. Use the --import-dir flag to pre-populate the artifact store, skipping compilation in the assembly step. Run Playwright shards in parallel with 4 workers instead of 1, reduced from 8 to 6 shards, and use GHA service containers with bind-mounted config instead of building custom e2e Docker images. Add workflow concurrency, job timeouts, and dependency caching. This reduces critical path from ~32 minutes to ~17 minutes on cold builds and ~9 minutes with warm caches.

Expected impact:
- Parallel backend/frontend builds save 6-8 minutes (vs sequential)
- GHA output cache hits reduce builds to 0 seconds on cache hit
- Docker service container approach eliminates per-shard overhead (5-7 min saved)
- 4 workers per shard and reduced retry count improve test throughput
- Workflow concurrency prevents wasted runs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

try merging frontend artifact

run the tests

shard tree artifact, delete artifacts, fix ts files being excluded

copy bin

fix path

fix path

fix script

another try

fix incorrect permissions

* try stitching together standalone grafana build

* include more dirs in frontend build

fix paths

* try caching node-modules better

try caching node-modules

disable YARN_ENABLE_HARDENED_MODE

temporarily stop caching node_modules to test performance

temp don't cache node_modules to measure perf

fix frontend cache

* add script for downloading the report and viewing it locally

* Update codeowners

* Add workflow to build grafana docker image

* add placeholder check

* Use hosted runners for everything

* Bump actions versions

* Don't cache playwright browser installs

* build e2e test plugins in each shard

* Split bench report into seperate step

and update bench to v1

* try packaging less of the public dir

* Package up whole public directory

its needed for some reason

* Run the grafana server migrations in the background while playwright installs

* Fix flaky time picker preferences tests

* Fix detect-changes always running e2e tests

* Skip building frontend source maps

* Don't check out repo in report steps

* Add per-shard failure instructions
2026-03-05 12:54:49 +00:00
Peter Štibraný
80b05aa67c Fix pkgs-with-tests-named.sh matching tests from subdirectories (#119501)
* Fix pkgs-with-tests-named.sh matching tests from subdirectories

The find command was recursive by default, causing packages to be
included in the results based on test functions in subdirectory packages.
Adding -maxdepth 1 matches Go's package semantics where only files in
the same directory belong to a package.

* ci: trigger integration tests for backend test script changes
2026-03-04 16:18:17 +01:00
Josh Hunt
d9d472117c GHA: Remove pa11y (#119489)
Remove pa11y
2026-03-04 12:54:19 +00:00
Ryan McKinley
cec794bd6b OpenAPI: Fix URL property (#119093) 2026-02-26 13:03:02 +00:00
Hugo Häggmark
7c09ddf2df chore: exclude grafana-openapi from Levitate checks (#119061) 2026-02-26 08:15:10 +00:00
Costa Alexoglou
9aaf4f5ac9 revert 1.26 (#118568)
* revert 1.26

* more updates

* new go.sum

* revert some go.mod entries

* updagte swagger and openapi

* more reverting and codegen

* test fix and make gen-apps
2026-02-20 15:09:49 +00:00
Ashley Harrison
2d4f33338c React 19: Build assets with React 19 (#118457)
* build with react 19

* don't copy assets-manifest-react19 into FS

* handle react19 in dev config
2026-02-20 14:41:43 +00:00
Austin Pond
3ed58adf59 [chore] Update go to v1.26.0, and the golangci-lint action to v9 (#118436)
* [chore] Update go to v1.26.0, and the golangci-lint action to v9.

* Use golangci-lint v2.9.0

* Use golang:1.26.0-alpine instead of 1.25.7-alpine

* chore: more go version upgrades

* chore: more updates

* chore: generate apis

* fix: golint issues prealloc etc

* fix: million tiny golint issues

---------

Co-authored-by: konsalex <konstantinos.alexoglou@grafana.com>
2026-02-19 15:04:35 +01:00
Andres Martinez Gotor
35c905133c Add e2e smoke test for Advisor functionality (#118219) 2026-02-19 13:26:40 +01:00
Marcus Andersson
c3cce293e8 Schema: Re-introduce exports for the schema package (#116683)
* wip

* added fallback exports.#

* renamed files to new pattern to follow exports.

* added fallback exports.

* added more exports.

* wip

* wip

* wip.

* Updating rollup to output proper paths.

* wip

* wip

* reverted new export APIs, will be done in follow up PRs.

* fixed rollup config.

* replaced imports with new proper exports.

* fixed tests.

* renamed missing file.

* fixed error.

* Needed to make the file names shorter due to publint limitations.

* Fixed issue with generated index fiels.

* fixed preferences export as well.

* reverted import.

* fixed conflicts.

* fixed issue with type imports.

* fixed so we are backwards compatible with the node moduleresolution.
2026-02-11 22:27:26 +01:00
Matheus Macabu
0906d81bfd Secrets: Clean up secretsManagementAppPlatform (#117873) 2026-02-11 16:01:21 +01:00
Matheus Macabu
bd2caad64c Dependencies: Update OpenFGA to v1.11.3 (#117575) 2026-02-09 10:08:06 -06:00
Matheus Macabu
2658757b0a Go: Update to 1.25.7 (#117470) 2026-02-05 14:16:34 +01:00
Hugo Häggmark
3af2fdcca1 fix: updates the regex for circular deps (#117375) 2026-02-04 09:01:49 +00:00
Hugo Häggmark
c7df0668e7 fix: add missing comma to metrics output (#117368) 2026-02-04 08:09:04 +00:00
Hugo Häggmark
285133cbea chore: add circular dependencies linter (#117367)
* chore: add circular dependencies linter

* chore: adds circular dependencies to metrics
2026-02-04 08:31:38 +01:00
Alex Spencer
e04a9a80bb fix (transformations): only generate markdown when script is run (#117359)
fix: only generate markdown when script is run
2026-02-03 16:02:42 -08:00
Matthew Jacobson
923239d48d Alerting: Add support for multiple named notification policies (#116945)
This PR introduces multiple named notification policies to Grafana Alerting. In addition to the existing single "user-defined" routing tree, notification policies can now be created, managed, selected by alert rules, and provisioned individually.

The feature is gated behind an experimental feature flag alertingMultiplePolicies. When the flag is disabled, the system behaves exactly as before and continues to expose a single legacy routing tree in both frontend and backend APIs.
2026-02-03 16:05:13 -05:00
Kevin Minehart Tenorio
cc700a6372 chore: remove unused 'revive' binary (#116796) 2026-01-25 12:12:10 +03:00
Jesse David Peterson
4623a00050 Tests: Check frontend test coverage CI workflow (#116633)
* chore(git): ignore coverage summary from CI workflow

* feat(script): check if files changed for a codeowner

* feat(ci): clean up PR comments when break glass label applied

* feat(ci): add change detection to coverage workflow

* feat(ci): conditionally run coverage checks only for teams changed files

* feat(ci): compare code coverage reports by codeowner

* feat(ci): improve PR comment message

* feat(ci): add skip warning with opted-in teams list

* fix(scripts): avoid rounding errors in test coverage summaries

* fix(script): fix GHA linting errors

* fix(script): multiple space delimited filenames in change detection

* fix(scripts): round to two decimal points of precision

* feat(script): collector job to fan-in coverage comparison matrix

* fix(script): display correct git SHA

* fix(script): serial execution in each test suite for deterministism

* fix(script): use base branch SHA, not ref for main

* fix(script): ignore CI scripts written in Node.js and Jest config file

* fix(script): post failure message when coverage drops

* fix(script): use correct SHAs in PR comment message

* fix(script): fail when any one of the coverage comparisons fail

* fix(script): use the same PR comment bot for all messages

* fix(script): use the same token so comments are cleared when re-run etc.

* feat(script): make PR message more concise
2026-01-22 09:46:04 -04:00
Jesse David Peterson
374eaf5797 Tests: Bootstrapping for CI workflow to compare PR test coverage with main (#116500)
* feat(script): dasherize codeowner names for GHA safe artifact slugs

* feat(script): emit coverage summary report JSON from test runner

* feat(script): compare code coverage between a PR and main by codeowner

* feat(ci): skeleton of future workflow to compare code coverage

* chore(codeowners): the DataViz team owns now code coverage checks
2026-01-19 14:48:52 -04:00
Matheus Macabu
72493aa3a0 Go: Update to 1.25.6 (#116394) 2026-01-16 10:50:12 +01:00
Jack Westbrook
8bad33de4c Grafana/data: Fix theme types schema resolution (#116240)
* fix(grafana-data): copy theme schema json to types so declaration resolves

* refactor(grafana-data): move node scripts out of source code

* feat(grafana-data): generate types for theme schema

* chore(codeowners): update for grafana-data/scripts file move

* feat(grafana-data): put back copy plugin for theme json files

* revert(grafana-data): remove definition output

* feat(grafana-data): make builds great again

* minor tidy up

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2026-01-14 12:05:23 +00:00
Jack Westbrook
23a51ec9c5 CI: Fix frontend package validation (#116104)
* ci(frontend-lint): add frontend package change detection and add validate packed packages lint step

* ci(change-detection): add validate-npm-packages.sh to frontend-packages list

* ci(gh-workflows): add actions globs to frontend-packages detection

* ci(gh-workflows): fix typo - > _

* ci(frontend-lint): add missing needs

* chore(i18n): fix publint erroring for custom condition pointing to .cjs file

* ci(validate-npm-packages): make profile node16 default

* chore(validate-npm-packages): remove shellcheck disable comment
2026-01-12 16:08:32 +01:00
Matheus Macabu
a56fa3c7b5 Revert "Secrets: Remove unused register_api_server setting" (#116004)
Revert "Secrets: Remove unused register_api_server setting (#113849)"

This reverts commit 4ee2112ea4.
2026-01-09 11:01:46 +01:00
Matheus Macabu
dff9bea3e8 Reporting: Add feature toggle for CSV encoding options (#115584) 2026-01-08 13:56:54 +01:00
Jack Westbrook
5bedcc7bd7 Frontend: use custom conditions for development and build (#111685)
* build(frontend): enable custom condition for resolving source files during dev and build

* feat(packages): apply conditional name to export properties

* chore(packages): add standard exports to flamegraph and prometheus

* chore(packages): resolve main, module, types to built files

* build(packages): clean up prepare-npm-package for custom condition changes

* refactor(packages): reduce repetition in conditional exports

* build(storybook): add @grafana-app/source to conditionNames

* test(frontend): add grafana-app/source customCondition for jest tests

* refactor(frontend): remove nested package import paths

* chore(jest): use customExportConditions for source files and browser

* chore(i18n): use src for ./eslint-plugin export

* chore(packages): set packages tsconfigs to moduleResolution bundler

* chore(packages): fix rollup builds

* build(packages): build cjs as multiple files

* chore(sql): reference MonitoringLogger for moduleresolution bundler to pass typecheck

* chore(ui): add type refs for moduleresolution bundler to pass typecheck

* feat(schema): add exports for cleaner import paths

* refactor(frontend): clean up schema paths to point to exports instead of nested file paths

* build(storybook): hack the builder-manager for custom conditions to resolve

* build(decoupled-plugins): fix broken builds due to missing conditionNames

* chore(e2e): pass condition to playwright to resolve local packages

* build(frontend): fix failing build

* chore(select): fix typings

* style(frontend): clean up eslint suppressions

* chore(packages): fix type errors due to incorrect tsconfig settings

* build(generate-apis): use swc with ts-node and moduleResolution bundler

* chore(cypress): add conditionNames to resolve monorepo packages

* build(npm): update prepare to work with latest exports changes

* build(packages): fix prepare-npm-package script

* fix(e2e-selectors): update debugoverlay for data-testid change

* build(packages): stop editing package.json at pack n publish time

* rerun ci

* chore(api-clients): use moduleResolution: bundler for customConditions support

* chore(api-clients): fix generation

* build(packages): remove aliasing exports, remove exports with only customConditions

* Revert "refactor(frontend): clean up schema paths to point to exports instead of nested file paths"

This reverts commit 7949b6ea0e60e51989d2a8149b7a24647cd68916.

* revert(schema): remove exports from package so builds work

* build(api-clients): fix up api-clients exports and rollup config

* build(api-clients): Update generated package exports for api clients

* build(schema): add overrides to cjsOutput and esmOutput so built directory structure is correct

* fix(packages): use rootDirs to prevent types/src directories in built d.ts file paths

* build(packages): prevent empty exports added to package.json during pack

* docs(packages): update readme with custom conditions information

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-12-18 11:47:38 +01:00
Erik Sundell
8ebb1c2bc9 NPM: Remove dist-tag code (#115209)
remove dist-tag
2025-12-12 11:41:57 +01:00
Erik Sundell
c3224411c0 NPM: Use env var for OIDC token auth instead of direct npmrc (#115153)
* use env var

* ignore spellcheck
2025-12-12 07:45:04 +01:00
Jack Baldry
1611489b84 Fix path to generation and source content (#115095)
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2025-12-11 21:40:35 +00:00
Erik Sundell
0c82f92539 NPM: Attempt to fix e2e-selectors dist-tag after OIDC migration (#115012)
* fetch oidc token from github

* use same approach as electron
2025-12-11 14:35:27 +01:00
Hugo Häggmark
3490c3b0fd e2e: add tests for translations (#114390)
e2e: add tests for translations
2025-12-08 10:19:44 +01:00
Matheus Macabu
3e50bfced8 Dependencies: Bump Go to v1.25.5 (#114749) 2025-12-03 10:18:31 +01:00
Erik Sundell
ae2e5f0df7 NPM: Fix e2e-selectors change detection (#114471)
fix git cmd
2025-11-26 13:11:44 +01:00
Kristina Demeshchik
834f1c5e98 TS checker: Increase memory limit (#114236)
Increase ts checker memory limit
2025-11-20 09:13:19 -05:00
Matheus Macabu
4ee2112ea4 Secrets: Remove unused register_api_server setting (#113849) 2025-11-13 09:26:04 -08:00
Michael Mandrus
cf242def3a Secrets: Refactor data_key_id out of the encoded secure value payload (#112077)
* Secrets: Refactor data_key_id out of the encoded secure value payload (#111852)

* everything compiles

* tests pass

* remove file included by accident

* add entry to gitignore

* some scaffolding for the migration executor

* remove file

* implement and test the migration

* use xkube.Namespace in our interfaces

* add todo

* update wire deps

* add some logs

* fix wire dependency ordering

* create tests to validate error conditions during migrations

* only run the migration as an MT api server

* formatting issues

* change detection of secrets running as MT server

* add todo

* use more specific initializer flags

* make secrets playwright tests work

* set new properties to true by default

* remove developer mode flag

* fix unit tests
2025-10-30 23:04:32 -04:00
Tom Ratcliffe
811ee99dac API clients: Extract into a package (#111810)
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2025-10-23 13:57:51 +00:00
Paul Marbach
123e46c33b Coverage: Add some DX improvements to by codeowner script (#112673)
* Coverage: Add some DX improvements to by codeowner script

* Potential fix for code scanning alert no. 3796: Shell command built from environment values

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 3797: Shell command built from environment values

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix package.json and yarn lock

* reorder imports

* fix issue for frontend-platform: exclude files in any /test/ dir

* wip

* add ora spinner for codeowners manifest step

* cleanup

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-10-22 15:09:39 -04:00
Josh Hunt
f7070b8ccc NPM: Improve package validation (#112426)
* update validation script to run all checks, but fail if any fail

* fix package validation

* reduce comment
2025-10-21 10:32:57 +01:00
Ryan McKinley
8b319086e7 Correlations: Add RTK client (#112538)
add correlations RTK client
2025-10-19 23:04:26 -05:00
Tom Ratcliffe
045a590600 Chore: Fix broken test after markdown move (#112474) 2025-10-15 18:54:57 +00:00
Matheus Macabu
db5b275ed4 Go: Update to 1.25.3 (#112359) 2025-10-14 12:21:27 +02:00
Matheus Macabu
9a2a314dc9 E2E: Use standalone Image Renderer for tests instead of plugin (#112266)
* E2E: Use standalone Image Renderer for tests instead of plugin

* E2E: Allow configuring image renderer version if needed
2025-10-14 09:21:54 +02:00
Leon Sorokin
6cdb7114a9 Chore: Disable webpack cache for noMinify builds (#112241) 2025-10-10 10:01:36 -05:00
Matheus Macabu
ff448240c1 Makefile: Change build-go to only build the binaries, and deprecate build-go-fast (#111986) 2025-10-08 15:04:36 +02:00
Matheus Macabu
69184b5027 Go: Update to 1.25.2 + golangci-lint v2.5.0 + golang.org/x/net v0.45.0 (#112149)
* Go: Update to 1.25.2

* golangci-lint: Update to 2.5.0

* Dependencies: Bump golang.org/x/net to v0.45.0
2025-10-08 12:35:28 +02:00