-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use @grafana/runtime instead of grafanaBootData #50
Conversation
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 would be great to have another review on this as I may have missed something.
For the assertions you've removed, so if I understand it's impossible to support that behavior in the frontend now? For the code you've referenced in the backend, are there tests protecting that behavior that we're depending on now?
|
PR for 2. here grafana/grafana#71486 |
This was started as a refactor of ConnectionConfig to remove (window as any), but even though there was a commit by @sunker that moved away from grafana/runtime to window.grafanaBootData (possibly because it was necessary for Grafana@7), I couldn't find a reason right now to not use config from runtime.
One of the reasons /runtime.config seems a better solution is that here the
grafanaBootData
(config
) is merged with defaults and with initial values from config.ts.This means that
awsAssumeRoleEnabled
andawsAllowedAuthProviders
might not be defined in grafanaBootData, but instead in defaults for example, so it makes sense to read from a merged object (runtime.config) and not from grafanaBootDataI also decided to remove test cases that check if these fields are defined since we have some code on the BE that takes care that both of these fields are defined and sets default values if they are not. So it looks to me that there is no way these fields could be undefined. This is also reflected in the types here:
Lmk if there's anything I missed about the context here!