Skip to content

Commit

Permalink
Merge branch 'main' into settings-esql
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula authored Oct 16, 2023
2 parents 1907617 + c77f30f commit 7e9ae73
Show file tree
Hide file tree
Showing 52 changed files with 1,386 additions and 486 deletions.
17 changes: 9 additions & 8 deletions .buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ steps:
EC_ENV: qa
EC_REGION: aws-eu-west-1
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)"

- label: ":pipeline::female-detective::seedling: Trigger Security Solution quality gate script"
trigger: security-serverless-quality-gate # https://buildkite.com/elastic/security-serverless-quality-gate
soft_fail: true # Remove this when tests are fixed
build:
env:
ENVIRONMENT: ${ENVIRONMENT}
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)"

# TODO: Uncomment this code when the integration is ready.
# - label: ":pipeline::female-detective::seedling: Trigger Security Solution quality gate script"
# trigger: security-serverless-quality-gate # https://buildkite.com/elastic/security-serverless-quality-gate
# soft_fail: true # Remove this when tests are fixed
# build:
# env:
# ENVIRONMENT: ${ENVIRONMENT}
# message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)"

- label: ":pipeline::ship::seedling: Trigger Fleet serverless smoke tests for ${ENVIRONMENT}"
trigger: fleet-smoke-tests # https://buildkite.com/elastic/fleet-smoke-tests
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,8 @@ module.exports = {
],
rules: {
'@kbn/telemetry/event_generating_elements_should_be_instrumented': 'error',
'@kbn/i18n/strings_should_be_translated_with_i18n': 'warn',
'@kbn/i18n/strings_should_be_translated_with_formatted_message': 'warn',
},
},
{
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ src/plugins/es_ui_shared @elastic/platform-deployment-management
packages/kbn-eslint-config @elastic/kibana-operations
packages/kbn-eslint-plugin-disable @elastic/kibana-operations
packages/kbn-eslint-plugin-eslint @elastic/kibana-operations
packages/kbn-eslint-plugin-i18n @elastic/actionable-observability
packages/kbn-eslint-plugin-imports @elastic/kibana-operations
packages/kbn-eslint-plugin-telemetry @elastic/actionable-observability
x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin @elastic/kibana-security
Expand Down
17 changes: 14 additions & 3 deletions config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,21 @@ xpack.apm.serverlessOnboarding: true

# Fleet specific configuration
xpack.fleet.internal.registry.capabilities: ['apm', 'observability']
xpack.fleet.internal.registry.kibanaVersionCheckEnabled: false
xpack.fleet.internal.registry.spec.max: '3.0'
# Disabled until packages implement the new spec https://github.com/elastic/kibana/issues/166742
# xpack.fleet.internal.registry.kibanaVersionCheckEnabled: false
# xpack.fleet.internal.registry.spec.min: '3.0'
# Temporary until all packages implement new spec https://github.com/elastic/kibana/issues/166742
xpack.fleet.internal.registry.spec.min: '1.0'
xpack.fleet.internal.registry.excludePackages: [
# Security integrations
'endpoint',
'beaconing',
'osquery_manager',
# Removed in 8.11 integrations
'cisco',
'microsoft',
'symantec',
'cyberark',
]

## Required for force installation of APM Package
xpack.fleet.packages:
Expand Down
16 changes: 13 additions & 3 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,19 @@ telemetry.labels.serverless: security
# Fleet specific configuration
xpack.fleet.internal.registry.capabilities: ['security']
xpack.fleet.internal.registry.spec.max: '3.0'
# Disabled until packages implement the new spec https://github.com/elastic/kibana/issues/166742
# xpack.fleet.internal.registry.kibanaVersionCheckEnabled: false
# xpack.fleet.internal.registry.spec.min: '3.0'
xpack.fleet.internal.registry.kibanaVersionCheckEnabled: false
# Temporary until all packages implement new spec https://github.com/elastic/kibana/issues/166742
xpack.fleet.internal.registry.spec.min: '1.0'
xpack.fleet.internal.registry.excludePackages: [
# Oblt integrations
'apm',
'synthetics',
# Removed in 8.11 integrations
'cisco',
'microsoft',
'symantec',
'cyberark',
]

xpack.ml.ad.enabled: true
xpack.ml.dfa.enabled: true
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@
"@kbn/eslint-config": "link:packages/kbn-eslint-config",
"@kbn/eslint-plugin-disable": "link:packages/kbn-eslint-plugin-disable",
"@kbn/eslint-plugin-eslint": "link:packages/kbn-eslint-plugin-eslint",
"@kbn/eslint-plugin-i18n": "link:packages/kbn-eslint-plugin-i18n",
"@kbn/eslint-plugin-imports": "link:packages/kbn-eslint-plugin-imports",
"@kbn/eslint-plugin-telemetry": "link:packages/kbn-eslint-plugin-telemetry",
"@kbn/expect": "link:packages/kbn-expect",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,12 @@ describe('collectMultiNamespaceReferences', () => {
expect(mockFindSharedOriginObjects).toHaveBeenCalledWith(
expect.anything(),
[
{ type: obj1.type, origin: obj1.id },
{ type: obj2.type, origin: obj2.originId }, // If the found object has an `originId`, that is used instead of the object's `id`.
{ type: obj3.type, origin: obj3.id },
{ type: obj1.type, id: obj1.id },
{ type: obj2.type, id: obj2.id, origin: obj2.originId },
{ type: obj3.type, id: obj3.id },
],
ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE
ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE,
undefined
);
expect(result.objects).toEqual([
// Note: in a realistic scenario, `spacesWithMatchingOrigins` would be a superset of `spaces`. But for the purposes of this unit
Expand All @@ -441,8 +442,9 @@ describe('collectMultiNamespaceReferences', () => {
expect(mockFindSharedOriginObjects).toHaveBeenCalledTimes(1);
expect(mockFindSharedOriginObjects).toHaveBeenCalledWith(
expect.anything(),
[{ type: obj1.type, origin: obj1.id }],
ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE
[{ type: obj1.type, id: obj1.id }],
ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE,
undefined
);
});

Expand All @@ -458,6 +460,25 @@ describe('collectMultiNamespaceReferences', () => {
'Failed to retrieve shared origin objects: Oh no!'
);
});

it('passes options to findSharedOriginObjects', async () => {
const obj1 = { type: MULTI_NAMESPACE_OBJ_TYPE_1, id: 'id-1' };
const obj2 = { type: MULTI_NAMESPACE_OBJ_TYPE_1, id: 'id-2' };
const params = setup([obj1, obj2]);
mockMgetResults({ found: true }, { found: false }); // results for obj1 and obj2

await collectMultiNamespaceReferences({
...params,
options: { purpose: 'updateObjectsSpaces' },
});
expect(mockFindSharedOriginObjects).toHaveBeenCalledTimes(1);
expect(mockFindSharedOriginObjects).toHaveBeenCalledWith(
expect.anything(),
[{ type: obj1.type, id: obj1.id }],
ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE,
'updateObjectsSpaces'
);
});
});

describe('with security enabled', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ export async function collectMultiNamespaceReferences(
);
const objectOriginsToSearchFor = foundObjects.map(({ type, id, originId }) => ({
type,
origin: originId || id,
id,
origin: originId,
}));
const originsMap = await findSharedOriginObjects(
createPointInTimeFinder,
objectOriginsToSearchFor,
ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE
ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE,
options?.purpose
);
const results = objectsWithContext.map((obj) => {
const aliasesVal = aliasesMap.get(getObjectKey(obj));
Expand Down
Loading

0 comments on commit 7e9ae73

Please sign in to comment.