Skip to content

Commit

Permalink
🔥 Remove validation for CCS
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Jan 18, 2024
1 parent fed9460 commit 75b0d32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 40 deletions.
9 changes: 0 additions & 9 deletions packages/kbn-monaco/src/esql/lib/ast/validation/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,6 @@ function getMessageAndTypeFromId<K extends ErrorTypes>({
},
}),
};
case 'ccsNotSupportedForCommand':
return {
message: i18n.translate('monaco.esql.validation.ccsNotSupportedForCommand', {
defaultMessage: 'ES|QL does not yet support querying remote indices [{value}]',
values: {
value: out.value,
},
}),
};
case 'unsupportedFieldType':
return {
message: i18n.translate('monaco.esql.validation.unsupportedFieldType', {
Expand Down
4 changes: 0 additions & 4 deletions packages/kbn-monaco/src/esql/lib/ast/validation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ export interface ValidationErrors {
message: string;
type: { name: string };
};
ccsNotSupportedForCommand: {
message: string;
type: { value: string };
};
unsupportedFieldType: {
message: string;
type: { field: string };
Expand Down
24 changes: 6 additions & 18 deletions packages/kbn-monaco/src/esql/lib/ast/validation/validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,24 +272,12 @@ describe('validation logic', () => {
testErrorsAndWarnings(`from ind*ex`, []);
testErrorsAndWarnings(`from indexes*`, ['Unknown index [indexes*]']);

testErrorsAndWarnings(`from remote-*:indexes*`, [
'ES|QL does not yet support querying remote indices [remote-*:indexes*]',
]);
testErrorsAndWarnings(`from remote-*:indexes`, [
'ES|QL does not yet support querying remote indices [remote-*:indexes]',
]);
testErrorsAndWarnings(`from remote-ccs:indexes`, [
'ES|QL does not yet support querying remote indices [remote-ccs:indexes]',
]);
testErrorsAndWarnings(`from a, remote-ccs:indexes`, [
'ES|QL does not yet support querying remote indices [remote-ccs:indexes]',
]);
testErrorsAndWarnings(`from remote-ccs:indexes [METADATA _id]`, [
'ES|QL does not yet support querying remote indices [remote-ccs:indexes]',
]);
testErrorsAndWarnings(`from *:indexes [METADATA _id]`, [
'ES|QL does not yet support querying remote indices [*:indexes]',
]);
testErrorsAndWarnings(`from remote-*:indexes*`, []);
testErrorsAndWarnings(`from remote-*:indexes`, []);
testErrorsAndWarnings(`from remote-ccs:indexes`, []);
testErrorsAndWarnings(`from a, remote-ccs:indexes`, []);
testErrorsAndWarnings(`from remote-ccs:indexes [METADATA _id]`, []);
testErrorsAndWarnings(`from *:indexes [METADATA _id]`, []);
testErrorsAndWarnings('from .secretIndex', []);
testErrorsAndWarnings('from my-index', []);
});
Expand Down
11 changes: 2 additions & 9 deletions packages/kbn-monaco/src/esql/lib/ast/validation/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,16 +482,9 @@ function validateSource(
})
);
} else {
// give up on validate if CCS for now
const hasCCS = hasCCSSource(source.name);
if (hasCCS) {
messages.push(
getMessageFromId({
messageId: 'ccsNotSupportedForCommand',
values: { value: source.name },
locations: source.location,
})
);
} else {
if (!hasCCS) {
const isWildcardAndNotSupported =
hasWildcard(source.name) && !commandDef.signature.params.some(({ wildcards }) => wildcards);
if (isWildcardAndNotSupported) {
Expand Down

0 comments on commit 75b0d32

Please sign in to comment.