Skip to content

Commit

Permalink
Merge branch 'main' into app-service/improve-error-message
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Aug 23, 2024
2 parents 24b4de4 + 5d0acf7 commit 00595e4
Show file tree
Hide file tree
Showing 110 changed files with 1,489 additions and 3,766 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ packages/kbn-search-errors @elastic/kibana-data-discovery
examples/search_examples @elastic/kibana-data-discovery
x-pack/plugins/search_homepage @elastic/search-kibana
packages/kbn-search-index-documents @elastic/search-kibana
x-pack/plugins/search_indices @elastic/search-kibana
x-pack/plugins/search_inference_endpoints @elastic/search-kibana
x-pack/plugins/search_notebooks @elastic/search-kibana
x-pack/plugins/search_playground @elastic/search-kibana
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,10 @@ It uses Chromium and Puppeteer underneath to run the browser in headless mode.
|The Search Homepage is a shared homepage for elasticsearch users.
|{kib-repo}blob/{branch}/x-pack/plugins/search_indices/README.mdx[searchIndices]
|The Search Indices plugin is a shared set of pages for elasticsearch users across stack and serverless search solutions.
|{kib-repo}blob/{branch}/x-pack/plugins/search_inference_endpoints/README.md[searchInferenceEndpoints]
|The Inference Endpoints is a tool used to manage inference endpoints
Expand Down
2 changes: 1 addition & 1 deletion fleet_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
{
"name": "endpoint",
"version": "8.15.0"
"version": "8.15.1"
},
{
"name": "fleet_server",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@
"@kbn/search-examples-plugin": "link:examples/search_examples",
"@kbn/search-homepage": "link:x-pack/plugins/search_homepage",
"@kbn/search-index-documents": "link:packages/kbn-search-index-documents",
"@kbn/search-indices": "link:x-pack/plugins/search_indices",
"@kbn/search-inference-endpoints": "link:x-pack/plugins/search_inference_endpoints",
"@kbn/search-notebooks": "link:x-pack/plugins/search_notebooks",
"@kbn/search-playground": "link:x-pack/plugins/search_playground",
Expand Down Expand Up @@ -1625,7 +1626,6 @@
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
"@yarnpkg/lockfile": "^1.1.0",
"aggregate-error": "^3.1.0",
"apidoc-markdown": "^7.3.2",
"argsplit": "^1.0.5",
"autoprefixer": "^10.4.7",
"axe-core": "^4.10.0",
Expand Down
7 changes: 5 additions & 2 deletions packages/core/apps/core-apps-server-internal/src/core_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import type {
import type { InternalStaticAssets } from '@kbn/core-http-server-internal';
import {
combineLatest,
concatMap,
firstValueFrom,
map,
type Observable,
ReplaySubject,
shareReplay,
Subject,
switchMap,
takeUntil,
timer,
} from 'rxjs';
Expand Down Expand Up @@ -238,7 +238,7 @@ export class CoreAppsService {
// Poll for updates
combineLatest([savedObjectsClient$, timer(0, 10_000)])
.pipe(
concatMap(async ([soClient]) => {
switchMap(async ([soClient]) => {
try {
const persistedOverrides = await soClient.get<Record<string, unknown>>(
DYNAMIC_CONFIG_OVERRIDES_SO_TYPE,
Expand Down Expand Up @@ -300,7 +300,10 @@ export class CoreAppsService {
await soClient.create(DYNAMIC_CONFIG_OVERRIDES_SO_TYPE, newGlobalOverrides, {
id: DYNAMIC_CONFIG_OVERRIDES_SO_ID,
overwrite: true,
refresh: false,
});
// set it again in memory in case the timer polling the SO for updates has overridden it during this update.
this.configService.setDynamicConfigOverrides(req.body);
} catch (err) {
if (err instanceof ValidationError) {
return res.badRequest({ body: err });
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ pageLoadAssetSize:
searchAssistant: 19831
searchConnectors: 30000
searchHomepage: 19831
searchIndices: 20519
searchInferenceEndpoints: 20470
searchNotebooks: 18942
searchPlayground: 19325
Expand Down
9 changes: 0 additions & 9 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,6 @@
"minimumReleaseAge": "7 days",
"enabled": true
},
{
"groupName": "machine learning modules",
"matchDepNames": ["apidoc-markdown"],
"reviewers": ["team:ml-ui"],
"matchBaseBranches": ["main"],
"labels": ["Team:ML", "release_note:skip", "backport:all-open"],
"minimumReleaseAge": "7 days",
"enabled": true
},
{
"groupName": "Kibana ES|QL Team",
"matchDepNames": ["recast"],
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/home/server/tutorials/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ import { redisenterpriseMetricsSpecProvider } from './redisenterprise_metrics';
import { santaLogsSpecProvider } from './santa_logs';
import { sonicwallLogsSpecProvider } from './sonicwall_logs';
import { sophosLogsSpecProvider } from './sophos_logs';
import { squidLogsSpecProvider } from './squid_logs';
import { stanMetricsSpecProvider } from './stan_metrics';
import { statsdMetricsSpecProvider } from './statsd_metrics';
import { suricataLogsSpecProvider } from './suricata_logs';
Expand Down Expand Up @@ -223,7 +222,6 @@ export const builtInTutorials = [
santaLogsSpecProvider,
sonicwallLogsSpecProvider,
sophosLogsSpecProvider,
squidLogsSpecProvider,
tomcatLogsSpecProvider,
zscalerLogsSpecProvider,
];
61 changes: 0 additions & 61 deletions src/plugins/home/server/tutorials/squid_logs/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ({ getService }: FtrProviderContext) {

expect(resp.body).to.be.an('array');

expect(resp.body.length).to.be(109); // the beats
expect(resp.body.length).to.be(108); // the beats
});
});
});
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,8 @@
"@kbn/search-homepage/*": ["x-pack/plugins/search_homepage/*"],
"@kbn/search-index-documents": ["packages/kbn-search-index-documents"],
"@kbn/search-index-documents/*": ["packages/kbn-search-index-documents/*"],
"@kbn/search-indices": ["x-pack/plugins/search_indices"],
"@kbn/search-indices/*": ["x-pack/plugins/search_indices/*"],
"@kbn/search-inference-endpoints": ["x-pack/plugins/search_inference_endpoints"],
"@kbn/search-inference-endpoints/*": ["x-pack/plugins/search_inference_endpoints/*"],
"@kbn/search-notebooks": ["x-pack/plugins/search_notebooks"],
Expand Down
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"xpack.runtimeFields": "plugins/runtime_fields",
"xpack.screenshotting": "plugins/screenshotting",
"xpack.searchHomepage": "plugins/search_homepage",
"xpack.searchIndices": "plugins/search_indices",
"xpack.searchNotebooks": "plugins/search_notebooks",
"xpack.searchPlayground": "plugins/search_playground",
"xpack.searchInferenceEndpoints": "plugins/search_inference_endpoints",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> =
validation,
disabled = false,
}) => {
const useSpaceAwareness = ExperimentalFeaturesService.get()?.useSpaceAwareness ?? false;
const { docLinks } = useStartServices();
const { spaceId } = useFleetStatus();
const { spaceId, isSpaceAwarenessEnabled } = useFleetStatus();

const { getAbsolutePath } = useLink();
const AgentTamperProtectionWrapper = useUIExtension(
Expand Down Expand Up @@ -263,21 +262,21 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> =
/>
</EuiFormRow>
</EuiDescribedFormGroup>
{useSpaceAwareness ? (
{isSpaceAwarenessEnabled ? (
<EuiDescribedFormGroup
fullWidth
title={
<h3>
<FormattedMessage
id="xpack.fleet.agentPolicyForm.spaceFieldLabel"
defaultMessage="Space"
defaultMessage="Spaces"
/>
</h3>
}
description={
<FormattedMessage
id="xpack.fleet.agentPolicyForm.spaceDescription"
defaultMessage="Select a space for this policy or create a new one. {link}"
defaultMessage="Select one or more spaces for this policy or create a new one. {link}"
values={{
link: (
<EuiLink
Expand Down Expand Up @@ -312,6 +311,9 @@ export const AgentPolicyAdvancedOptionsContent: React.FunctionComponent<Props> =
: [spaceId || 'default']
}
onChange={(newValue) => {
if (newValue.length === 0) {
return;
}
updateAgentPolicy({
space_ids: newValue,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const PostInstallCloudFormationModal: React.FunctionComponent<{
);

const { agentPolicyWithPackagePolicies } = useAgentPolicyWithPackagePolicies(agentPolicy.id);
const { fleetServerHost } = useFleetServerHostsForPolicy(agentPolicyWithPackagePolicies);
const { fleetServerHost, isLoadingInitialRequest } = useFleetServerHostsForPolicy(
agentPolicyWithPackagePolicies
);

const cloudFormationProps = getCloudFormationPropsFromPackagePolicy(packagePolicy);

Expand All @@ -67,7 +69,7 @@ export const PostInstallCloudFormationModal: React.FunctionComponent<{

<EuiModalBody>
<CloudFormationGuide awsAccountType={cloudFormationProps.awsAccountType} />
{error && isError && (
{error && isError && !isLoadingInitialRequest && (
<>
<EuiSpacer size="m" />
<EuiCallOut title={error} color="danger" iconType="error" />
Expand Down
6 changes: 1 addition & 5 deletions x-pack/plugins/fleet/server/types/models/agent_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ function isInteger(n: number) {

export const AgentPolicyBaseSchema = {
id: schema.maybe(schema.string()),
space_ids: schema.maybe(
schema.arrayOf(schema.string(), {
minSize: 1,
})
),
space_ids: schema.maybe(schema.arrayOf(schema.string())),
name: schema.string({ minLength: 1, validate: validateNonEmptyString }),
namespace: AgentPolicyNamespaceSchema,
description: schema.maybe(schema.string()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const ecsMappingExpectedResults = {
mapping: {
mysql_enterprise: {
Expand Down Expand Up @@ -441,18 +442,21 @@ export const ecsTestState = {
ecs: 'teststring',
exAnswer: 'testanswer',
finalized: false,
chunkSize: 30,
currentPipeline: { test: 'testpipeline' },
duplicateFields: [],
missingKeys: [],
invalidEcsFields: [],
finalMapping: { test: 'testmapping' },
sampleChunks: [''],
results: { test: 'testresults' },
samplesFormat: 'testsamplesFormat',
ecsVersion: 'testversion',
currentMapping: { test1: 'test1' },
lastExecutedChain: 'testchain',
rawSamples: ['{"test1": "test1"}'],
samples: ['{ "test1": "test1" }'],
prefixedSamples: ['{ "test1": "test1" }'],
packageName: 'testpackage',
dataStreamName: 'testDataStream',
formattedSamples: '{"test1": "test1"}',
combinedSamples: '{"test1": "test1"}',
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
ActionsClientSimpleChatModel,
} from '@kbn/langchain/server/language_models';
import type { CategorizationState } from '../../types';
import { modifySamples, formatSamples } from '../../util/samples';
import { prefixSamples, formatSamples } from '../../util/samples';
import { handleCategorization } from './categorization';
import { handleValidatePipeline } from '../../util/graph';
import { handleCategorizationValidation } from './validate';
Expand Down Expand Up @@ -106,7 +106,7 @@ const graphState: StateGraphArgs<CategorizationState>['channels'] = {
};

function modelInput(state: CategorizationState): Partial<CategorizationState> {
const samples = modifySamples(state);
const samples = prefixSamples(state);
const formattedSamples = formatSamples(samples);
const initialPipeline = JSON.parse(JSON.stringify(state.currentPipeline));
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 { mergeAndChunkSamples } from './chunk';

describe('test chunks', () => {
it('mergeAndChunkSamples()', async () => {
const objects = ['{"a": 1, "b": 2, "c": {"d": 3}}', '{"a": 2, "b": 3, "e": 4}'];
const chunkSize = 2;
const result = mergeAndChunkSamples(objects, chunkSize);
expect(result).toEqual(['{"a":1,"b":2}', '{"c":{"d":3},"e":4}']);
});
});
Loading

0 comments on commit 00595e4

Please sign in to comment.