-
Notifications
You must be signed in to change notification settings - Fork 108
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
make backend as default parser #1140
base: main
Are you sure you want to change the base?
Conversation
@@ -660,16 +660,6 @@ func TestInlineSources(t *testing.T) { | |||
skipGoldenCheck bool | |||
test func(t *testing.T, frame *data.Frame) | |||
}{ | |||
{ |
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.
This test is now removed. ( incorrect test )
@@ -194,6 +194,12 @@ func ApplyDefaultsToQuery(ctx context.Context, query Query, settings InfinitySet | |||
query.Source = "url" | |||
} | |||
} | |||
// if the parser is already set, we should respect that |
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.
main change in backend
@@ -13,6 +14,7 @@ import type { InfinityQuery } from './types'; | |||
*/ | |||
export const migrateQuery = (query: InfinityQuery): InfinityQuery => { | |||
let newQuery: InfinityQuery = { ...query }; | |||
newQuery = setDefaultParserToBackend(newQuery); |
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.
main change in frontend
@@ -28,128 +28,6 @@ | |||
"links": [], | |||
"liveNow": true, | |||
"panels": [ | |||
{ |
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.
cleanup. Not related to the PR.
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.
LGTM, left suggestion bellow.
Fixes https://github.com/grafana/oss-big-tent-squad/issues/32
Background
Currently when a new infinity query is added to the dashboard / explore page, the parser option is set to
default/simple/frontend parser
. This default parser is frontend parser. With this option, user will not be able to setup alerts, recorded queries, public dashboards or any other backend features. Since this is the default parser, users find it more annoying to migrate to backend parser at later stage to make it compatible with backend features.This PR sets the backend parser as the default parser when adding a new query to the dashboard / explore page.
How to test
Before changes
git checkout main && yarn && yarn build && mage -v && docker compose up
After changes
git checkout default-backend-parser && yarn && yarn build && mage -v && docker compose up
Migrating existing queries
Not only the new queries, this PR also migrates existing queries to use backend parser as default.
Testing existing queries
git checkout default-backend-parser && yarn && yarn build && mage -v && docker compose up