Skip to content

Commit

Permalink
Merge branch 'master' into skip-ci-backportrc
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 18, 2021
2 parents c991ec6 + eddf1c9 commit af3adaf
Show file tree
Hide file tree
Showing 352 changed files with 5,479 additions and 2,499 deletions.
3 changes: 2 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
"7.12",
"7.11",
"7.10",
"7.9",
Expand All @@ -29,7 +30,7 @@
"targetPRLabels": ["backport"],
"branchLabelMapping": {
"^v8.0.0$": "master",
"^v7.12.0$": "7.x",
"^v7.13.0$": "7.x",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
},
"autoMerge": true,
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"maps_legacy": "src/plugins/maps_legacy",
"monaco": "packages/kbn-monaco/src",
"presentationUtil": "src/plugins/presentation_util",
"indexPatternFieldEditor": "src/plugins/index_pattern_field_editor",
"indexPatternManagement": "src/plugins/index_pattern_management",
"advancedSettings": "src/plugins/advanced_settings",
"kibana_legacy": "src/plugins/kibana_legacy",
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ for use in their own application.
|Moves the legacy ui/registry/feature_catalogue module for registering "features" that should be shown in the home page's feature catalogue to a service within a "home" plugin. The feature catalogue refered to here should not be confused with the "feature" plugin for registering features used to derive UI capabilities for feature controls.
|{kib-repo}blob/{branch}/src/plugins/index_pattern_field_editor/README.md[indexPatternFieldEditor]
|The reusable field editor across Kibana!
|{kib-repo}blob/{branch}/src/plugins/index_pattern_management[indexPatternManagement]
|WARNING: Missing README.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ kibanaResponseFactory: {
forbidden: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
notFound: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
conflict: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
internalError: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
customError: (options: CustomHttpResponseOptions<ResponseError>) => KibanaResponse<ResponseError>;
redirected: (options: RedirectResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
ok: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
Expand Down
2 changes: 1 addition & 1 deletion docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [PluginOpaqueId](./kibana-plugin-core-server.pluginopaqueid.md) | |
| [PublicUiSettingsParams](./kibana-plugin-core-server.publicuisettingsparams.md) | A sub-set of [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) exposed to the client-side. |
| [RedirectResponseOptions](./kibana-plugin-core-server.redirectresponseoptions.md) | HTTP response parameters for redirection response |
| [RequestHandler](./kibana-plugin-core-server.requesthandler.md) | A function executed when route path matched requested resource path. Request handler is expected to return a result of one of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) functions. |
| [RequestHandler](./kibana-plugin-core-server.requesthandler.md) | A function executed when route path matched requested resource path. Request handler is expected to return a result of one of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) functions. If anything else is returned, or an error is thrown, the HTTP service will automatically log the error and respond <code>500 - Internal Server Error</code>. |
| [RequestHandlerContextContainer](./kibana-plugin-core-server.requesthandlercontextcontainer.md) | An object that handles registration of http request context providers. |
| [RequestHandlerContextProvider](./kibana-plugin-core-server.requesthandlercontextprovider.md) | Context provider for request handler. Extends request context object with provided functionality or data. |
| [RequestHandlerWrapper](./kibana-plugin-core-server.requesthandlerwrapper.md) | Type-safe wrapper for [RequestHandler](./kibana-plugin-core-server.requesthandler.md) function. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## RequestHandler type

A function executed when route path matched requested resource path. Request handler is expected to return a result of one of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) functions.
A function executed when route path matched requested resource path. Request handler is expected to return a result of one of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) functions. If anything else is returned, or an error is thrown, the HTTP service will automatically log the error and respond `500 - Internal Server Error`<!-- -->.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@babel/core": "^7.12.10",
"@babel/runtime": "^7.12.5",
"@elastic/datemath": "link:packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.2",
"@elastic/ems-client": "7.12.0",
"@elastic/eui": "31.7.0",
"@elastic/filesaver": "1.1.2",
Expand Down
13 changes: 13 additions & 0 deletions packages/kbn-monaco/src/painless/diagnostics_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const toDiagnostics = (error: PainlessError): monaco.editor.IMarkerData => {
};
};

