Skip to content

Commit

Permalink
Merge branch 'main' into 191951_rbac_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 7, 2024
2 parents 4f3ed59 + 02f277e commit a5d476d
Show file tree
Hide file tree
Showing 56 changed files with 1,737 additions and 117 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ packages/presentation/presentation_containers @elastic/kibana-presentation
src/plugins/presentation_panel @elastic/kibana-presentation
packages/presentation/presentation_publishing @elastic/kibana-presentation
src/plugins/presentation_util @elastic/kibana-presentation
x-pack/packages/ai-infra/product-doc-artifact-builder @elastic/appex-ai-infra
x-pack/plugins/observability_solution/profiling_data_access @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/profiling @elastic/obs-ux-infra_services-team
packages/kbn-profiling-utils @elastic/obs-ux-infra_services-team
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/undeploy-my-kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'ci:project-deploy-observability')
runs-on: ubuntu-latest
steps:
- uses: elastic/apm-pipeline-library/.github/actions/github-token@current
with:
url: ${{ secrets.OBLT_VAULT_ADDR }}
roleId: ${{ secrets.OBLT_VAULT_ROLE_ID }}
secretId: ${{ secrets.OBLT_VAULT_SECRET_ID }}

- uses: elastic/apm-pipeline-library/.github/actions/undeploy-my-kibana@current
- uses: elastic/oblt-actions/oblt-cli/undeploy-my-kibana@v1
with:
token: ${{ env.GITHUB_TOKEN }}
github-app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
github-app-private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,7 @@
"@kbn/picomatcher": "link:packages/kbn-picomatcher",
"@kbn/plugin-generator": "link:packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers",
"@kbn/product-doc-artifact-builder": "link:x-pack/packages/ai-infra/product-doc-artifact-builder",
"@kbn/repo-file-maps": "link:packages/kbn-repo-file-maps",
"@kbn/repo-linter": "link:packages/kbn-repo-linter",
"@kbn/repo-path": "link:packages/kbn-repo-path",
Expand Down
11 changes: 11 additions & 0 deletions scripts/build_product_doc_artifacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

