-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from grafana-toolkit to grafana plugin tools #3837
Conversation
grafana-plugin/.config/.cprc.json
Outdated
@@ -0,0 +1,3 @@ | |||
{ | |||
"version": "3.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this scaffolded by create-plugin
or what's this file for?
grafana-plugin/.nvmrc
Outdated
@@ -0,0 +1 @@ | |||
20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It's pity .nvmrc doesn't support comments but at least maybe we can use "v20" to indicate this s about node version?
- It would be good to restrict this version in
package.json
using https://docs.npmjs.com/cli/v10/configuring-npm/package-json#engines ? wdyt? - Also it this case we stick to Node v20 on local but on on Github Actions and Drone it seems we use 18.16.0. I think we should be consistent here and use the same version. If not in this PR, can we create a task and add it to our frontend tech backlog pls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for keeping the node versions the same on CI as local. A few spots that would need to be changed (this should be all, but you'll want to double check):
- https://github.com/grafana/oncall/blob/dev/grafana-plugin/Dockerfile.dev#L1
- https://github.com/grafana/oncall-private/blob/dev/.drone.yml
- https://github.com/grafana/oncall/blob/dev/.drone.yml
- https://github.com/grafana/oncall/blob/dev/.github/workflows/linting-and-tests.yml
- https://github.com/grafana/oncall/blob/dev/.github/workflows/e2e-tests.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll set 18.16.0
in .nvmrc
and in the engines
section:
"engines": {
"node": "~18.16.0"
},
grafana-plugin/package.json
Outdated
"labels:link": "yarn --cwd ../../gops-labels/frontend link && yarn link \"@grafana/labels\" && yarn --cwd ../../gops-labels/frontend watch", | ||
"labels:unlink": "yarn --cwd ../../gops-labels/frontend unlink", | ||
"test": "jest --verbose", | ||
"test:silent": "jest --silent", | ||
"test:e2e": "yarn playwright test --grep-invert @expensive", | ||
"test:e2e-expensive": "yarn playwright test --grep @expensive", | ||
"e2e": "yarn exec cypress install && yarn exec grafana-e2e run", | ||
"e2e:update": "yarn exec cypress install && yarn exec grafana-e2e run --update-screenshots", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those are not needed I guess?
grafana-plugin/package.json
Outdated
"@grafana/eslint-config": "^5.1.0", | ||
"@grafana/toolkit": "^9.5.2", | ||
"@grafana/e2e": "10.0.3", | ||
"@grafana/e2e-selectors": "10.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't use those 2. grafana-e2e is a wrapper over Cypress that makes it easier to test Grafana. We use Playwright and there's another fresh project for Playwright that we might switch to in nearest future (https://github.com/grafana/plugin-tools/tree/main/packages/plugin-e2e). But I think everything related to Cypress can be removed from our project
})(baseConfig, customConfig); | ||
}; | ||
|
||
export default config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
grafana-plugin/package.json
Outdated
"start": "yarn watch", | ||
"plop": "plop", | ||
"test:ci": "jest --passWithNoTests --maxWorkers 4", | ||
"typecheck": "tsc --noEmit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need these 2?
test:ci
doesn't seem to be used part of CI
typecheck
seems more like a job for webpack than for us to run 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typecheck
looks useful for me, let's keep it, and I've removed test:ci
@@ -1,3 +1,5 @@ | |||
// @ts-nocheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# What this PR does Migrate from grafana-toolkit to grafana plugin tools ## Which issue(s) this PR fixes #3651 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --------- Co-authored-by: Michael Derynck <[email protected]> Co-authored-by: Dominik <[email protected]>
What this PR does
Migrate from grafana-toolkit to grafana plugin tools
Which issue(s) this PR fixes
#3651
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)