export interface SyntaxErrors {
[modelId: string]: PainlessError[];
}
export class DiagnosticsAdapter {
private errors: SyntaxErrors = {};

constructor(private worker: WorkerAccessor) {
const onModelAdd = (model: monaco.editor.IModel): void => {
let handle: any;
Expand Down Expand Up @@ -55,8 +60,16 @@ export class DiagnosticsAdapter {

if (errorMarkers) {
const model = monaco.editor.getModel(resource);
this.errors = {
...this.errors,
[model!.id]: errorMarkers,
};
// Set the error markers and underline them with "Error" severity
monaco.editor.setModelMarkers(model!, ID, errorMarkers.map(toDiagnostics));
}
}

public getSyntaxErrors() {
return this.errors;
}
}
10 changes: 8 additions & 2 deletions packages/kbn-monaco/src/painless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@

import { ID } from './constants';
import { lexerRules, languageConfiguration } from './lexer_rules';
import { getSuggestionProvider } from './language';
import { getSuggestionProvider, getSyntaxErrors } from './language';

export const PainlessLang = { ID, getSuggestionProvider, lexerRules, languageConfiguration };
export const PainlessLang = {
ID,
getSuggestionProvider,
lexerRules,
languageConfiguration,
getSyntaxErrors,
};

export { PainlessContext, PainlessAutocompleteField } from './types';
11 changes: 9 additions & 2 deletions packages/kbn-monaco/src/painless/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ID } from './constants';
import { PainlessContext, PainlessAutocompleteField } from './types';
import { PainlessWorker } from './worker';
import { PainlessCompletionAdapter } from './completion_adapter';
import { DiagnosticsAdapter } from './diagnostics_adapter';
import { DiagnosticsAdapter, SyntaxErrors } from './diagnostics_adapter';

const workerProxyService = new WorkerProxyService();
const editorStateService = new EditorStateService();
Expand All @@ -33,8 +33,15 @@ export const getSuggestionProvider = (
return new PainlessCompletionAdapter(worker, editorStateService);
};

let diagnosticsAdapter: DiagnosticsAdapter;

// Returns syntax errors for all models by model id
export const getSyntaxErrors = (): SyntaxErrors => {
return diagnosticsAdapter.getSyntaxErrors();
};

monaco.languages.onLanguage(ID, async () => {
workerProxyService.setup();

new DiagnosticsAdapter(worker);
diagnosticsAdapter = new DiagnosticsAdapter(worker);
});
3 changes: 2 additions & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pageLoadAssetSize:
home: 41661
indexLifecycleManagement: 107090
indexManagement: 140608
indexPatternManagement: 154222
indexPatternManagement: 28222
infra: 204800
fleet: 415829
ingestPipelines: 58003
Expand Down Expand Up @@ -103,6 +103,7 @@ pageLoadAssetSize:
stackAlerts: 29684
presentationUtil: 28545
spacesOss: 18817
indexPatternFieldEditor: 90489
osquery: 107090
fileUpload: 25664
banners: 17946
4 changes: 2 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
packageNames: ['@elastic/charts'],
reviewers: ['markov00'],
matchBaseBranches: ['master'],
labels: ['release_note:skip', 'v8.0.0', 'v7.12.0'],
labels: ['release_note:skip', 'v8.0.0', 'v7.13.0'],
enabled: true,
},
{
Expand All @@ -54,7 +54,7 @@
packageNames: ['@elastic/elasticsearch'],
reviewers: ['team:kibana-operations'],
matchBaseBranches: ['7.x'],
labels: ['release_note:skip', 'v7.12.0', 'Team:Operations', 'backport:skip'],
labels: ['release_note:skip', 'v7.13.0', 'Team:Operations', 'backport:skip'],
enabled: true,
},
{
Expand Down
1 change: 1 addition & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class DocLinksService {
indexPatterns: {
loadingData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/tutorial-load-dataset.html`,
introduction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-patterns.html`,
fieldFormattersString: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/field-formatters-string.html`,
},
addData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/connect-to-elasticsearch.html`,
kibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index.html`,
Expand Down
64 changes: 22 additions & 42 deletions src/core/server/http/base_path_proxy_server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,8 @@ describe('BasePathProxyServer', () => {
options: { body: { output: 'stream' } },
},
(_, req, res) => {
try {
expect(req.body).toBeInstanceOf(Readable);
return res.ok({ body: req.route.options.body });
} catch (err) {
return res.internalError({ body: err.message });
}
expect(req.body).toBeInstanceOf(Readable);
return res.ok({ body: req.route.options.body });
}
);
registerRouter(router);
Expand Down Expand Up @@ -740,15 +736,11 @@ describe('BasePathProxyServer', () => {
},
},
(_, req, res) => {
try {
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
} catch (err) {
return res.internalError({ body: err.message });
}
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
}
);
registerRouter(router);
Expand Down Expand Up @@ -779,15 +771,11 @@ describe('BasePathProxyServer', () => {
},
},
(context, req, res) => {
try {
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
} catch (err) {
return res.internalError({ body: err.message });
}
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
}
);
registerRouter(router);
Expand Down Expand Up @@ -815,15 +803,11 @@ describe('BasePathProxyServer', () => {
},
},
(_, req, res) => {
try {
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
} catch (err) {
return res.internalError({ body: err.message });
}
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
}
);
registerRouter(router);
Expand Down Expand Up @@ -851,15 +835,11 @@ describe('BasePathProxyServer', () => {
},
},
(_, req, res) => {
try {
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
} catch (err) {
return res.internalError({ body: err.message });
}
return res.ok({
body: {
timeout: req.route.options.timeout,
},
});
}
);
registerRouter(router);
Expand Down
2 changes: 0 additions & 2 deletions src/core/server/http/http_server.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ const createResponseFactoryMock = (): jest.Mocked<KibanaResponseFactory> => ({
forbidden: jest.fn(),
notFound: jest.fn(),
conflict: jest.fn(),
internalError: jest.fn(),
customError: jest.fn(),
});

Expand All @@ -162,7 +161,6 @@ const createLifecycleResponseFactoryMock = (): jest.Mocked<LifecycleResponseFact
forbidden: jest.fn(),
notFound: jest.fn(),
conflict: jest.fn(),
internalError: jest.fn(),
customError: jest.fn(),
});

Expand Down
Loading

0 comments on commit af3adaf

Please sign in to comment.