Skip to content

Commit

Permalink
Merge branch 'main' into eui/43.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl committed Dec 15, 2021
2 parents d5b68ce + 014d3dd commit 75f7ac4
Show file tree
Hide file tree
Showing 76 changed files with 2,364 additions and 1,269 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/post_build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ echo "--- Upload Build Artifacts"
# Moving to `target/` first will keep `buildkite-agent` from including directories in the artifact name
cd "$KIBANA_DIR/target"
cp kibana-*-linux-x86_64.tar.gz kibana-default.tar.gz
buildkite-agent artifact upload "./*.tar.gz;./*.zip"
buildkite-agent artifact upload "./*.tar.gz;./*.zip;./*.deb;./*.rpm"
cd -
2 changes: 1 addition & 1 deletion docs/api/saved-objects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Manage {kib} saved objects, including dashboards, visualizations, and more.
WARNING: Do not write documents directly to the `.kibana` index. When you write directly
to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions.

NOTE: For managing {kib} index patterns, use the <<data-views-api, index patterns API>>.
NOTE: For managing {data-sources}, use the <<data-views-api, {data-sources} API>>.

The following saved objects APIs are available:

Expand Down
4 changes: 2 additions & 2 deletions docs/api/saved-objects/bulk_create.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Saved objects that are unable to persist are replaced with an error object.
[[saved-objects-api-bulk-create-example]]
==== Example

Create an index pattern with the `my-pattern` ID, and a dashboard with the `my-dashboard` ID:
Create {a-data-source} with the `my-pattern` ID, and a dashboard with the `my-dashboard` ID:

[source,sh]
--------------------------------------------------
Expand Down Expand Up @@ -122,7 +122,7 @@ The API returns the following:
}
--------------------------------------------------

There is already a saved object with the `my-dashboard` ID, so only the index pattern is created.
There is already a saved object with the `my-dashboard` ID, so only the {data-source} is created.

[[saved-objects-api-bulk-create-conflict-errors]]
==== Conflict errors
Expand Down
4 changes: 2 additions & 2 deletions docs/api/saved-objects/bulk_get.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Saved objects that are unable to persist are replaced with an error object.
[[saved-objects-api-bulk-get-body-example]]
==== Example

Retrieve an index pattern with the `my-pattern` ID, and a dashboard with the `my-dashboard` ID:
Retrieve a {data-source} with the `my-pattern` ID, and a dashboard with the `my-dashboard` ID:

[source,sh]
--------------------------------------------------
Expand Down Expand Up @@ -103,4 +103,4 @@ The API returns the following:
}
--------------------------------------------------

Only the index pattern exists.
Only the {data-source} exists.
2 changes: 1 addition & 1 deletion docs/api/saved-objects/delete.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TIP: Use this if you attempted to delete an object and received an HTTP 400 erro

==== Example

Delete an index pattern object with the `my-pattern` ID:
Delete {a-data-source} object with the `my-pattern` ID:

[source,sh]
--------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/api/saved-objects/export.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ When `excludeExportDetails=false` (the default) we append an export result detai
[[ssaved-objects-api-create-example]]
==== Examples

Export all index pattern saved objects:
Export all {data-source} saved objects:

[source,sh]
--------------------------------------------------
Expand All @@ -78,7 +78,7 @@ $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: a
--------------------------------------------------
// KIBANA

Export all index pattern saved objects and exclude the export summary from the stream:
Export all {data-source} saved objects and exclude the export summary from the stream:

[source,sh]
--------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/api/saved-objects/find.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ change. Use the find API for traditional paginated results, but avoid using it t

==== Examples

Find index patterns with titles that start with `my`:
Find {data-sources} with titles that start with `my`:

[source,sh]
--------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/api/saved-objects/get.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ experimental[] Retrieve a single {kib} saved object by ID.
[[saved-objects-api-get-example]]
==== Example

Retrieve the index pattern object with the `my-pattern` ID:
Retrieve the {data-source} object with the `my-pattern` ID:

[source,sh]
--------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions docs/api/saved-objects/import.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ to resolve errors, refer to the <<saved-objects-api-import-example,examples>>.
[[saved-objects-api-import-example-1]]
===== Successful import with `createNewCopies` enabled

Import an index pattern and dashboard:
Import {a-data-source} and dashboard:

[source,sh]
--------------------------------------------------
Expand Down Expand Up @@ -147,7 +147,7 @@ The result indicates a successful import, and both objects are created. Since th
[[saved-objects-api-import-example-2]]
===== Successful import with `createNewCopies` disabled

Import an index pattern and dashboard:
Import {a-data-source} and dashboard:

[source,sh]
--------------------------------------------------
Expand Down Expand Up @@ -196,7 +196,7 @@ The result indicates a successful import, and both objects are created.
[[saved-objects-api-import-example-3]]
===== Failed import with conflict errors

