Skip to content

Commit

Permalink
Merge branch 'main' into revert/126320
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz authored Mar 21, 2022
2 parents 8329b56 + 8df17b9 commit a149ead
Show file tree
Hide file tree
Showing 365 changed files with 10,896 additions and 3,335 deletions.
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts

ARG NODE_VERSION=16.13.2
ARG NODE_VERSION=16.14.2

FROM node:${NODE_VERSION} AS base

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ npm-debug.log*
.vagrant
.envrc

## Snyk
.dccache

## @cypress/snapshot from apm plugin
/snapshots.js

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.2
16.14.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.2
16.14.2
14 changes: 7 additions & 7 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ check_rules_nodejs_version(minimum_version_string = "4.0.0")
# we can update that rule.
node_repositories(
node_repositories = {
"16.13.2-darwin_amd64": ("node-v16.13.2-darwin-x64.tar.gz", "node-v16.13.2-darwin-x64", "900a952bb77533d349e738ff8a5179a4344802af694615f36320a888b49b07e6"),
"16.13.2-darwin_arm64": ("node-v16.13.2-darwin-arm64.tar.gz", "node-v16.13.2-darwin-arm64", "09d300008ad58792c12622a5eafdb14c931587bb88713df4df64cdf4ff2188d1"),
"16.13.2-linux_arm64": ("node-v16.13.2-linux-arm64.tar.xz", "node-v16.13.2-linux-arm64", "a3cf8e4e9fbea27573eee6da84720bf7227ddd22842b842d48049d6dfe55fb03"),
"16.13.2-linux_s390x": ("node-v16.13.2-linux-s390x.tar.xz", "node-v16.13.2-linux-s390x", "c4ba46fc19366f7377d28a60a98f741bfa38045d7924306244c51d1660afcc8d"),
"16.13.2-linux_amd64": ("node-v16.13.2-linux-x64.tar.xz", "node-v16.13.2-linux-x64", "7f5e9a42d6e86147867d35643c7b1680c27ccd45db85666fc52798ead5e74421"),
"16.13.2-windows_amd64": ("node-v16.13.2-win-x64.zip", "node-v16.13.2-win-x64", "107e3ece84b7fa1e80b3bdf03181d395246c7867e27b17b6d7e6fa9c7932b467"),
"16.14.2-darwin_amd64": ("node-v16.14.2-darwin-x64.tar.gz", "node-v16.14.2-darwin-x64", "d3076ca7fcc7269c8ff9b03fe7d1c277d913a7e84a46a14eff4af7791ff9d055"),
"16.14.2-darwin_arm64": ("node-v16.14.2-darwin-arm64.tar.gz", "node-v16.14.2-darwin-arm64", "a66d9217d2003bd416d3dd06dfd2c7a044c4c9ff2e43a27865790bd0d59c682d"),
"16.14.2-linux_arm64": ("node-v16.14.2-linux-arm64.tar.xz", "node-v16.14.2-linux-arm64", "f7c5a573c06a520d6c2318f6ae204141b8420386553a692fc359f8ae3d88df96"),
"16.14.2-linux_s390x": ("node-v16.14.2-linux-s390x.tar.xz", "node-v16.14.2-linux-s390x", "3197925919ca357e17a31132dc6ef4e5afae819fa09905cfe9f7ff7924a00bf5"),
"16.14.2-linux_amd64": ("node-v16.14.2-linux-x64.tar.xz", "node-v16.14.2-linux-x64", "e40c6f81bfd078976d85296b5e657be19e06862497741ad82902d0704b34bb1b"),
"16.14.2-windows_amd64": ("node-v16.14.2-win-x64.zip", "node-v16.14.2-win-x64", "4731da4fbb2015d414e871fa9118cabb643bdb6dbdc8a69a3ed563266ac93229"),
},
node_version = "16.13.2",
node_version = "16.14.2",
node_urls = [
"https://nodejs.org/dist/v{version}/{filename}",
],
Expand Down
4 changes: 2 additions & 2 deletions dev_docs/contributing/documentation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ node scripts/docs.js --open
## REST APIs
REST APIs should be documented using the following formats:

- [API doc template](https://raw.githubusercontent.com/elastic/docs/main/shared/api-ref-ex.asciidoc)
- [API object definition template](https://raw.githubusercontent.com/elastic/docs/main/shared/api-definitions-ex.asciidoc)
- [API doc template](https://raw.githubusercontent.com/elastic/docs/master/shared/api-ref-ex.asciidoc)
- [API object definition template](https://raw.githubusercontent.com/elastic/docs/master/shared/api-definitions-ex.asciidoc)

## Developer documentation

Expand Down
25 changes: 9 additions & 16 deletions docs/developer/advanced/upgrading-nodejs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,26 @@ These files must be updated when upgrading Node.js:
- {kib-repo}blob/{branch}/WORKSPACE.bazel[`WORKSPACE.bazel`] - The version is specified in the `node_version` property.
Besides this property, the list of files under `node_repositories` must be updated along with their respective SHA256 hashes.
These can be found on the https://nodejs.org[nodejs.org] website.
Example for Node.js v14.16.1: https://nodejs.org/dist/v14.16.1/SHASUMS256.txt.asc
Example for Node.js v16.14.2: https://nodejs.org/dist/v16.14.2/SHASUMS256.txt.asc

See PR {kib-repo}pull/96382[#96382] for an example of how the Node.js version has been upgraded previously.

In the 6.8 branch, neither the `.ci/Dockerfile` file nor the `WORKSPACE.bazel` file exists, so when upgrading Node.js in that branch, just skip those files.
See PR {kib-repo}pull/128123[#128123] for an example of how the Node.js version has been upgraded previously.

=== Backporting

The following rules are not set in stone.
Use best judgement when backporting.

Currently version 7.11 and newer run Node.js 14, while 7.10 and older run Node.js 10.
Hence, upgrades to either Node.js 14 or Node.js 10 should be done as separate PRs.

==== Node.js patch upgrades

Typically, you want to backport Node.js *patch* upgrades to all supported release branches that run the same *major* Node.js version:
Typically, you want to backport Node.js *patch* upgrades to all supported release branches that run the same *major* Node.js version (which currently is all of them, but this might change in the future once Node.js v18 is released and becomes LTS):

- If upgrading Node.js 14, and the current release is 7.11.1, the main PR should target `master` and be backported to `7.x` and `7.11`.
- If upgrading Node.js 10, the main PR should target `6.8` only.
- If upgrading Node.js 16, and the current release is 8.1.x, the main PR should target `main` and be backported to `7.17` and `8.1`.

==== Node.js minor upgrades

Typically, you want to backport Node.js *minor* upgrades to the next minor {kib} release branch that runs the same *major* Node.js version:

- If upgrading Node.js 14, and the current release is 7.11.1, the main PR should target `master` and be backported to `7.x`, while leaving the `7.11` branch as-is.
- If upgrading Node.js 10, the main PR should target `6.8` only.
- If upgrading Node.js 16, and the current release is 8.1.x, the main PR should target `main` and be backported to `7.17`, while leaving the `8.1` branch as-is.

=== Upgrading installed Node.js version

Expand All @@ -56,11 +49,11 @@ Run the following to install the new Node.js version. Replace `<version>` with t
nvm install <version>
----

To get the same global npm modules installed with the new version of Node.js as is currently installed, use the `--reinstall-packages-from` command-line argument (optionally replace `14` with the desired source version):
To get the same global npm modules installed with the new version of Node.js as is currently installed, use the `--reinstall-packages-from` command-line argument (optionally replace `16` with the desired source version):

[source,bash]
----
nvm install <version> --reinstall-packages-from=14
nvm install <version> --reinstall-packages-from=16
----

If needed, uninstall the old version of Node.js by running the following. Replace `<old-version>` with the full version number of the version that should be uninstalled:
Expand All @@ -70,11 +63,11 @@ If needed, uninstall the old version of Node.js by running the following. Replac
nvm uninstall <old-version>
----

Optionally, tell nvm to always use the "highest" installed Node.js 14 version. Replace `14` if a different major version is desired:
Optionally, tell nvm to always use the "highest" installed Node.js 16 version. Replace `16` if a different major version is desired:

[source,bash]
----
nvm alias default 14
nvm alias default 16
----

Alternatively, include the full version number at the end to specify a specific default version.
4 changes: 4 additions & 0 deletions docs/user/security/audit-logging.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ Refer to the corresponding {es} logs for potential write errors.
| `success` | User has accessed a rule.
| `failure` | User is not authorized to access a rule.

.2+| `rule_get_execution_log`
| `success` | User has accessed execution log for a rule.
| `failure` | User is not authorized to access execution log for a rule.

.2+| `rule_find`
| `success` | User has accessed a rule as part of a search operation.
| `failure` | User is not authorized to search for rules.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
"url": "https://github.com/elastic/kibana.git"
},
"engines": {
"node": "16.13.2",
"node": "16.14.2",
"yarn": "^1.21.1"
},
"resolutions": {
"**/@babel/runtime": "^7.17.2",
"**/@types/node": "16.10.2",
"**/@types/node": "16.11.7",
"**/chokidar": "^3.4.3",
"**/deepmerge": "^4.2.2",
"**/fast-deep-equal": "^3.1.1",
Expand Down Expand Up @@ -655,7 +655,7 @@
"@types/mustache": "^0.8.31",
"@types/ncp": "^2.0.1",
"@types/nock": "^10.0.3",
"@types/node": "16.10.2",
"@types/node": "16.11.7",
"@types/node-fetch": "^2.6.0",
"@types/node-forge": "^1.0.1",
"@types/nodemailer": "^6.4.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
droppedTransactionSpans: `${APM_DOCS}guide/${DOC_LINK_VERSION}/data-model-spans.html#data-model-dropped-spans`,
upgrading: `${APM_DOCS}guide/${DOC_LINK_VERSION}/upgrade.html`,
metaData: `${APM_DOCS}guide/${DOC_LINK_VERSION}/data-model-metadata.html`,
overview: `${APM_DOCS}guide/${DOC_LINK_VERSION}/apm-overview.html`,
tailSamplingPolicies: `${APM_DOCS}guide/${DOC_LINK_VERSION}/configure-tail-based-sampling.html`,
},
canvas: {
guide: `${KIBANA_DOCS}canvas.html`,
Expand All @@ -65,6 +67,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
discover: {
guide: `${KIBANA_DOCS}discover.html`,
fieldStatistics: `${KIBANA_DOCS}show-field-statistics.html`,
documentExplorer: `${KIBANA_DOCS}document-explorer.html`,
},
filebeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
Expand Down Expand Up @@ -396,6 +399,11 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
monitorUptime: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime.html`,
tlsCertificate: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/tls-certificate-alert.html`,
uptimeDurationAnomaly: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/duration-anomaly-alert.html`,
monitorLogs: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-logs.html`,
analyzeMetrics: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/analyze-metrics.html`,
monitorUptimeSynthetics: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime-synthetics.html`,
userExperience: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/user-experience.html`,
createAlerts: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/create-alerts.html`,
},
alerting: {
guide: `${KIBANA_DOCS}create-and-manage-rules.html`,
Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface DocLinks {
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
readonly overview: string;
readonly tailSamplingPolicies: string;
};
readonly canvas: {
readonly guide: string;
Expand Down Expand Up @@ -289,6 +291,11 @@ export interface DocLinks {
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
monitorLogs: string;
analyzeMetrics: string;
monitorUptimeSynthetics: string;
userExperience: string;
createAlerts: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Readonly<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function registerThemeSwitcherAddon() {
'eui-theme-css'
) as HTMLLinkElement | null;

if (stylesheet) {
if (stylesheet && globals.euiTheme) {
stylesheet.href = `kbn-ui-shared-deps-npm.${globals.euiTheme}.css`;
}
});
Expand Down
7 changes: 6 additions & 1 deletion src/dev/build/tasks/copy_source_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const CopySource: Task = {
'src/**',
'!src/**/*.{test,test.mocks,mock}.{js,ts,tsx}',
'!src/**/mocks.ts', // special file who imports .mock files
'!src/**/{target,__tests__,__snapshots__,__mocks__,integration_tests,__fixtures__}/**',
'!src/**/{target,tests,__jest__,test_data,__tests__,__snapshots__,__mocks__,integration_tests,__fixtures__}/**',
'!src/core/server/core_app/assets/favicons/favicon.distribution.png',
'!src/core/server/core_app/assets/favicons/favicon.distribution.svg',
'!src/test_utils/**',
Expand All @@ -30,6 +30,11 @@ export const CopySource: Task = {
'!src/functional_test_runner/**',
'!src/dev/**',
'!**/jest.config.js',
'!**/jest.integration.config.js',
'!**/mocks.js',
'!**/test_utils.js',
'!**/test_helpers.js',
'!**/*.{md,mdx,asciidoc}',
'!src/plugins/telemetry/schema/**', // Skip telemetry schemas
// this is the dev-only entry
'!src/setup_node_env/index.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,35 @@ describe('AdvancedSettings', () => {
).toHaveLength(1);
});

it('should should not render a custom setting', async () => {
// The manual mock for the uiSettings client returns false for isConfig, override that
const uiSettings = mockConfig().core.uiSettings;
uiSettings.isCustom = (key) => true;

const customSettingQuery = 'test:customstring:setting';
mockQuery(customSettingQuery);
const component = mountWithI18nProvider(
<AdvancedSettings
history={mockHistory}
enableSaving={true}
toasts={notificationServiceMock.createStartContract().toasts}
docLinks={docLinksServiceMock.createStartContract().links}
uiSettings={uiSettings}
componentRegistry={new ComponentRegistry().start}
theme={themeServiceMock.createStartContract().theme$}
/>
);

expect(
component
.find('Field')
.filterWhere(
(n: ReactWrapper) =>
(n.prop('setting') as Record<string, any>).name === customSettingQuery
)
).toEqual({});
});

it('should render read-only when saving is disabled', async () => {
mockQuery();
const component = mountWithI18nProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export class AdvancedSettings extends Component<AdvancedSettingsProps, AdvancedS
});
})
.filter((c) => !c.readOnly)
.filter((c) => !c.isCustom) // hide any settings that aren't explicitly registered by enabled plugins.
.sort(fieldSorter);
}

Expand Down
Loading

0 comments on commit a149ead

Please sign in to comment.