-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ES|QL] Query history #178302
[ES|QL] Query history #178302
Conversation
@@ -152,7 +155,6 @@ export interface QueryBarTopRowProps<QT extends Query | AggregateQuery = Query> | |||
dataViewPickerComponentProps?: DataViewPickerProps; | |||
textBasedLanguageModeErrors?: Error[]; | |||
textBasedLanguageModeWarning?: string; | |||
hideTextBasedRunQueryLabel?: boolean; |
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.
ℹ️ Cleaning this up, I don't see this property being used anywhere in kibana and with this PR we are also not displaying the text in unified search.
/ci |
/ci |
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.
Code-only review. New Discover functional tests LGTM 👍
I'll leave a more thorough review of the ES|QL changes to our new teammate and resident @elastic/kibana-esql member, @drewdaemon 🙂
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 see the query history when creating a rule from discover, but I do not see it when creating a rule from stack management. Is this expected, maybe I am not testing it correctly
I am sorry, it was testing problem on my end. I see it working correctly. |
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.
ResponseOps changes LGTM! Sorry for the noise
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 love this feature!
const [editorMessages, setEditorMessages] = useState<{ | ||
errors: MonacoMessage[]; | ||
warnings: MonacoMessage[]; | ||
}>({ | ||
errors: serverErrors ? parseErrors(serverErrors, code) : [], | ||
warnings: serverWarning ? parseWarning(serverWarning) : [], | ||
}); | ||
// contains only client side validation messages | ||
const [clientParserMessages, setClientParserMessages] = useState<{ |
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.
Makes sense. Context complicates things 👍
src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx
Show resolved
Hide resolved
public async getHistoryItems(): Promise<string[][]> { | ||
const queryHistory = await this.testSubjects.find('TextBasedLangEditor-queryHistory'); | ||
const tableBody = await this.retry.try(async () => queryHistory.findByTagName('tbody')); | ||
const $ = await tableBody.parseDomContent(); |
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! I didn't know about this feature! I'm sure it's much more performant to load everything in one go.
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! 🥳
/ci |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Tested and LGTM 🎉 |
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.
Vis team changes LGTM! 🎉
Summary
Closes #173217
Implements the query history component in the ESQL editor. The query history component displays the 20 most recent queries and it doesn't duplicate. If the user reruns a query it will update an existing one and not create a new entry.
Important notes
Right now, the query history component has been implemented at:
I have hid it from ML data visualizer because it was very difficult to implement it there. There is a quite complex logic fetching the fields statistics so it was a bit complicated to add it there. ML team can follow up as they know the logic already and would be easier for them to adjust.
Flajy test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5553
Checklist
Delete any items that are not applicable to this PR.