Skip to content

Commit

Permalink
Merge branch 'main' into view_request_flyout
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 21, 2022
2 parents 9cd131b + e0d667b commit 356abd9
Show file tree
Hide file tree
Showing 738 changed files with 16,737 additions and 5,402 deletions.
2 changes: 2 additions & 0 deletions .buildkite/pipelines/flaky_tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ for (const testSuite of testSuites) {
concurrency_group: UUID,
concurrency_method: 'eager',
});
break;

case 'cypress':
const CYPRESS_SUITE = CI_GROUP;
const group = groups.find((group) => group.key.includes(CYPRESS_SUITE));
Expand Down
12 changes: 9 additions & 3 deletions .buildkite/scripts/steps/code_coverage/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ exitCode=0
while read -r config; do
if [ "$((i % JOB_COUNT))" -eq "$JOB" ]; then
echo "--- $ node scripts/jest --config $config --coverage --coverageReporters json --coverageDirectory target/kibana-coverage/jest"
node --max-old-space-size=14336 ./node_modules/.bin/jest --runInBand --config="$config" --coverage --coverageReporters json --coverageDirectory target/kibana-coverage/jest || true
echo "Rename coverage-final.json to avoid overwrite"
mv target/kibana-coverage/jest/coverage-final.json "./target/kibana-coverage/jest/coverage-$(date +%s%3N).json"
node --max-old-space-size=14336 ./node_modules/.bin/jest --runInBand --config="$config" \
--coverage --coverageReporters json --coverageDirectory target/kibana-coverage/jest \
--passWithNoTests || true
if [[ -f "target/kibana-coverage/jest/coverage-final.json" ]]; then
echo "Rename coverage-final.json to avoid overwrite"
mv target/kibana-coverage/jest/coverage-final.json "./target/kibana-coverage/jest/coverage-$(date +%s%3N).json"
else
echo "Cannot find coverage-final.json"
fi
lastCode=$?

if [ $lastCode -ne 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/demo_env/es_and_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mkdir -p target

export ES_IMAGE="gcr.io/elastic-kibana-184716/demo/elasticsearch:$DEPLOYMENT_NAME-$(git rev-parse HEAD)"

DOCKER_EXPORT_URL=$(curl https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$DEPLOYMENT_VERSION/manifest-latest-verified.json | jq -r '.archives | .[] | select(.platform=="docker") | .url')
DOCKER_EXPORT_URL=$(curl https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$DEPLOYMENT_VERSION/manifest-latest-verified.json | jq -r '.archives | .[] | select(.url | test("docker-image")) | .url')
curl "$DOCKER_EXPORT_URL" > target/elasticsearch-docker.tar.gz
docker load < target/elasticsearch-docker.tar.gz
docker tag "docker.elastic.co/elasticsearch/elasticsearch:$DEPLOYMENT_VERSION-SNAPSHOT" "$ES_IMAGE"
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/label-failed-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
issues:
types:
- labeled

jobs:
issue_commented:
name: Label failed test issue
if: |
!github.event.issue.pull_request
&& github.event.label.name == 'failed-test'
runs-on: ubuntu-latest
steps:
- name: Checkout kibana-operations
uses: actions/checkout@v2
with:
repository: 'elastic/kibana-operations'
ref: main
path: ./kibana-operations
token: ${{secrets.KIBANAMACHINE_TOKEN}}

- name: Label failed test issue
working-directory: ./kibana-operations/triage
env:
GITHUB_TOKEN: ${{secrets.KIBANAMACHINE_TOKEN}}
run: |
npm install
node failed-test-label ${{github.event.issue.number}} || true
25 changes: 18 additions & 7 deletions docs/api/saved-objects/bulk_resolve.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,24 @@ The API returns the following:

Only the index pattern exists, the dashboard was not found.

The `outcome` field may be any of the following:

* `"exactMatch"` -- One document exactly matched the given ID, *or* {kib} failed to find this object.
* `"aliasMatch"` -- One document with a legacy URL alias matched the given ID; in this case the `saved_object.id` field is different than the given ID.
* `"conflict"` -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the `saved_object` object is the exact match, and the `saved_object.id` field is the same as the given ID.

If the outcome is `"aliasMatch"` or `"conflict"`, the response will also include an `alias_target_id` field. This means that an alias was found for another object, and it describes that other object's ID.
[NOTE]
====
In addition to `saved_object`, several fields can be returned:
* `outcome` (required string) -- One of the following values:
- `"exactMatch"` -- One document exactly matched the given ID.
- `"aliasMatch"` -- One document with a legacy URL alias matched the given ID; in this case the `saved_object.id` field is different than
the given ID.
- `"conflict"` -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the
`saved_object` object is the exact match, and the `saved_object.id` field is the same as the given ID.
* `alias_target_id` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the
`alias_target_id` field. This means that an alias was found for another object, and it describes that other object's ID.
* `alias_purpose` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the
`alias_purpose` field. This indicates why the alias was created, and it can be used to change the client behavior accordingly. One of the
following values: `"savedObjectConversion"`, `"savedObjectImport"`
Client-side code uses these fields to behave differently depending on the `outcome` -- <<sharing-saved-objects-step-3,learn more>>.
====

Retrieve a dashboard object in the `testspace` by ID:

Expand Down
25 changes: 18 additions & 7 deletions docs/api/saved-objects/resolve.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,24 @@ The API returns the following:
}
--------------------------------------------------

