-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
schema: Use generated dashboard model in frontend #55769
Conversation
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/34990 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/35582 |
Just updated this to make it a With this change, on a quick scan, it looks like the only non-test file with errors is |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/36359 |
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.
The bug mentioned above is fixed!
I don't understand the breaking changes because the reason seems to be removed label
, type
, and name
of VariableModel
, when they are not removed in fact. Do you have any idea what is happening here with this check @ivanortegaalba?
@@ -66,6 +66,7 @@ describe('DashboardModel', () => { | |||
panels: [ | |||
{ | |||
type: 'graph', | |||
// @ts-expect-error |
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 took the liberty of moving this ts-expect-error here because I saw two errors from the typecheck:
public/app/features/dashboard/state/DashboardMigrator.test.ts:67:11 - error TS2578: Unused '@ts-expect-error' directive.
67 // @ts-expect-error
~~~~~~~~~~~~~~~~~~~
public/app/features/dashboard/state/DashboardMigrator.test.ts:70:13 - error TS2322: Type 'boolean' is not assignable to type '{ show: boolean; sort?: string | undefined; sortDesc?: boolean | undefined; }'.
70 legend: true,
~~~~~~
but now I sometimes see a fully successful pass of yarn typecheck
and build the frontend successfully, and sometimes see some errors... I hope everything is alright, but please check one last time before you merge.
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 experienced this problem as well. it seems to be a problem of how TS updates the cached results. If you remove from your local tsconfig.tsbuildinfo
you will see the type check success deterministically.
It is because now the |
Here is a PR to fix the issues with Enterprise https://github.com/grafana/grafana-enterprise/pull/4255 |
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.
After multiple changes, and manual testing of the modified runtime code. This PR is ready! ✅ Waiting for a second approval and I'll merge
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.
Ran all the checks and cannot find any manual bugs 🙌.
What this PR does / why we need it:
Now that #54816 is in, we're actually finally ready to start using the generated dashboard types in the frontend omg omg omg ❤️ 🎉 🎊 🎉 ❤️
I figured i'd open this PR that just swaps in the type to get the ball rolling. Simply doing so produces almost 200 errors to be fixed :)
Maybe we end up figuring out a way to chunk it down, and we can close this PR. But i figured this was the easiest way for everyone to be able to see the TODO list.