require('../src/setup_node_env');
require('@kbn/product-doc-artifact-builder').runScript();
1 change: 1 addition & 0 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const IGNORE_DIRECTORY_GLOBS = [
'src/babel-*',
'packages/*',
'packages/core/*/*',
'x-pack/packages/ai-infra/*',
'packages/kbn-pm/src/utils/__fixtures__/*',
'packages/kbn-check-prod-native-modules-cli/integration_tests/__fixtures__/*/node_modules/*',
'x-pack/dev-tools',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export function Main({ currentTabProp, isEmbeddable = false }: MainProps) {
<EuiToolTip content={MAIN_PANEL_LABELS.exportButtonTooltip}>
<EuiButtonEmpty
iconType="exportAction"
disabled={inputEditorValue === ''}
onClick={() =>
downloadFileAs(EXPORT_FILE_NAME, {
content: inputEditorValue,
Expand Down
29 changes: 8 additions & 21 deletions test/functional/apps/management/data_views/_edit_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const retry = getService('retry');
const PageObjects = getPageObjects(['settings']);
const testSubjects = getService('testSubjects');

describe('edit field', function () {
before(async function () {
Expand All @@ -33,29 +30,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('should show preview for fields in _source', async function () {
await PageObjects.settings.filterField('extension');
await testSubjects.click('editFieldFormat');
await testSubjects.find('value');
let previewText = '';
await retry.waitForWithTimeout('get preview value', 1000, async () => {
previewText = await testSubjects.getVisibleText('value');
return previewText !== 'Value not set';
await PageObjects.settings.changeAndValidateFieldFormat({
name: 'extension',
fieldType: 'text',
expectedPreviewText: 'css',
});
expect(previewText).to.be('css');
await PageObjects.settings.closeIndexPatternFieldEditor();
});

it('should show preview for fields not in _source', async function () {
await PageObjects.settings.filterField('extension.raw');
await testSubjects.click('editFieldFormat');
await testSubjects.find('value');
let previewText = '';
await retry.waitForWithTimeout('get preview value', 1000, async () => {
previewText = await testSubjects.getVisibleText('value');
return previewText !== 'Value not set';
await PageObjects.settings.changeAndValidateFieldFormat({
name: 'extension.raw',
fieldType: 'keyword',
expectedPreviewText: 'css',
});
expect(previewText).to.be('css');
await PageObjects.settings.closeIndexPatternFieldEditor();
});
});
});
Expand Down
15 changes: 13 additions & 2 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,15 @@ export class SettingsPageObject extends FtrService {
);
}

async changeAndValidateFieldFormat(name: string, fieldType: string) {
async changeAndValidateFieldFormat({
name,
fieldType,
expectedPreviewText,
}: {
name: string;
fieldType: string;
expectedPreviewText: string;
}) {
await this.filterField(name);
await this.setFieldTypeFilter(fieldType);
await this.testSubjects.click('editFieldFormat');
Expand All @@ -1062,7 +1070,10 @@ export class SettingsPageObject extends FtrService {

await this.retry.tryForTime(5000, async () => {
const previewText = await this.testSubjects.getVisibleText('fieldPreviewItem > value');
expect(previewText).to.be('css');
expect(previewText).to.eql(
expectedPreviewText,
`Expected previewText to eql [${expectedPreviewText}], but got: [${previewText}]`
);
});
await this.closeIndexPatternFieldEditor();
}
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,8 @@
"@kbn/presentation-publishing/*": ["packages/presentation/presentation_publishing/*"],
"@kbn/presentation-util-plugin": ["src/plugins/presentation_util"],
"@kbn/presentation-util-plugin/*": ["src/plugins/presentation_util/*"],
"@kbn/product-doc-artifact-builder": ["x-pack/packages/ai-infra/product-doc-artifact-builder"],
"@kbn/product-doc-artifact-builder/*": ["x-pack/packages/ai-infra/product-doc-artifact-builder/*"],
"@kbn/profiling-data-access-plugin": ["x-pack/plugins/observability_solution/profiling_data_access"],
"@kbn/profiling-data-access-plugin/*": ["x-pack/plugins/observability_solution/profiling_data_access/*"],
"@kbn/profiling-plugin": ["x-pack/plugins/observability_solution/profiling"],
Expand Down Expand Up @@ -2078,4 +2080,4 @@
"@kbn/ambient-storybook-types"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/product-doc-artifact-builder

Script to build the knowledge base artifacts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { runScript } from './src/command';
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/ai-infra/product-doc-artifact-builder'],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "shared-common",
"id": "@kbn/product-doc-artifact-builder",
"owner": "@elastic/appex-ai-infra",
"devOnly": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@kbn/product-doc-artifact-builder",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const getArtifactName = ({
productName,
productVersion,
}: {
productName: string;
productVersion: string;
}): string => {
return `kibana-kb-${productName}-${productVersion}.zip`.toLowerCase();
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export interface ArtifactManifest {
formatVersion: string;
productName: string;
productVersion: string;
}

export const getArtifactManifest = ({
productName,
stackVersion,
}: {
productName: string;
stackVersion: string;
}): ArtifactManifest => {
return {
formatVersion: '1.0.0',
productName,
productVersion: stackVersion,
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/types';

export const getArtifactMappings = (inferenceEndpoint: string): MappingTypeMapping => {
return {
dynamic: 'strict',
properties: {
content_title: { type: 'text' },
content_body: {
type: 'semantic_text',
inference_id: inferenceEndpoint,
},
product_name: { type: 'keyword' },
root_type: { type: 'keyword' },
slug: { type: 'keyword' },
url: { type: 'keyword' },
version: { type: 'version' },
ai_subtitle: {
type: 'semantic_text',
inference_id: inferenceEndpoint,
},
ai_summary: {
type: 'semantic_text',
inference_id: inferenceEndpoint,
},
ai_questions_answered: {
type: 'semantic_text',
inference_id: inferenceEndpoint,
},
ai_tags: { type: 'keyword' },
},
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

/**
* The allowed product names, as found in the source's cluster
*/
export const sourceProductNames = ['Kibana', 'Elasticsearch', 'Security', 'Observability'];
Loading

0 comments on commit a5d476d

Please sign in to comment.