The `outcome` field may be any of the following:

* `"exactMatch"` -- One document exactly matched the given ID.
* `"aliasMatch"` -- One document with a legacy URL alias matched the given ID; in this case the `saved_object.id` field is different than the given ID.
* `"conflict"` -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the `saved_object` object is the exact match, and the `saved_object.id` field is the same as the given ID.

If the outcome is `"aliasMatch"` or `"conflict"`, the response will also include an `alias_target_id` field. This means that an alias was found for another object, and it describes that other object's ID.
[NOTE]
====
In addition to `saved_object`, several fields can be returned:
* `outcome` (required string) -- One of the following values:
- `"exactMatch"` -- One document exactly matched the given ID.
- `"aliasMatch"` -- One document with a legacy URL alias matched the given ID; in this case the `saved_object.id` field is different than
the given ID.
- `"conflict"` -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the
`saved_object` object is the exact match, and the `saved_object.id` field is the same as the given ID.
* `alias_target_id` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the
`alias_target_id` field. This means that an alias was found for another object, and it describes that other object's ID.
* `alias_purpose` (optional string) -- If the `outcome` is `"aliasMatch"` or `"conflict"`, the response will also include the
`alias_purpose` field. This indicates why the alias was created, and it can be used to change the client behavior accordingly. One of the
following values: `"savedObjectConversion"`, `"savedObjectImport"`
Client-side code uses these fields to behave differently depending on the `outcome` -- <<sharing-saved-objects-step-3,learn more>>.
====

Retrieve a dashboard object in the `testspace` by ID:

Expand Down
15 changes: 11 additions & 4 deletions docs/developer/advanced/sharing-saved-objects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,13 @@ TIP: See an example of this in https://github.com/elastic/kibana/pull/107256#use

The
https://github.com/elastic/kibana/blob/main/docs/development/core/server/kibana-plugin-core-server.savedobjectsresolveresponse.md[SavedObjectsResolveResponse
interface] has three fields, summarized below:
interface] has four fields, summarized below:

* `saved_object` - The saved object that was found.
* `outcome` - One of the following values: `'exactMatch' | 'aliasMatch' | 'conflict'`
* `alias_target_id` - This is defined if the outcome is `'aliasMatch'` or `'conflict'`. It means that a legacy URL alias with this ID points
to an object with a _different_ ID.
* `alias_purpose` - This is defined if the outcome is `'aliasMatch'` or `'conflict'`. It describes why the legacy URL alis was created.

