Skip to content

Commit

Permalink
Merge branch 'master' into add-list-so-feature-privilege
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 11, 2021
2 parents f455eb0 + 8c4af6f commit 3e15d7f
Show file tree
Hide file tree
Showing 147 changed files with 3,816 additions and 1,148 deletions.
22 changes: 13 additions & 9 deletions .ci/Jenkinsfile_flaky
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@ kibanaPipeline(timeoutMinutes: 180) {
catchErrors {
print "Agent ${agentNumberInside} - ${agentExecutions} executions"

workers.functional('flaky-test-runner', {
if (!IS_XPACK) {
kibanaPipeline.buildOss()
if (CI_GROUP == '1') {
runbld("./test/scripts/jenkins_build_kbn_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
withEnv([
'IGNORE_SHIP_CI_STATS_ERROR=true',
]) {
workers.functional('flaky-test-runner', {
if (!IS_XPACK) {
kibanaPipeline.buildOss()
if (CI_GROUP == '1') {
runbld("./test/scripts/jenkins_build_kbn_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
}
} else {
kibanaPipeline.buildXpack()
}
} else {
kibanaPipeline.buildXpack()
}
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
}
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ on:
jobs:
backport:
name: Backport PR
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'auto-backport')
if: |
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'auto-backport')
&& (
(github.event.action == 'labeled' && github.event.label.name == 'auto-backport')
|| (github.event.action == 'closed')
)
runs-on: ubuntu-latest

steps:
- name: 'Get backport config'
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/dev-tools/searchprofiler/getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[profiler-getting-started]]
=== Getting Started

The {searchprofiler} is automatically enabled in {kib}. Open the main menu, click *Dev Tools*, then click *Search Profiler*
The {searchprofiler} is automatically enabled in {kib}. Open the main menu, click *Dev Tools*, then click *{searchprofiler}*
to get started.

{searchprofiler} displays the names of the indices searched, the shards in each index,
Expand Down
4 changes: 0 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,6 @@ Failure to have auth enabled in Kibana will make for a broken UI. UI-based error
|The cloud plugin adds cloud specific features to Kibana.
|{kib-repo}blob/{branch}/x-pack/plugins/code[code]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/x-pack/plugins/console_extensions/README.md[consoleExtensions]
|This plugin provides autocomplete definitions of licensed APIs to the OSS Console plugin.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/dev-tools.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ a| <<console-kibana, Console>>
| Interact with the REST API of Elasticsearch, including sending requests
and viewing API documentation.

a| <<xpack-profiler, Search&nbsp;Profiler>>
a| <<xpack-profiler, {searchprofiler}>>

| Inspect and analyze your search queries.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
"moment": "^2.24.0",
"moment-duration-format": "^2.3.2",
"moment-timezone": "^0.5.27",
"monaco-editor": "^0.17.0",
"monaco-editor": "^0.22.3",
"mustache": "^2.3.2",
"ngreact": "^0.5.1",
"nock": "12.0.3",
Expand Down Expand Up @@ -772,7 +772,7 @@
"react-fast-compare": "^2.0.4",
"react-grid-layout": "^0.16.2",
"react-markdown": "^4.3.1",
"react-monaco-editor": "^0.27.0",
"react-monaco-editor": "^0.41.2",
"react-popper-tooltip": "^2.10.1",
"react-resize-detector": "^4.2.0",
"react-reverse-portal": "^1.0.4",
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-monaco/src/register_globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const mapLanguageIdToWorker: { [key: string]: any } = {

// @ts-ignore
window.MonacoEnvironment = {
// needed for functional tests so that we can get value from 'editor'
monaco,
getWorker: (module: string, languageId: string) => {
const workerSrc = mapLanguageIdToWorker[languageId] || defaultWorkerSrc;

Expand Down
8 changes: 4 additions & 4 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48147,13 +48147,13 @@ async function installBazelTools(repoRootPath) {
const bazeliskVersion = await readBazelToolsVersionFile(repoRootPath, '.bazeliskversion');
const bazelVersion = await readBazelToolsVersionFile(repoRootPath, '.bazelversion'); // Check what globals are installed

_log__WEBPACK_IMPORTED_MODULE_4__["log"].debug(`[bazel_tools] verify if bazelisk is installed`); // Test if bazelisk is already installed in the correct version
_log__WEBPACK_IMPORTED_MODULE_4__["log"].debug(`[bazel_tools] verify if bazelisk is installed`); // Check if we need to remove bazelisk from yarn

const isBazeliskPkgInstalled = await isBazeliskInstalled(bazeliskVersion); // Test if bazel bin is available
await tryRemoveBazeliskFromYarnGlobal(); // Test if bazelisk is already installed in the correct version

const isBazelBinAlreadyAvailable = await isBazelBinAvailable(); // Check if we need to remove bazelisk from yarn
const isBazeliskPkgInstalled = await isBazeliskInstalled(bazeliskVersion); // Test if bazel bin is available

await tryRemoveBazeliskFromYarnGlobal(); // Install bazelisk if not installed
const isBazelBinAlreadyAvailable = await isBazelBinAvailable(); // Install bazelisk if not installed

if (!isBazeliskPkgInstalled || !isBazelBinAlreadyAvailable) {
_log__WEBPACK_IMPORTED_MODULE_4__["log"].info(`[bazel_tools] installing Bazel tools`);
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-pm/src/utils/bazel/install_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ export async function installBazelTools(repoRootPath: string) {
// Check what globals are installed
log.debug(`[bazel_tools] verify if bazelisk is installed`);

// Check if we need to remove bazelisk from yarn
await tryRemoveBazeliskFromYarnGlobal();

// Test if bazelisk is already installed in the correct version
const isBazeliskPkgInstalled = await isBazeliskInstalled(bazeliskVersion);

// Test if bazel bin is available
const isBazelBinAlreadyAvailable = await isBazelBinAvailable();

// Check if we need to remove bazelisk from yarn
await tryRemoveBazeliskFromYarnGlobal();

// Install bazelisk if not installed
if (!isBazeliskPkgInstalled || !isBazelBinAlreadyAvailable) {
log.info(`[bazel_tools] installing Bazel tools`);
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-test/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ module.exports = {

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
transformIgnorePatterns: [
// ignore all node_modules except monaco-editor which requires babel transforms to handle dynamic import()
// ignore all node_modules except monaco-editor and react-monaco-editor which requires babel transforms to handle dynamic import()
// since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842)
'[/\\\\]node_modules(?![\\/\\\\]monaco-editor)[/\\\\].+\\.js$',
'[/\\\\]node_modules(?![\\/\\\\](monaco-editor|react-monaco-editor))[/\\\\].+\\.js$',
'packages/kbn-pm/dist/index.js',
],

Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-ui-shared-deps/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({
},
],
},
{
test: /\.(ttf)(\?|$)/,
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "codeCoverageTestPlugin",
"version": "kibana",
"server": true,
"ui": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { Plugin } from './plugin';

export function plugin() {
return new Plugin();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { CoreSetup } from 'kibana/server';

export class Plugin {
constructor() {}

public setup(core: CoreSetup) {}

public start() {
// called after all plugins are set up
}

public stop() {
// called when plugin is torn down during Kibana's shutdown sequence
}
}
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# For more info, see https://help.github.com/articles/about-codeowners/

# App
/x-pack/plugins/code/ @elastic/kibana-tre
/src/dev/code_coverage/ingest_coverage/integration_tests/fixtures/test_plugin @elastic/kibana-tre
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ describe('Team Assignment', () => {
const { stdout } = await execa('grep', ['tre', teamAssignmentsPath], { cwd: ROOT_DIR });
const lines = stdout.split('\n').filter((line) => !line.includes('/target'));
expect(lines).toEqual([
'x-pack/plugins/code/jest.config.js kibana-tre',
'x-pack/plugins/code/server/config.ts kibana-tre',
'x-pack/plugins/code/server/index.ts kibana-tre',
'x-pack/plugins/code/server/plugin.test.ts kibana-tre',
'x-pack/plugins/code/server/plugin.ts kibana-tre',
'src/dev/code_coverage/ingest_coverage/integration_tests/fixtures/test_plugin/server/index.ts kibana-tre',
'src/dev/code_coverage/ingest_coverage/integration_tests/fixtures/test_plugin/server/plugin.ts kibana-tre',
]);
});
});
Expand Down
3 changes: 3 additions & 0 deletions src/optimize/bundles_route/bundles_route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { extname, join } from 'path';

import Hapi from '@hapi/hapi';
import * as UiSharedDeps from '@kbn/ui-shared-deps';
import agent from 'elastic-apm-node';

import { createDynamicAssetResponse } from './dynamic_asset_response';
import { FileHashCache } from './file_hash_cache';
Expand Down Expand Up @@ -101,6 +102,8 @@ function buildRouteForBundles({
method(request: Hapi.Request, h: Hapi.ResponseToolkit) {
const ext = extname(request.params.path);

agent.setTransactionName('GET ?/bundles/?');

if (ext !== '.js' && ext !== '.css') {
return h.continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ storiesOf('CodeEditor', module)
provideCompletionItems: provideSuggestions,
}}
options={{
wordBasedSuggestions: false,
quickSuggestions: true,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ test('editor mount setup', () => {
suggestions: [],
}),
};
const signatureProvider = {
provideSignatureHelp: () => ({ signatures: [], activeParameter: 0, activeSignature: 0 }),
};
const hoverProvider = {
provideHover: (model: monaco.editor.ITextModel, position: monaco.Position) => ({
contents: [],
Expand Down Expand Up @@ -82,7 +79,6 @@ test('editor mount setup', () => {
onChange={() => {}}
editorWillMount={editorWillMount}
suggestionProvider={suggestionProvider}
signatureProvider={signatureProvider}
hoverProvider={hoverProvider}
/>
);
Expand All @@ -99,6 +95,5 @@ test('editor mount setup', () => {
// Verify our language features have been registered
expect((monaco.languages.onLanguage as jest.Mock).mock.calls.length).toBe(1);
expect((monaco.languages.registerCompletionItemProvider as jest.Mock).mock.calls.length).toBe(1);
expect((monaco.languages.registerSignatureHelpProvider as jest.Mock).mock.calls.length).toBe(1);
expect((monaco.languages.registerHoverProvider as jest.Mock).mock.calls.length).toBe(1);
});
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function DashboardPicker(props: DashboardPickerProps) {

return (
<EuiComboBox
data-test-subj="dashboardPickerInput"
placeholder={i18n.translate('presentationUtil.dashboardPicker.searchDashboardPlaceholder', {
defaultMessage: 'Search dashboards...',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@ export function SavedObjectSaveModalDashboard(props: SaveModalDashboardProps) {
const initialCopyOnSave = !Boolean(documentId);

const { capabilities } = pluginServices.getHooks();
const {
canAccessDashboards,
canCreateNewDashboards,
canEditDashboards,
} = capabilities.useService();

const disableDashboardOptions =
!canAccessDashboards() || (!canCreateNewDashboards && !canEditDashboards);
const { canAccessDashboards, canCreateNewDashboards } = capabilities.useService();

// Disable the dashboard options if the user can't access dashboards or if they're read-only
const disableDashboardOptions = !canAccessDashboards() || !canCreateNewDashboards();

const [dashboardOption, setDashboardOption] = useState<'new' | 'existing' | null>(
documentId || disableDashboardOptions ? null : 'existing'
Expand Down
Loading

0 comments on commit 3e15d7f

Please sign in to comment.