39 Commits

Author SHA1 Message Date
66323b2a19 Internationalisation: More markup in prometheus/grafana-data (#108378)
* mark up units

* remaining category markup

* prometheus translations...

* load prom resources in core

* more prom markup

* don't load prometheus resources directly in core

* isolate @grafana/data import in jest-setup to prevent side effects in tests

* directly use tz
2025-07-22 17:57:05 +01:00
b6580ccb10 E2E: migrate to playwright (#107241)
* separate playwright into its own folder

* better separation

* add login scenario, add tags

* remove ui option

* update CODEOWNERS

* add a panels suite test

* migrate queries test to playwright

* rename + add dashlist test

* add panelEdit_base

* add geomap map controls test

* add geomap-layer-types

* add geomap-spatial-operations tests

* add frontend-sandbox-panel tests

* add smoke-tests-suite

* add comment about adding datasource

* add dashboard-browse-nested

* add dashboard-browse

* add dashboard-export-json

* add dashboard-keybindings test

* remove @wip tag

* turn on screenshots and add comment for why this test fails

* add dashboard-links-without-slug test

* try adding permissions in the test as well

* add dashboard-live-streaming

* context in the test doesn't work - sad

* create dashboard-public-templating

* add dashboard-public-create and make live streaming more resilient

* add share externally test

* add dashboard-share-internally

* add share-snapshot-create test

* add dashboard-templating

* add timepicker tests

* add embedded-dashboard test

* add general_dashboards test

* add import-dashboard test

* add load-options-from-url test

* add new-constant-variable test

* add custom-variable test

* add new-datasource-variable test

* add new-interval-variable test

* add text-box-variable test

* add new-query-variable test

* add horizontal repeat test

* add panel-vertical-repeat test

* add empty-row-repeat test

* add set-options-from-ui test

* add snapshot-create test

* add templating test

* add textbox-variables test

* add cloud-plugins-suite

* add storybook verification tests

* add playwright storybook verification workflow

* add playwright browsers

* update CODEOWNERS

* test change to trigger storybook verification workflows

* try container instead

* get the version right...

* go back to installing - less chance of forgetting to update

* Basic Github Actions

Squashed commit of the following:

commit f84c650a71bba339da7f96303292717569d4caa6
Author: joshhunt <josh.hunt@grafana.com>
Date:   Tue Jul 1 13:23:46 2025 +0100

    add arg for sharding, but not using it yet

commit 7bcf0512c6652e079757e7f892d1802eb255a6a7
Author: joshhunt <josh.hunt@grafana.com>
Date:   Tue Jul 1 12:30:30 2025 +0100

    less newline

commit b6439118829a09a4c8c49d7692d38df0dff7e7ae
Author: joshhunt <josh.hunt@grafana.com>
Date:   Tue Jul 1 12:24:31 2025 +0100

    less logs

commit 38f871e9c235344f12ef31121fdfced549c5323c
Author: joshhunt <josh.hunt@grafana.com>
Date:   Tue Jul 1 10:00:26 2025 +0100

    fix yaml

commit db9a773136eff40a82beb3b2f55f73ab0d07a717
Author: joshhunt <josh.hunt@grafana.com>
Date:   Tue Jul 1 09:57:47 2025 +0100

    clean up files

commit c0525f41fa8b498f2fdf71b5047301b0e2945498
Author: joshhunt <josh.hunt@grafana.com>
Date:   Tue Jul 1 09:44:56 2025 +0100

    gha workflow

commit 895bea7c527bfbb148a421b9283fa0805f6ab11d
Author: joshhunt <josh.hunt@grafana.com>
Date:   Mon Jun 30 19:33:08 2025 +0100

    working dagger

commit cea1f8443738e9e4b375c065dd4a1e466036bb74
Author: joshhunt <josh.hunt@grafana.com>
Date:   Mon Jun 30 16:17:46 2025 +0100

    wip

* shard gha

* some tidy up

* add flags for exporting results, and a gha step to merge runs

* fix shard gha

* add dashboard-duplicate-panel test

* add dashboard-outline test

* add dashboards-add-panel

* remove some commented out code

* add dashboards-title-description test

* add dashboards-remove-panel

* don't install cypress

* gha: check playwright results

* add dashboards-edit-adhoc-variables test

* fix check-jobs

* add dagger cloud token

* add dagger cloud token

* add edit-datasource-variable test

* update CODEOWNERS

* add dashboards-edit-group-by-variables (skipped for now)

* add dashboards-edit-panel-title-description test

* add dashboards-edit-transparent-bg test

* add dashboards-edit-query-variables test

* run with 8 shards

* add dashboards-edit-variables

* tidy up gha

* add dashboard-group-panels

* fix action

* try to cache the grafana build

* fix missing action becuase no checkout, use builtin continue-on-error instead

* fix missing id

* cat out.txt

* debug build cache

* fix debug build cache

* add dashboards-panel-layouts test

* tidy up

* no more debug

* fix grafana dir

* add dashboards-move-panel test

* skip some failing tests

* mark up plugins tests with @plugins tag, only run @plugins tests in drone

* Hackathon/Playwright Conversion - Various Suite (#107516)

* Playwright Migration: Various Suite tests

* skipping bad tests

* fix some tests that can fail

* fix uid

* separate user for the verify-i18n test

* build test plugins for grafana server

* properly blur input fields

* login manually

* get dashboardPage from goto

* ignore a couple of type assertions

* remove a couple of timeouts

* remove timeouts on dashboard-share-internally

* use toBeHidden

* make dashboard-share-internally more stable

* remove TEMP_DAGGER_TOKEN

* clean up visaulization-suggestions

* unskip gauge test

* unskip trace-view-scrolling

* attempt to make create variable utils stable

* unskip loki tests

* make go linter happy

* unskip edit-group-by-variables test

* unskip move panel tests

* isolate dashboard-timepicker tests with separate user

* create data source as part of smoke test

* make sure we're awaiting in dashboard-edit-adhoc-variables

* make dashboards-edit-variables test more robust

* Hackathon Playwright: Dashboards Search (#107580)

* Hackathon Playwright: Dashboards Search

* Feedback changes

* make trace-view-scrolling more stable

* add json report and bench step

* fix bench version

* move fail step to after the playwright report so we can report test failures

* fix output file name

* fix typo

* try wrap in expect.poll

* stability

* bit more tidy up

* fix dashboard-new-layouts tests

* move test-plugins to e2e-playwright

* fix go code for drone e2e run

* move loki plugin-e2e test

* make v2 dashboards work again

---------

Co-authored-by: joshhunt <josh.hunt@grafana.com>
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Co-authored-by: Collin Fingar <collin.fingar@grafana.com>
Co-authored-by: Jeff Levin <jeff@levinology.com>
2025-07-11 10:31:33 +01:00
a9e70d4a1d Storybook: Rearrange and tidy stories (#107270)
* Tidy up storybook a little bit

* change sort order, delete some stories

* More tidy up of actions

* More tidy up of actions

* tweak story sorting, again

* Make all internal stories public

* fix sort

* Add ESLint rule to enforce storybook titles

* update verify storybook test

* simplify glob
2025-07-08 12:37:09 +00:00
3c6da3f241 i18n: removes useTranslate from ESLint rules (#106597)
* i18n: removes useTranslate from eslint rules

* chore: remove some more useTranslate
2025-06-12 13:30:54 +02:00
0879479c15 Internationalisation: Mark up @grafana/prometheus package (#105861)
* scaffolding for grafana-prometheus i18n

* markup

* extract translations

* fix tests

* add loadResources + fix object properties

* fix typo + prettier

* remove useTranslate

* update workflow to trigger on changes to grafana-sql/grafana-prometheus packages
2025-06-12 11:29:33 +01:00
84eafb9a56 Internationalisation: Mark up @grafana/sql package (#105842)
* scaffolding for package

* crowdin scaffolding

* markup

* add translations

* fix locale location

* fix tsconfig?

* undo bundler change

* object tranlsations, expose loadResources and call in mssql

* prettier

* remove useTranslate

* extract translations

* last couple of fixes

* remove deleted files
2025-06-12 10:52:04 +01:00
4ac248a512 Internationalisation: Mark up panel plugins for translations (#106068)
* config for panel plugin translations

* markup

* tweaks

* prettier

* use data-testid

* rename disable rule now it's been moved

* final markup
2025-05-29 18:13:25 +01:00
abb885c585 I18n: Move eslint rule to package (#105860) 2025-05-29 16:11:59 +02:00
7bfa78c6e6 I18n: Update eslint rule to catch some untranslated object properties (#105072) 2025-05-28 21:14:43 +01:00
ea0e49a6e6 Chore: Restrict imports of test files to avoid test pollution (#106057) 2025-05-28 10:37:15 +02:00
b1c1d080e2 Internationalisation: Mark up MSSQL (#105532)
* scaffolding

* markup

* fix typos + extract translations

* update crowdin.yml

* uppercase Grafana
2025-05-20 14:39:41 +01:00
c2ebb9cbbf i18n: Update lint rule suggested import location to @grafana/i18n (#105091) 2025-05-19 15:00:15 +01:00
aa0842a1e7 Internationalisation: Mark up azure monitor plugin (#105262)
* start marking up azuremonitor

* more markup

* finish mark up

* add package and correct imports

* convert to functional component + use correct t import

* fix duplicate key + typo

* add extract config + fake french translations to test

* run prettier and fix unit tests

* use nx

* enable i18n lint rules for azure monitor

* remove fake french translations

* await initPluginTranslations

* top level await breaks unit tests

* leave as class component for now
2025-05-15 13:31:49 +00:00
16668b993f Alerting: Enable alerting eslint overrides for package (#104678) 2025-05-14 20:30:52 +02:00
a9b6d098e9 Chore: Add eslint no-restricted-globals rule (#104519)
* Chore: Add no-restricted-globals eslint rule

* Fix eslint warnings

* Revert some changes

* Update

* Feedback
2025-05-12 12:38:26 +03:00
8f17f607fa FEMT: Add no-restricted-img-srcs rule (#105006) 2025-05-12 10:34:17 +01:00
e2cb3e74f3 Chore: Apply testing-library rules to grafana-ui package tests (#105140)
* Apply testing-library rules to grafana-ui package tests

* Apply auto fixes

* Fix eslint test issues in grafana-ui package

* Fix prettier issues

* Address review feedback
2025-05-09 17:45:33 +01:00
2a02fd7239 Chore: run i18n lint rules in enterprise as well (#105064)
run i18n lint rules in enterprise as well
2025-05-07 15:47:35 +01:00
6f3200d4f0 Re-enable jsx-a11y recommended rules (#104637)
* Re-enable `jsx-a11y` recommended rules

* apply rule in correct place, couple of fixes

* fix up some a11y issues

* add ignore for keyboard a11y for now

* readd testid

* close carousel on backdrop click

* use type="button"

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-05-07 15:43:48 +01:00
ec478138a5 Chore: Fix import/ordering for image imports (#105055) 2025-05-07 13:41:56 +03:00
b56a4a5295 Border radius: Improve rule and fix remaining violations (#104569)
* improve rule and fix remaining borderRadius violations

* prettier

* Add test case for nested classes

* Fix unnecessary string wrapping

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-04-30 14:03:54 +01:00
356c979328 Chore: Enable no-constant-condition eslint rule (#104298) 2025-04-24 09:50:29 +01:00
f9d2199b12 Alerting: Enable no-nested-ternary ESLint rule (#104085) 2025-04-23 11:00:40 +00:00
f9fb6f3b88 Chore: Update eslint configs to ignore /spec/ files when necessary (#104377) 2025-04-23 10:24:26 +01:00
fbb0bef368 Internationalisation: Ignore enterprise files for now (#104293)
ignore enterprise files for now
2025-04-22 11:40:06 -03:00
b052b28a88 Internationalisation: Enable i18n eslint rules (#104277)
* enable i18n rules by default

* commit translation changes
2025-04-22 13:56:25 +01:00
0860867b84 i18n: Fix all remaining alerting translation markup (#104103)
* alerting markup

* fix typo

* Fix remaining Alerting issues 🎉

* Enable no-untranslated-strings rule for alerting

* Fix i18n eslint rule for "fixed" areas of code

* Remove auto fixing

* kick CI

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-04-16 17:45:12 +01:00
f1470de478 Chore: Add eslint rule for empty files and tidy up (#102288)
* Add eslint rule for empty files

* Remove empty files
2025-03-17 14:54:12 +02:00
9870718c3a Alerting: Enable jsx-no-useless-fragment rule (#101884)
* Add no-useless-fragment rule for alerting code

* Auto-fix most no-useless-fragment cases

* Manually fix remaining no-useless-fragment cases

* Fix `invalid` passing to Field component

* Allow AlertingPageWrapper to have optional children
2025-03-11 22:31:47 +02:00
d198fa1dd0 Chore: add lint rule prevent t import from i18next (#99761)
* also handle i18next import

* fix violations
2025-01-29 15:46:13 +00:00
dea2e41e9f Grafana UI: Use Eslint no-restricted-imports in tests and stories (#99191)
* style(eslint): remove ignore from grafana/ui-overrides

* style(grafana-ui): update imports for tests

* style(grafana-ui): update imports for stories

* chore(betterer): update results file

* Fix useTheme import

* Change deprecated Horizontal/Vertical group usages

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-01-20 09:44:19 +01:00
f75bbe9f43 Alerting: Add self closing comp rule to alerting eslint config (#98603) 2025-01-09 10:02:52 +00:00
084aad0b84 Chore: Add no-duplicate-case eslint rule and fix violations (#97537)
* Add `no-duplicate-case` rule

* Fix basic duplicated cases

* Fix duplicated translations case

* Fix alerting case
2024-12-11 17:33:31 +00:00
4f7ffafe98 Alerting: Consistently order member imports in alerting code (#97688)
* Lint import member orders within alerting

* Consistently order member imports in alerting code
2024-12-10 17:42:33 +00:00
b105b32c8a Chore: Remove @eslint/compat and don't run all eslint rules in betterer (#97463)
* Remove eslint compat

* Remove fixup for testing library rules

* Make sure we don't ignore betterer eslint config from itself

* Update betterer to not run rules that are run in linting anyway
2024-12-05 12:14:09 +00:00
754fce648c Chore: Make Eslint work with enterprise (#96539)
chore(eslint): make it work with enterprise
2024-11-26 11:09:27 +01:00
7ae0d551fe Chore: Move betterer eslint rules to separate file and allow opting in (#96240)
* Move betterer eslint rules to separate file and allow opt-in for local dev

* Add betterer eslint to codeowners
2024-11-15 14:01:39 +00:00
cbe8b8a290 Alerting: Lint and remove unused object properties (#92996) 2024-11-11 13:02:46 +00:00
8c41137bcf Frontend: Update to Eslint 9 (#94823)
* chore(eslint): bump all eslint related packages to latest

* chore(eslint): update linting scripts work with v9

* chore(eslint): introduce flat config

* chore(eslint): delete legacy configs

* feat(grafana-eslint-rules): update rules to use eslint 9 APIs

* chore(eslint): migrate all nested eslintrc files over to root config

* chore(packages): bump eslint dependencies

* feat(betterer): make it work with eslint 9

* style(grafana-data): remove non-existant ban-types rule from disable declarations

* chore(wip): [wip] link eslint-config-grafana

* chore(packages): add @eslint/compat

* chore(eslint): add compat to testing library and fix alerting rules

* chore(eslint): bump grafana eslint-config to v8

* chore(explore): delete legacy eslint config

* chore: clean codeowners file, remove grafana/eslint-config from e2e plugins

* test(eslint-rules): fix no-border-radius-literal and no-aria-label-e2e-selectors rule tests

* Add .js to prettier checks so new eslint.config.js file isn't missed

* chore(eslint): move emotion/syntax-preference to grafana/defaults

* test(eslint): use core-js structured-clone

* revert(services): undo merge backend-format githook changes

* test(eslint-rules): remove structured-clone polyfill from tests

* chore(eslint): add back public/lib/monaco to ignore list, sort alphabetically

* chore(e2e-plugins): remove eslint config 7 from plugins package.json

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2024-11-07 16:31:06 +01:00