The SavedObjectsClient is available both on the server-side and the client-side. You may be fetching the object on the server-side via a
custom HTTP route, or you may be fetching it on the client-side directly. Either way, the `outcome` and `alias_target_id` fields need to be
Expand Down Expand Up @@ -236,12 +237,18 @@ if (spacesApi && resolveResult.outcome === 'aliasMatch') {
// We found this object by a legacy URL alias from its old ID; redirect the user to the page with its new ID, preserving any URL hash
const newObjectId = resolveResult.alias_target_id!; // This is always defined if outcome === 'aliasMatch'
const newPath = `/this/page/${newObjectId}${window.location.hash}`; // Use the *local* path within this app (do not include the "/app/appId" prefix)
await spacesApi.ui.redirectLegacyUrl(newPath, OBJECT_NOUN);
await spacesApi.ui.redirectLegacyUrl({
path: newPath,
aliasPurpose: resolveResult.alias_purpose, <1>
objectNoun: OBJECT_NOUN <2>
});
return;
}
```
_Note that `OBJECT_NOUN` is optional, it just changes "object" in the toast to whatever you specify -- you may want the toast to say
"dashboard" or "index pattern" instead!_
<1> The `aliasPurpose` field is required as of 8.2, because the API response now includes the reason the alias was created to inform the
client whether a toast should be shown or not.
<2> The `objectNoun` field is optional, it just changes "object" in the toast to whatever you specify -- you may want the toast to say
"dashboard" or "index pattern" instead!

5. And finally, in your deep link page, add a function that will create a callout in the case of a `'conflict'` outcome:
+
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.
6 changes: 3 additions & 3 deletions docs/developer/contributing/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Please make sure you have signed the [Contributor License Agreement](http://www.

Read <<kibana-localization-best-practices>> for details on our localization practices.

Note that we cannot support accepting contributions to the translations from any source other than the translators we have engaged to do the work.
We are still to develop a proper process to accept any contributed translations. We certainly appreciate that people care enough about the localization effort to want to help improve the quality. We aim to build out a more comprehensive localization process for the future and will notify you once contributions can be supported, but for the time being, we are not able to incorporate suggestions.
Note that we cannot support accepting contributions to the translations from any source other than the translators we have engaged in doing the work.
We are yet to develop a proper process to accept any contributed translations. We certainly appreciate that people care enough about the localization effort to want to help improve the quality. We aim to build out a more comprehensive localization process for the future and will notify you once Kibana supports external contributions. Still, for the time being, we cannot incorporate suggestions.

[discrete]
[[kibana-release-notes-process]]
Expand Down Expand Up @@ -73,7 +73,7 @@ To make sure that your PR is included in the Release Notes, add the right label.
* `release_note:fix` — Fixes for bugs that existed in the previous release.
* `release_note:deprecation` — Deprecates functionality that existed in previous releases.
* `release_note:breaking` — Breaking changes that weren't present in previous releases.
* `release_note:skip` — Changes that should not appear in the Release Notes. For example, docs, build, and test fixes, or unreleased issues that are only in `master`.
* `release_note:skip` — Changes that should not appear in the Release Notes. For example, docs, build, and test fixes, or unreleased issues that are only in `main`.


include::development-github.asciidoc[leveloffset=+1]
Expand Down
24 changes: 9 additions & 15 deletions docs/developer/plugin/external-plugin-localization.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,12 @@ node scripts/i18n_check --fix --include-config ../kibana-extra/myPlugin/.i18nrc.
[discrete]
=== Implementing i18n in the UI

{kib} relies on several UI frameworks (ReactJS and AngularJS) and
requires localization in different environments (browser and NodeJS).
{kib} relies on ReactJS and requires localization in different environments (browser and NodeJS).
The internationalization engine is framework agnostic and consumable in
all parts of {kib} (ReactJS, AngularJS and NodeJS).
all parts of {kib} (ReactJS, and NodeJS).

To simplify
internationalization in UI frameworks, additional abstractions are
built around the I18n engine: `react-intl` for React and custom
components for AngularJS. https://github.com/yahoo/react-intl[React-intl]
is built around https://github.com/yahoo/intl-messageformat[intl-messageformat],
so both React and AngularJS frameworks use the same engine and the same
message syntax.
To simplify internationalization in React, an additional abstraction is
built around the I18n engine using https://github.com/yahoo/react-intl[React-intl] for React.


[discrete]
Expand All @@ -109,7 +103,7 @@ export const HELLO_WORLD = i18n.translate('hello.wonderful.world', {
});
-----------

Full details are {kib-repo}tree/master/packages/kbn-i18n#vanilla-js[here].
Full details are {kib-repo}tree/main/packages/kbn-i18n#vanilla-js[here].

[discrete]
==== i18n for React
Expand All @@ -133,14 +127,14 @@ export const Component = () => {
};
-----------

Full details are {kib-repo}tree/master/packages/kbn-i18n#react[here].
Full details are {kib-repo}tree/main/packages/kbn-i18n#react[here].

[discrete]
=== Resources

To learn more about i18n tooling, see {blob}src/dev/i18n/README.md[i18n dev tooling].
To learn more about i18n tooling, see {kib-repo}blob/{branch}src/dev/i18n/README.md[i18n dev tooling].

To learn more about implementing i18n in the UI, use the following links:

* {blob}packages/kbn-i18n/README.md[i18n plugin]
* {blob}packages/kbn-i18n/GUIDELINE.md[i18n guidelines]
* {kib-repo}blob/{branch}packages/kbn-i18n/README.md[i18n plugin]
* {kib-repo}blob/{branch}packages/kbn-i18n/GUIDELINE.md[i18n guidelines]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ResolvedSimpleSavedObject](./kibana-plugin-core-public.resolvedsimplesavedobject.md) &gt; [alias\_purpose](./kibana-plugin-core-public.resolvedsimplesavedobject.alias_purpose.md)

## ResolvedSimpleSavedObject.alias\_purpose property

The reason this alias was created.

Currently this is used to determine whether or not a toast should be shown when a user is redirected from a legacy URL; if the alias was created because of saved object conversion, then we will display a toast telling the user that the object has a new URL.

\*\*Note:\*\* this field is \*only\* included when an alias was found (in other words, when the outcome is `'aliasMatch'` or `'conflict'`<!-- -->).

<b>Signature:</b>

```typescript
alias_purpose?: SavedObjectsResolveResponse['alias_purpose'];
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

## ResolvedSimpleSavedObject.alias\_target\_id property

The ID of the object that the legacy URL alias points to. This is only defined when the outcome is `'aliasMatch'` or `'conflict'`<!-- -->.
The ID of the object that the legacy URL alias points to.

\*\*Note:\*\* this field is \*only\* included when an alias was found (in other words, when the outcome is `'aliasMatch'` or `'conflict'`<!-- -->).

<b>Signature:</b>

Expand Down
Loading

0 comments on commit 356abd9

Please sign in to comment.