Skip to content

Commit

Permalink
[8.15] [ES|QL] remove meta (#189302) (#189427)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.15`:
- [[ES|QL] remove meta
(#189302)](#189302)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-29T16:31:34Z","message":"[ES|QL]
remove meta (#189302)\n\n## Summary\r\n\r\nclose
https://github.com/elastic/kibana/issues/188481\r\n\r\n`META` is still
in the grammar so you won't get a syntax error, but no\r\nhighlighting,
validation, or autocomplete support.\r\n\r\n<img width=\"268\"
alt=\"Screenshot 2024-07-26 at 9 46
09 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/563ba2fe-c35d-437e-bc6c-e717cd8b0de8\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"49fb36c69c780e947bf95d67b0e012a2fcde63e3","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.15.0","v8.16.0"],"title":"[ES|QL]
remove
meta","number":189302,"url":"https://github.com/elastic/kibana/pull/189302","mergeCommit":{"message":"[ES|QL]
remove meta (#189302)\n\n## Summary\r\n\r\nclose
https://github.com/elastic/kibana/issues/188481\r\n\r\n`META` is still
in the grammar so you won't get a syntax error, but no\r\nhighlighting,
validation, or autocomplete support.\r\n\r\n<img width=\"268\"
alt=\"Screenshot 2024-07-26 at 9 46
09 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/563ba2fe-c35d-437e-bc6c-e717cd8b0de8\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"49fb36c69c780e947bf95d67b0e012a2fcde63e3"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/189302","number":189302,"mergeCommit":{"message":"[ES|QL]
remove meta (#189302)\n\n## Summary\r\n\r\nclose
https://github.com/elastic/kibana/issues/188481\r\n\r\n`META` is still
in the grammar so you won't get a syntax error, but no\r\nhighlighting,
validation, or autocomplete support.\r\n\r\n<img width=\"268\"
alt=\"Screenshot 2024-07-26 at 9 46
09 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/563ba2fe-c35d-437e-bc6c-e717cd8b0de8\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"49fb36c69c780e947bf95d67b0e012a2fcde63e3"}}]}]
BACKPORT-->

Co-authored-by: Drew Tate <[email protected]>
  • Loading branch information
kibanamachine and drewdaemon authored Jul 29, 2024
1 parent 6bbb3b4 commit 3d73dee
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,6 @@ describe('autocomplete', () => {
}
});

describe('meta', () => {
testSuggestions('meta ', ['FUNCTIONS']);
for (const fn of ['functions']) {
testSuggestions(`meta ${fn} `, ['|']);
}
});

describe('where', () => {
const allEvalFns = getFunctionSignaturesByReturnType('where', 'any', {
evalMath: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,6 @@ export const commandDefinitions: CommandDefinition[] = [
params: [{ name: 'index', type: 'source', wildcards: true }],
},
},
{
name: 'meta',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.metaDoc', {
defaultMessage: 'Returns information about the ES|QL environment',
}),
examples: ['meta functions'],
options: [],
modes: [],
signature: {
multipleParams: false,
params: [{ name: 'functions', type: 'function' }],
},
},
{
name: 'show',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.showDoc', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2092,46 +2092,6 @@
],
"warning": []
},
{
"query": "meta",
"error": [
"SyntaxError: missing 'functions' at '<EOF>'"
],
"warning": []
},
{
"query": "meta functions",
"error": [],
"warning": []
},
{
"query": "meta functions()",
"error": [
"SyntaxError: token recognition error at: '('",
"SyntaxError: token recognition error at: ')'"
],
"warning": []
},
{
"query": "meta functions blah",
"error": [
"SyntaxError: token recognition error at: 'b'",
"SyntaxError: token recognition error at: 'l'",
"SyntaxError: token recognition error at: 'a'",
"SyntaxError: token recognition error at: 'h'"
],
"warning": []
},
{
"query": "meta info",
"error": [
"SyntaxError: token recognition error at: 'i'",
"SyntaxError: token recognition error at: 'n'",
"SyntaxError: token recognition error at: 'fo'",
"SyntaxError: missing 'functions' at '<EOF>'"
],
"warning": []
},
{
"query": "show",
"error": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,40 +450,8 @@ describe('validation logic', () => {
});
});

describe('meta', () => {
testErrorsAndWarnings('meta', ["SyntaxError: missing 'functions' at '<EOF>'"]);
testErrorsAndWarnings('meta functions', []);
testErrorsAndWarnings('meta functions()', [
"SyntaxError: token recognition error at: '('",
"SyntaxError: token recognition error at: ')'",
]);
testErrorsAndWarnings('meta functions blah', [
"SyntaxError: token recognition error at: 'b'",
"SyntaxError: token recognition error at: 'l'",
"SyntaxError: token recognition error at: 'a'",
"SyntaxError: token recognition error at: 'h'",
]);
testErrorsAndWarnings('meta info', [
"SyntaxError: token recognition error at: 'i'",
"SyntaxError: token recognition error at: 'n'",
"SyntaxError: token recognition error at: 'fo'",
"SyntaxError: missing 'functions' at '<EOF>'",
]);
});

describe('show', () => {
testErrorsAndWarnings('show', ["SyntaxError: missing 'info' at '<EOF>'"]);
testErrorsAndWarnings('show functions', [
"SyntaxError: token recognition error at: 'f'",
"SyntaxError: token recognition error at: 'u'",
"SyntaxError: token recognition error at: 'n'",
"SyntaxError: token recognition error at: 'c'",
"SyntaxError: token recognition error at: 't'",
"SyntaxError: token recognition error at: 'io'",
"SyntaxError: token recognition error at: 'n'",
"SyntaxError: token recognition error at: 's'",
"SyntaxError: missing 'info' at '<EOF>'",
]);
testErrorsAndWarnings('show info', []);
testErrorsAndWarnings('show numberField', [
"SyntaxError: token recognition error at: 'n'",
Expand Down Expand Up @@ -1555,22 +1523,6 @@ describe('validation logic', () => {
});
});

it('should call fields callbacks also for meta command', async () => {
const callbackMocks = getCallbackMocks();
await validateQuery(
`meta functions | keep name`,
getAstAndSyntaxErrors,
undefined,
callbackMocks
);
expect(callbackMocks.getSources).not.toHaveBeenCalled();
expect(callbackMocks.getPolicies).not.toHaveBeenCalled();
expect(callbackMocks.getFieldsFor).toHaveBeenCalledTimes(1);
expect(callbackMocks.getFieldsFor).toHaveBeenLastCalledWith({
query: 'meta functions',
});
});

it('should call fields callbacks also for show command', async () => {
const callbackMocks = getCallbackMocks();
await validateQuery(
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-monaco/src/esql/lib/esql_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const buildESQlTheme = (): monaco.editor.IStandaloneThemeData => ({

// source commands
...buildRuleGroup(
['from', 'row', 'show', 'meta'],
['from', 'row', 'show'],
euiThemeVars.euiColorPrimaryText,
true // isBold
),
Expand Down

0 comments on commit 3d73dee

Please sign in to comment.