Import an index pattern, visualization, *Canvas* workpad, and dashboard that include saved objects:
Import {a-data-source}, visualization, *Canvas* workpad, and dashboard that include saved objects:

[source,sh]
--------------------------------------------------
Expand Down Expand Up @@ -285,10 +285,10 @@ The API returns the following:
}
--------------------------------------------------

The result indicates an unsuccessful import because the index pattern, visualization, *Canvas* workpad, and dashboard resulted in a conflict
The result indicates an unsuccessful import because the {data-source}, visualization, *Canvas* workpad, and dashboard resulted in a conflict
error:

* An index pattern with the same ID already exists, which resulted in a conflict error. To resolve the error, overwrite the existing object,
* A {data-source} with the same ID already exists, which resulted in a conflict error. To resolve the error, overwrite the existing object,
or skip the object.

* A visualization with a different ID, but the same origin already exists, which resulted in a conflict error. The `destinationId` field
Expand All @@ -307,7 +307,7 @@ Objects are created when the error is resolved using the <<saved-objects-api-res
[[saved-objects-api-import-example-4]]
===== Failed import with missing reference errors

Import a visualization and dashboard when the index pattern for the visualization doesn't exist:
Import a visualization and dashboard when the {data-source} for the visualization doesn't exist:

[source,sh]
--------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/api/saved-objects/resolve.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object can be retrieved via the Resolve API using either its new ID or its old I
[[saved-objects-api-resolve-example]]
==== Example

Retrieve the index pattern object with the `my-pattern` ID:
Retrieve the {data-source} object with the `my-pattern` ID:

[source,sh]
--------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/api/saved-objects/resolve_import_errors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ to the <<saved-objects-api-resolve-import-errors-example, examples>>.

This example builds upon the <<saved-objects-api-import-example-3,Import objects API example with conflict errors>>.

Resolve conflict errors for an index pattern, visualization, and *Canvas* workpad by overwriting the existing saved objects:
Resolve conflict errors for {a-data-source}, visualization, and *Canvas* workpad by overwriting the existing saved objects:

[source,sh]
--------------------------------------------------
Expand Down Expand Up @@ -173,7 +173,7 @@ that were returned in the `successResults` array. In this example, we retried im

This example builds upon the <<saved-objects-api-import-example-4,Import objects API example with missing reference errors>>.

Resolve a missing reference error for a visualization by replacing the index pattern with another, and resolve a missing reference error for
Resolve a missing reference error for a visualization by replacing the {data-source} with another, and resolve a missing reference error for
a search by ignoring it:

[source,sh]
Expand Down
2 changes: 1 addition & 1 deletion docs/api/saved-objects/update.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ WARNING: When you update, attributes are not validated, which allows you to pass
[[saved-objects-api-update-example]]
==== Example

Update an existing index pattern object,`my-pattern`, with a different title:
Update an existing {data-source} object,`my-pattern`, with a different title:

[source,sh]
--------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions docs/api/spaces-management/copy_saved_objects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
experimental[] Copy saved objects between spaces.

It also allows you to automatically copy related objects, so when you copy a `dashboard`, this can automatically copy over the
associated visualizations, index patterns, and saved searches, as required.
associated visualizations, {data-sources}, and saved searches, as required.

You can request to overwrite any objects that already exist in the target space if they share an ID, or you can use the
<<spaces-api-resolve-copy-saved-objects-conflicts, Resolve copy saved objects conflicts API>> to do this on a per-object basis.
Expand Down Expand Up @@ -125,7 +125,7 @@ refer to the <<spaces-api-copy-saved-objects-example,examples>>.
===== Successful copy (with `createNewCopies` enabled)

Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example,
the dashboard has a reference to a visualization, and that has a reference to an index pattern:
the dashboard has a reference to a visualization, and that has a reference to {a-data-source}:

[source,sh]
----
Expand Down Expand Up @@ -189,7 +189,7 @@ The result indicates a successful copy, and all three objects are created. Since
===== Successful copy (with `createNewCopies` disabled)

Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example,
the dashboard has a reference to a visualization, and that has a reference to an index pattern:
the dashboard has a reference to a visualization, and that has a reference to {a-data-source}:

[source,sh]
----
Expand Down Expand Up @@ -379,10 +379,10 @@ The API returns the following:
}
----

The result indicates a successful copy for the `marketing` space, and an unsuccessful copy for the `sales` space because the index pattern,
The result indicates a successful copy for the `marketing` space, and an unsuccessful copy for the `sales` space because the {data-source},
visualization, and *Canvas* workpad each resulted in a conflict error:

* An index pattern with the same ID already exists, which resulted in a conflict error. To resolve the error, overwrite the existing object,
* A {data-source} with the same ID already exists, which resulted in a conflict error. To resolve the error, overwrite the existing object,
or skip the object.

