Skip to content

Commit d9c7c98

Browse files
authored
Merge branch 'main' into fix-ms-defender-runscript-slow-tests
2 parents 69f4c09 + 06a3b6e commit d9c7c98

30 files changed

Lines changed: 2313 additions & 237 deletions

File tree

docs/release-notes/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ For the Elastic Security 9.4.0 release information, refer to [Elastic Security S
299299
### Fixes [kibana-9.4.0-fixes]
300300

301301
**Alerting**:
302+
* Fixes an issue where Stack alerts sent recovery notifications but remained `active` in {{kib}} instead of transitioning to `recovered` [#261012]({{kib-pull}}261012).
302303
* Fixes stale `uiamApiKey` leaking through object spread in rule updates [#263887]({{kib-pull}}263887).
303304
* Fixes OpenAPI alerting rule params schemas missing accepted keys for burn-rate windows and Elasticsearch query `sourceFields` [#263634]({{kib-pull}}263634).
304305
* Fixes an index template update failing due to system-managed fields [#262534]({{kib-pull}}262534).
@@ -573,6 +574,7 @@ For the Elastic Security 9.3.4 release information, refer to [Elastic Security R
573574
### Fixes [kibana-9.3.4-fixes]
574575

575576
**Alerting**:
577+
* Fixes an issue where Stack alerts sent recovery notifications but remained `active` in {{kib}} instead of transitioning to `recovered` [#261012]({{kib-pull}}261012).
576578
* Adds the `application/x-zip-compressed` MIME type as an accepted value for case file attachments [#262414]({{kib-pull}}262414).
577579
* Fixes the "Failed to check if maintenance windows are active" error [#261048]({{kib-pull}}261048).
578580

docs/release-notes/known-issues.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ For Elastic {{observability}} known issues, refer to [Elastic Observability know
88

99
For Elastic Security known issues, refer to [Elastic Security known issues](docs-content://release-notes/elastic-security/known-issues.md).
1010

11+
::::{dropdown} Stack alerts remain active instead of transitioning to recovered
12+
13+
Applies to: {{stack}} 9.2.7, 9.2.8, 9.3.2, 9.3.3
14+
15+
**Details**
16+
17+
Some Stack alerts send recovery notifications (for example, Slack, email, or webhook) but remain `active` in {{kib}} instead of transitioning to `recovered`.
18+
19+
**Action**
20+
21+
Manually untrack stale alerts or upgrade to {{stack}} 9.3.4 or 9.4.0.
22+
23+
**Resolved**
24+
25+
This issue is resolved in {{stack}} 9.3.4 and 9.4.0.
26+
27+
::::
28+
29+
1130
::::{dropdown} Dashboards with controls might fail to open
1231

1332
Applies to: {{stack}} 9.4.0

packages/kbn-optimizer/limits.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pageLoadAssetSize:
4444
dataViewManagement: 6250
4545
dataViews: 66000
4646
dataVisualizer: 32727
47-
developerToolbar: 4467
47+
developerToolbar: 5000
4848
devTools: 8109
4949
discover: 30501
5050
discoverEnhanced: 5353
@@ -211,6 +211,6 @@ pageLoadAssetSize:
211211
visualizationListing: 5148
212212
visualizations: 52210
213213
watcher: 10485
214-
workflowsExtensions: 38894
214+
workflowsExtensions: 38938
215215
workflowsManagement: 35010
216216
workplaceAIApp: 6234

src/core/packages/chrome/feature-flags/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ import { isNextChrome } from '@kbn/core-chrome-feature-flags';
1414

1515
const nextChromeEnabled = isNextChrome(featureFlags);
1616
```
17+
18+
`NEXT_CHROME_SESSION_STORAGE_KEY` (`dev.core.chrome.next`) is used by the development toolbar
19+
toggle. The session override is only read after `core.chrome.next` is enabled, so it can disable
20+
Chrome Next locally during development but cannot enable Chrome Next when the rollout flag is off.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import React, { useCallback } from 'react';
11+
import { EuiBadge, EuiToolTip } from '@elastic/eui';
12+
import { css } from '@emotion/react';
13+
import type { FeatureFlagsStart } from '@kbn/core-feature-flags-browser';
14+
import { isNextChrome, toggleNextChrome } from '.';
15+
16+
const badgeStyles = css`
17+
cursor: pointer;
18+
`;
19+
20+
interface ChromeNextToggleProps {
21+
featureFlags: Pick<FeatureFlagsStart, 'getBooleanValue'>;
22+
}
23+
24+
export const ChromeNextToggle: React.FC<ChromeNextToggleProps> = ({ featureFlags }) => {
25+
const isEnabled = isNextChrome(featureFlags);
26+
27+
const onClick = useCallback(() => {
28+
toggleNextChrome(featureFlags);
29+
}, [featureFlags]);
30+
31+
return (
32+
<EuiToolTip
33+
content={`Click to ${isEnabled ? 'disable' : 'enable'} Chrome Next. Page will reload.`}
34+
>
35+
<EuiBadge
36+
color={isEnabled ? 'success' : 'danger'}
37+
css={badgeStyles}
38+
iconType="beaker"
39+
iconSide="left"
40+
onClick={onClick}
41+
onClickAriaLabel="Toggle Chrome Next"
42+
>
43+
Chrome Next: {isEnabled ? 'ON' : 'OFF'}
44+
</EuiBadge>
45+
</EuiToolTip>
46+
);
47+
};

src/core/packages/chrome/feature-flags/index.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,32 @@
1010
import type { FeatureFlagsStart } from '@kbn/core-feature-flags-browser';
1111

1212
export const NEXT_CHROME_FEATURE_FLAG_KEY = 'core.chrome.next';
13+
export const NEXT_CHROME_SESSION_STORAGE_KEY = 'dev.core.chrome.next';
1314

1415
type FeatureFlagsBooleanReader = Pick<FeatureFlagsStart, 'getBooleanValue'>;
1516

16-
export const isNextChrome = (featureFlags: FeatureFlagsBooleanReader): boolean =>
17+
const isNextChromeFeatureFlagEnabled = (featureFlags: FeatureFlagsBooleanReader): boolean =>
1718
featureFlags.getBooleanValue(NEXT_CHROME_FEATURE_FLAG_KEY, false);
19+
20+
export const isNextChrome = (featureFlags: FeatureFlagsBooleanReader): boolean => {
21+
if (!isNextChromeFeatureFlagEnabled(featureFlags)) {
22+
return false;
23+
}
24+
25+
try {
26+
const override = sessionStorage.getItem(NEXT_CHROME_SESSION_STORAGE_KEY);
27+
return override === null ? true : override === 'true';
28+
} catch {
29+
return true;
30+
}
31+
};
32+
33+
export const toggleNextChrome = (featureFlags: FeatureFlagsBooleanReader): void => {
34+
if (!isNextChromeFeatureFlagEnabled(featureFlags)) {
35+
return;
36+
}
37+
38+
const next = !isNextChrome(featureFlags);
39+
sessionStorage.setItem(NEXT_CHROME_SESSION_STORAGE_KEY, String(next));
40+
window.location.reload();
41+
};

src/platform/plugins/shared/developer_toolbar/moon.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependsOn:
2424
- '@kbn/config-schema'
2525
- '@kbn/core-chrome-browser-internal-types'
2626
- '@kbn/measure-component'
27+
- '@kbn/core-chrome-feature-flags'
2728
tags:
2829
- plugin
2930
- prod

src/platform/plugins/shared/developer_toolbar/public/plugin.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type { InternalChromeStart } from '@kbn/core-chrome-browser-internal-type
1414

1515
import { BehaviorSubject } from 'rxjs';
1616
import type { DeveloperToolbarItemProps } from '@kbn/developer-toolbar';
17+
import { NEXT_CHROME_FEATURE_FLAG_KEY } from '@kbn/core-chrome-feature-flags';
1718

1819
export type UnregisterItemFn = () => void;
1920
export interface DeveloperToolbarItemRegistry {
@@ -59,6 +60,16 @@ export class DeveloperToolbarPlugin
5960
),
6061
});
6162

63+
if (core.featureFlags.getBooleanValue(NEXT_CHROME_FEATURE_FLAG_KEY, false)) {
64+
import('@kbn/core-chrome-feature-flags/chrome_next_toggle').then(({ ChromeNextToggle }) => {
65+
this.registerItem({
66+
id: 'Chrome Next',
67+
children: <ChromeNextToggle featureFlags={core.featureFlags} />,
68+
priority: 1,
69+
});
70+
});
71+
}
72+
6273
return {
6374
registerItem: this.registerItem.bind(this),
6475
};

src/platform/plugins/shared/developer_toolbar/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"@kbn/config-schema",
1414
"@kbn/core-chrome-browser-internal-types",
1515
"@kbn/measure-component",
16+
"@kbn/core-chrome-feature-flags",
1617
]
1718
}

src/platform/plugins/shared/workflows_extensions/public/step_registry/step_registry.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ describe('PublicStepRegistry', () => {
124124
expect(registry.get(stepId)).toEqual(defaultDefinition);
125125
});
126126

127+
it('should not resolve loader until whenReady is called', async () => {
128+
const mockLoader = jest.fn().mockResolvedValue(defaultDefinition);
129+
registry.register(mockLoader);
130+
131+
expect(registry.has(stepId)).toBe(false);
132+
expect(mockLoader).not.toHaveBeenCalled();
133+
134+
await registry.whenReady();
135+
expect(registry.has(stepId)).toBe(true);
136+
expect(mockLoader).toHaveBeenCalled();
137+
});
138+
127139
it('should log an error and skip registration when resolved definition duplicates an existing step type ID', async () => {
128140
registry.register(defaultDefinition);
129141
const loader = () => Promise.resolve({ ...defaultDefinition, label: 'Other' });

0 commit comments

Comments
 (0)