* build(webpack): add tsconfig.json for Node strip-types compliance
* build(webpack): extract shared esbuild options to esbuild.ts
* build(webpack): add package.json to declare ESM module type
* build(webpack): convert sass.rule to TypeScript
* build(webpack): convert CorsWorkerPlugin to TypeScript
* build(webpack): convert FeatureFlaggedSriPlugin to TypeScript
* build(webpack): convert webpack.common to TypeScript, add theme entries
* build(webpack): convert webpack.dev to TypeScript, remove esbuild duplication
* build(webpack): convert webpack.prod to TypeScript, remove esbuild duplication
* build(webpack): fix TypeScript types in webpack.prod transform callback
* build(webpack): convert webpack.stats to TypeScript
* build(webpack): update scripts to use TypeScript webpack configs
* build(webpack): simplify env-util to use import.meta.dirname directly
* build(webpack): tidy up plugins
* build(webpack): move rules for ts and sass into single module
* build(webpack): consolidate shared config into common, move splitChunks to prod
- Move MiniCssExtractPlugin, esbuildRule and sassRule into common so both
dev and prod configs share them without duplication
- Move splitChunks/runtimeChunk optimisation to webpack.prod only (not
needed in dev)
- Use require() for SubresourceIntegrityPlugin to work around broken ESM
build (waysact/webpack-subresource-integrity#236)
- Refactor conditional plugin logic in dev from ternary to if-blocks
* build(webpack): remove dead import and clarify webpack destructure pattern
- Remove unused MiniCssExtractPlugin import from webpack.prod (moved to common)
- Add comment explaining why DefinePlugin/EnvironmentPlugin are destructured
from the default webpack import rather than using named ESM imports
* style(webpack): reorder consts
* chore(env-util): fix up env-util and webpack configs so tests continue to run
* refactor(env-util): accept grafanaRoot param instead of relying on __dirname
Removes the global.__dirname mutation hack in webpack.common.ts by making
the grafana root path an explicit argument to getEnvConfig. Each caller
resolves its own root and passes it in, removing the implicit path-depth
contract and the CJS/ESM compatibility workaround.
* build(webpack): remove unused angular chunk group
* refactor(frontend): rename assetSriChecks and generate go
* feat(frontend-service): pass sri checks feature flag to frontend html template
* feat(backend): pass asset sri check feature flag to st frontend template
* build(webpack): use global __grafanaAssetSriChecksEnabled var to control sri checks in async loading
* chore(frontend-service): add assetSriChecks to goff-flags.yaml
* docs(webpack): add more info on what and why to featureflaggedsriplugin
* Build: Upgrade TypeScript to 6.0 beta
Update typescript from 5.9.2 to 6.0.0-beta across all packages. Configure tsconfig to handle TS 6.0 breaking changes: add `ignoreDeprecations: "6.0"` to suppress warnings for deprecated options, disable `noUncheckedSideEffectImports` to allow CSS side-effect imports, explicitly configure `types` field since TS 6.0 no longer auto-includes all @types packages, set appropriate `rootDir` in packages that include files outside their directory, and update `@ts-ignore` comment placement in Table utils to match where TS 6.0 now reports the type error.
All typecheck tests pass with 0 errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add explicit rootDir to root tsconfig for ts-jest compatibility
TS 6.0 requires rootDir to be explicitly set when it differs from the
inferred common source directory. Without this, ts-jest fails with
TS5011 when running unit tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix package builds: add rootDir and jquery types for TS 6.0
TS 6.0 requires explicit rootDir in tsconfigs that emit output. Add
rootDir to all package build configs that were missing it. Also add
jquery to the base types array since @types/jquery is no longer
auto-included.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix TS 6.0 errors in e2e and plugin tsconfigs
- e2e/tsconfig.json: Add moduleResolution: "bundler" to fix TS5098
(customConditions requires bundler/node16/nodenext moduleResolution)
- packages/grafana-plugin-configs/tsconfig.json: Add ignoreDeprecations: "6.0"
to fix TS5101 (downlevelIteration deprecated) inherited from @grafana/tsconfig,
cascading to all 15 datasource plugins and 3 e2e-playwright test plugins
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix package build output: use rootDir: "./src" instead of "."
rootDir: "." caused type declarations to emit to dist/types/src/
instead of dist/types/, breaking the published package types paths.
Using rootDir: "./src" preserves the correct output structure while
satisfying TS 6.0's requirement for an explicit rootDir.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Align TS 6.0 changes with tsgo PR (#114643)
- Remove baseUrl in favor of path mapping ("*": ["./public/*"])
- Add rootDir: "./src" to grafana-sql and grafana-test-utils tsconfigs
- Add explicit Size type annotations to AutoSizer callbacks
- Add explicit type params to MultiSelect<string> in LokiContextUi
- Update @ts-ignore comments for TS5/TS6/TS7 compatibility
- Switch JS files to @ts-nocheck (eslint.config.js, env-util.js)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Build: Upgrade TypeScript from 6.0.0-beta to 6.0.1-rc
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Build: Upgrade TypeScript from 6.0.1-rc to 6.0.2 stable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix o11y-ds-frontend package build: add rootDir to build config
Same fix as other packages — the build config was inheriting
rootDir: "../../" from tsconfig.json, causing type declarations
to emit to the wrong path.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* build(frontend-service): update webpack and ts configs for boot script
* feat(frontend): add types to window for boot/index.ts
* feat(frontend-service): copy JS from index.html to boot/index.ts, add types and refactor guards
* chore(codeowners): add public/boot
* chore(frontend-service): copy boot.js into dockerfile for dev
* docs(boot): add a readme to briefly explain the purpose
* 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
* 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.
* 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>
* attempting to "fix" geomap
* copy gazetteer/maps folders into dockerfile for frontend service
* add TODO comments
* remove unused import
* conditionally use public cdn path
* fix unit tests
* try refactor e2e test for better stability
* Revert "try refactor e2e test for better stability"
This reverts commit d966d68e15.
* safer
* use grafana_public_path
* Update dependency eslint-webpack-plugin to v5
* set failOnError: false to match previous behaviour
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* feat(featuremgmt): introduce feature toggle for enabling sri checks
* feat(frontend): use assetSriChecks feature toggle to inject integrity hash into script tags
* chore(webpack): align sri algorithms across dev and prod builds
* docs(featuremgmt): update assetSriChecks to pass CI
* docs(featuremgmt): fix more spelling complaints with assetSriChecks
* Add crossorigin attribute
* chore(webpack): add subresource-integrity plugin
* build(webpack): wrap webpack jsonp loader integrity checks in feature flag checks
* revert(index.html): remove crossorigin attribute if assertSriChecks is disabled
---------
Co-authored-by: Kristian Bremberg <kristian.bremberg@grafana.com>
* build(webpack): add a stats config and build:stats script for analysing bundles locally
* chore(yarn): dedupe lock file
* feat(webpack): use bundle analyser by default, env vars for additional plugins
* refactor breakdown scene
* refactor BreakdownScene along with LayoutSwitcher
* rename
* don't pass default layout
* better type handling
* betterer
* add @bsull/augurs
* implement LabelBreakdownScene
* integrate SortByScene in LabelBreakdownScene
* move to new directory
* introduce BreakdownSearchScene
* integrate searchScene
* cleaning
* initialize @bsull/augurs
* add interaction
* use new breakdown scene
* resolve merge conflicts
* ugrade @bsull/augurs
* update import
* update css
* update tooltip text
* refine sorting
* fix unit test
* fix
* implement outlier detector
* support wasm
* jest testing fix
* localization fix
* use unknown instead of any
* update i18n
* update betterer
* fix locales
* update test
* fix tests maybe
* prettier
* chore: update jest config
* chore: create mock for @bsull/augurs (#92156)
chore: create mock for bsull/augurs
@bsull/augurs assumes it will be running as an ESM, not
a CommonJS module, so can't be loaded by Jest (specifically
because it contains a reference to import.meta.url).
This PR provides a mock implementation which gets tests passing
again.
Ideally we'd be able to load the actual @bsull/augurs module
in tests so this is just a stopgap really, until a better
solution appears.
* fix unit tests
* remove unused BreakdownScene.tsx
* set outliers as undefined if an error occurs
* Add labels
* betterer
* reset event implemented
* fix controls positioning
* update augurs
* betterer
* i18n
* conflict fixes
* update texts
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
Co-authored-by: Ben Sully <ben.sully@grafana.com>
* build(webpack): set publicpath and process urls to resolve assets correctly
* build(webpack): add back --progress to build
* Add local cdn
(cherry picked from commit 7a19523fa476fd5ff2d7669d116f5be462b100f5)
* chore(devenv): fix local_cdn path in ngnix conf
* chore(codeowners): add frontend-ops as owners of local_cdn docker block
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* build(webpack): extract css imports into files including node_modules
* feat(webassets): add cssfiles to entrypoint assets for extracted css files
* feat(views): add entrypoint css link tags to html templates
* feat(webassets): set CDN prefix for CSS files
* test(webassets): trim down sample-assets-manifest, fix failing snapshot tests
* Update pkg/api/webassets/webassets_test.go
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* build(webpack): remove css module loader
---------
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* update eslint, tsconfig + esbuild to handle new jsx transform
* remove thing that breaks the new jsx transform
* remove react imports
* adjust grafana-icons build
* is this the correct syntax?
* try this
* well this was much easier than expected...
* change grafana-plugin-configs webpack config
* fixes
* fix lockfile
* fix 2 more violations
* use path.resolve instead of require.resolve
* remove react import
* fix react imports
* more fixes
* remove React import
* remove import React from docs
* remove another react import
* Wip
* Wip
* Adapt to load external module
* build: remove cloudmonitoring from built_in_plugins, clean up webpack output
* chore(plugins): remove decoupled plugins from package.json deps
* chore(codeowners): update file for nx.json
* revert(webpack): put back path in config
* build(frontend): use nx to run prod builds of decoupled plugins with yarn build
* style(prometheus): run prettier-write to fix tsconfig.json
* style(backend): remove unused subFile.isDistDir
* revert(locales): remove formatting changes adding new line at end of files
* chore(webpack): clean up dev output
* build(nx): make grafana an nx project, bump lerna and nx
* build(plugin-configs): move cache directory to node_modules
* style(datasource-plugins): add eslint ignore for .gen.ts files
* chore(codeowners): add frontend-ops as owner of project.json
* build(webpack): add getDecoupledPlugins to automatically ignore when watching
* ci(drone): skip nx cache when building frontend packages
* style(ci): fix missing trailing comma
* Revert "style(ci): fix missing trailing comma"
This reverts commit 7520d41576.
* Revert "ci(drone): skip nx cache when building frontend packages"
This reverts commit 46938883ac.
* feat(zipkin): remove from grafana core bundle
* chore(npm): bump nx package to latest 18.0.8
* docs(dev-guide): add a note about what yarn start now builds
---------
Co-authored-by: Andres Martinez <andres.martinez@grafana.com>
* Update dependency webpack-dev-server to v5
* update webpack.hot config (is this even used anymore?)
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* chore(monaco): bump monaco-editor to latest version
* feat(codeeditor): use esm to load monaco editor
* revert(monaco): put back previous version
* feat(monaco): setup MonacoEnvironment when bootstrapping app
* feat(monaco): load monaco languages from registry as workers
* feat(webpack): clean up warnings, remove need to copy monaco into lib
* fix(plugins): wip - remove amd loader workaround in systemjs hooks
* chore(azure): clean up so QueryField passes typecheck
* test(jest): update config to fix failing tests due to missing monaco-editor
* test(jest): update config to work with monaco-editor and kusto
* test(jest): prevent message eventlistener in nodeGraph/layout.worker tripping up monaco tests
* test(plugins): wip - remove amd related tests from systemjs hooks
* test(alerting): prefer clearAllMocks to prevent monaco editor failing due to missing matchMedia
* test(parca): fix failing test due to undefined backendSrv
* chore: move monacoEnv to app/core
* test: increase testing-lib timeout to 2secs, fix parca test to assert dom element
* feat(plugins): share kusto via systemjs
* test(e2e): increase timeout for checking monaco editor in exemplars spec
* test(e2e): assert monaco has loaded by checking the spinner is gone and window.monaco exists
* test(e2e): check for monaco editor textarea
* test(e2e): check monaco editor is loaded before assertions
* test(e2e): add waitForMonacoToLoad util to reduce duplication
* test(e2e): fix failing mysql spec
* chore(jest): add comment to setupTests explaining need to incresae default timeout
* chore(nodegraph): improve comment in layout.worker.utils to better explain the need for file
* Chore: webpack alias react and grafana-runtime to share singletons
* Move alias to dev webpack, add alias for grafana-data as well
* remove whitespace
* Chore: Use yarn node-modules linker
* fix react-router types resolution
* temp skip failing tests
* remove yarn-links for internal path aliases to fix some webpack errors
* transpile all .ts files, even those in node_modules (usually our internal workspace packages
* fix transformers mock
* import react router type directly
* remove old resolution
* more cleanup
* remove preserveSymlinks: true from tsconfig to make Go To Definition resolve grafana ui to the original location
* developer guide
* update dev guide
* remove sdks
* reenable tests
* fix tsconfig trailing commas (where did they come from)