* A visualization with a different ID, but the same origin already exists, which resulted in a conflict error. The `destinationId` field
Expand All @@ -403,7 +403,7 @@ API>>.
===== Failed copy (with missing reference errors)

Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example,
the dashboard has a reference to a visualization and a *Canvas* workpad, and the visualization has a reference to an index pattern:
the dashboard has a reference to a visualization and a *Canvas* workpad, and the visualization has a reference to {a-data-source}:

[source,sh]
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ refer to the <<spaces-api-resolve-copy-saved-objects-conflicts-example,examples>

This example builds upon the <<spaces-api-copy-saved-objects-example-3,Copy objects API example with conflict errors>>.

Resolve conflict errors for an index pattern, visualization, and *Canvas* workpad by overwriting the existing saved objects:
Resolve conflict errors for {a-data-source}, visualization, and *Canvas* workpad by overwriting the existing saved objects:

[source,sh]
----
Expand Down
28 changes: 26 additions & 2 deletions packages/kbn-es/src/artifact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ beforeEach(() => {
valid: {
archives: [createArchive({ license: 'oss' }), createArchive({ license: 'default' })],
},
invalidArch: {
archives: [
createArchive({ license: 'oss', architecture: 'invalid_arch' }),
createArchive({ license: 'default', architecture: 'invalid_arch' }),
],
},
differentVersion: {
archives: [
createArchive({ license: 'oss', version: 'another-version' }),
createArchive({ license: 'default', version: 'another-version' }),
],
},
multipleArch: {
archives: [
createArchive({ architecture: 'fake_arch', license: 'oss' }),
Expand Down Expand Up @@ -116,8 +128,14 @@ describe('Artifact', () => {
artifactTest('INVALID_LICENSE', 'default')
);

it('should return an artifact even if the version does not match', async () => {
mockFetch(MOCKS.differentVersion);
artifactTest('default', 'default');
});

it('should throw when an artifact cannot be found in the manifest for the specified parameters', async () => {
await expect(Artifact.getSnapshot('default', 'INVALID_VERSION', log)).rejects.toThrow(
mockFetch(MOCKS.invalidArch);
await expect(Artifact.getSnapshot('default', MOCK_VERSION, log)).rejects.toThrow(
"couldn't find an artifact"
);
});
Expand All @@ -144,8 +162,14 @@ describe('Artifact', () => {
artifactTest('INVALID_LICENSE', 'default', 2)
);

it('should return an artifact even if the version does not match', async () => {
mockFetch(MOCKS.differentVersion);
artifactTest('default', 'default', 2);
});

it('should throw when an artifact cannot be found in the manifest for the specified parameters', async () => {
await expect(Artifact.getSnapshot('default', 'INVALID_VERSION', log)).rejects.toThrow(
mockFetch(MOCKS.invalidArch);
await expect(Artifact.getSnapshot('default', MOCK_VERSION, log)).rejects.toThrow(
"couldn't find an artifact"
);
});
Expand Down
14 changes: 8 additions & 6 deletions packages/kbn-es/src/artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,18 @@ async function getArtifactSpecForSnapshot(
const arch = process.arch === 'arm64' ? 'aarch64' : 'x86_64';

const archive = manifest.archives.find(
(a) =>
a.version === desiredVersion &&
a.platform === platform &&
a.license === desiredLicense &&
a.architecture === arch
(a) => a.platform === platform && a.license === desiredLicense && a.architecture === arch
);

if (!archive) {
throw createCliError(
`Snapshots for ${desiredVersion} are available, but couldn't find an artifact in the manifest for [${desiredVersion}, ${desiredLicense}, ${platform}]`
`Snapshots are available, but couldn't find an artifact in the manifest for [${desiredLicense}, ${platform}, ${arch}]`
);
}

if (archive.version !== desiredVersion) {
log.warning(
`Snapshot found, but version does not match Kibana. Kibana: ${desiredVersion}, Snapshot: ${archive.version}`
);
}

Expand Down
10 changes: 10 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@
"enabled": true,
"stabilityDays": 7
},
{
"groupName": "typescript",
"matchPackageNames": ["typescript", "prettier", "@types/jsdom"],
"matchPackagePatterns": ["^@typescript-eslint"],
"reviewers": ["team:kibana-operations"],
"matchBaseBranches": ["main"],
"labels": ["Team:Operations", "release_note:skip"],
"enabled": true,
"stabilityDays": 7
},
{
"groupName": "polyfills",
"matchPackageNames": ["core-js"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ kibana_vars=(
xpack.fleet.agents.kibana.host
xpack.fleet.agents.tlsCheckDisabled
xpack.fleet.packages
xpack.fleet.registryProxyUrl
xpack.fleet.registryUrl
xpack.graph.canEditDrillDownUrls
xpack.graph.savePolicy
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/dashboard_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'dashboard']);

describe('dashboard data-shared attributes', () => {
describe('dashboard options', () => {
let originalTitles: string[] = [];

before(async () => {
Expand Down
Loading

0 comments on commit 75f7ac4

Please sign in to comment.