Skip to content

Commit

Permalink
Merge branch 'main' into fix-deleted-saved-search-embeddable
Browse files Browse the repository at this point in the history
  • Loading branch information
davismcphee authored Oct 26, 2023
2 parents 276d190 + cc8e3e4 commit e49edf6
Show file tree
Hide file tree
Showing 140 changed files with 2,602 additions and 1,841 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ steps:
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 6
retry:
automatic:
- exit_status: '*'
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ steps:
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 60
parallelism: 8
parallelism: 10
retry:
automatic:
- exit_status: '*'
Expand All @@ -169,7 +169,7 @@ steps:
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 6
retry:
automatic:
- exit_status: '*'
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ steps:
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 60
parallelism: 8
parallelism: 10
retry:
automatic:
- exit_status: '*'
Expand All @@ -147,7 +147,7 @@ steps:
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 60
parallelism: 4
parallelism: 6
retry:
automatic:
- exit_status: '*'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ echo "--- Defend Workflows Cypress tests on Serverless"

cd x-pack/plugins/security_solution

set +e
yarn cypress:dw:serverless:run; status=$?; yarn junit:merge || :; exit $status
2 changes: 2 additions & 0 deletions docs/api/data-views/create.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ $ curl -X POST api/data_views/data_view

To create {data-sources} based on {ref}/xpack-rollup.html[rollup indices], use the `data_view.type` and `data_view.typeMeta` properties :

deprecated::[8.11.0,'Rollups are deprecated and will be removed in a future version. Use {ref}/downsampling.html[downsampling] instead.']

[source,sh]
--------------------------------------------------
$ curl -X POST api/data_views/data_view
Expand Down
2 changes: 2 additions & 0 deletions docs/concepts/data-views.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ NOTE: Temporary {data-sources} are not available in *Stack Management.*
[[rollup-data-view]]
==== Use {data-sources} with rolled up data

deprecated::[8.11.0,'Rollups are deprecated and will be removed in a future version. Use {ref}/downsampling.html[downsampling] instead.']

A {data-source} can match one rollup index. For a combination rollup
{data-source} with both raw and rolled up data, use the standard notation:

Expand Down
2 changes: 2 additions & 0 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ A custom image to use in the footer of the PDF.
[[kibana-rollups-settings]]
==== Rollup

deprecated::[8.11.0,'Rollups are deprecated and will be removed in a future version. Use {ref}/downsampling.html[downsampling] instead.']

[horizontal]
[[rollups-enableindexpatterns]]`rollups:enableIndexPatterns`::
Enables the creation of data views that capture rollup indices, which in
Expand Down
2 changes: 1 addition & 1 deletion docs/management/rollups/create_and_manage_rollups.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[data-rollups]]
== Rollup Jobs

experimental::[]
deprecated::[8.11.0,'Rollups are deprecated and will be removed in a future version. Use {ref}/downsampling.html[downsampling] instead.']

A rollup job is a periodic task that aggregates data from indices specified by
an index pattern, and then rolls it into a new index. Rollup indices are a good
Expand Down
2 changes: 2 additions & 0 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ Set this value to false to disable the Remote Clusters UI.

`xpack.rollup.ui.enabled`::
Set this value to false to disable the Rollup Jobs UI. *Default: true*
+
deprecated::[8.11.0,'Rollups are deprecated and will be removed in a future version. Use {ref}/downsampling.html[downsampling] instead.']

`xpack.snapshot_restore.ui.enabled`::
Set this value to false to disable the Snapshot and Restore UI. *Default: true*
Expand Down
2 changes: 1 addition & 1 deletion docs/user/management.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ because you can put data in different resource tiers.
have backups of your cluster in case something goes wrong.

| <<data-rollups, Rollup Jobs>>
|Create a job that periodically aggregates data from one or more indices, and then
| deprecated:[8.11.0,'Rollups are deprecated and will be removed in a future version. Use downsampling instead.'] Create a job that periodically aggregates data from one or more indices, and then
rolls it into a new, compact index. Rollup indices are a good way to store months or
years of historical data in combination with your raw data.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
import { schema, TypeOf } from '@kbn/config-schema';

export const reducerStreamRequestBodySchema = schema.object({
/** Boolean flag to enable/disabling simulation of response errors. */
/** Boolean flag to enable/disable simulation of response errors. */
simulateErrors: schema.maybe(schema.boolean()),
/** Maximum timeout between streaming messages. */
timeout: schema.maybe(schema.number()),
/** Setting to override headers derived compression */
compressResponse: schema.maybe(schema.boolean()),
/** Boolean flag to enable/disable 4KB payload flush fix. */
flushFix: schema.maybe(schema.boolean()),
});
export type ReducerStreamRequestBodySchema = TypeOf<typeof reducerStreamRequestBodySchema>;
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ export const PageReducerStream: FC = () => {

const [simulateErrors, setSimulateErrors] = useState(false);
const [compressResponse, setCompressResponse] = useState(true);
const [flushFix, setFlushFix] = useState(false);

const { dispatch, start, cancel, data, errors, isCancelled, isRunning } = useFetchStream(
http,
RESPONSE_STREAM_API_ENDPOINT.REDUCER_STREAM,
'1',
{ compressResponse, simulateErrors },
{ compressResponse, flushFix, simulateErrors },
{ reducer: reducerStreamReducer, initialState }
);

Expand Down Expand Up @@ -149,6 +150,13 @@ export const PageReducerStream: FC = () => {
onChange={(e) => setCompressResponse(!compressResponse)}
compressed
/>
<EuiCheckbox
id="responseStreamFlushFixCheckbox"
label="Toggle flushFix setting for response stream."
checked={flushFix}
onChange={(e) => setFlushFix(!flushFix)}
compressed
/>
</EuiText>
</Page>
);
Expand Down
3 changes: 2 additions & 1 deletion examples/response_stream/server/routes/reducer_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export const defineReducerStreamRoute = (router: IRouter, logger: Logger) => {
const { end, push, responseWithHeaders } = streamFactory<ReducerStreamApiAction>(
request.headers,
logger,
request.body.compressResponse
request.body.compressResponse,
request.body.flushFix
);

const entities = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('MaintenanceWindowCallout', () => {
{ wrapper: TestProviders }
);

expect(await findAllByText('Maintenance window is running')).toHaveLength(1);
expect(await findAllByText('One or more maintenance windows are running')).toHaveLength(1);
expect(fetchActiveMaintenanceWindowsMock).toHaveBeenCalledTimes(1);
});

Expand All @@ -94,7 +94,7 @@ describe('MaintenanceWindowCallout', () => {
{ wrapper: TestProviders }
);

expect(await findAllByText('Maintenance window is running')).toHaveLength(1);
expect(await findAllByText('One or more maintenance windows are running')).toHaveLength(1);
expect(fetchActiveMaintenanceWindowsMock).toHaveBeenCalledTimes(1);
});

Expand All @@ -106,7 +106,7 @@ describe('MaintenanceWindowCallout', () => {
{ wrapper: TestProviders }
);

expect(await findByText('Maintenance window is running')).toBeInTheDocument();
expect(await findByText('One or more maintenance windows are running')).toBeInTheDocument();
expect(fetchActiveMaintenanceWindowsMock).toHaveBeenCalledTimes(1);
});

Expand Down Expand Up @@ -134,6 +134,85 @@ describe('MaintenanceWindowCallout', () => {
expect(fetchActiveMaintenanceWindowsMock).toHaveBeenCalledTimes(1);
});

it('should be visible if there is a "running" maintenance window that matches the specified category', async () => {
fetchActiveMaintenanceWindowsMock.mockResolvedValue([
{
...RUNNING_MAINTENANCE_WINDOW_1,
categoryIds: ['observability'],
},
]);

const { findByText } = render(
<MaintenanceWindowCallout
kibanaServices={kibanaServicesMock}
categories={['observability']}
/>,
{ wrapper: TestProviders }
);

expect(
await findByText('A maintenance window is running for Observability rules')
).toBeInTheDocument();
});

it('should NOT be visible if there is a "running" maintenance window that does not match the specified category', async () => {
fetchActiveMaintenanceWindowsMock.mockResolvedValue([
{
...RUNNING_MAINTENANCE_WINDOW_1,
categoryIds: ['observability'],
},
]);

const { container } = render(
<MaintenanceWindowCallout
kibanaServices={kibanaServicesMock}
categories={['securitySolution']}
/>,
{ wrapper: TestProviders }
);

expect(container).toBeEmptyDOMElement();
});

it('should be visible if there is a "running" maintenance window with a category, and no categories are specified', async () => {
fetchActiveMaintenanceWindowsMock.mockResolvedValue([
{
...RUNNING_MAINTENANCE_WINDOW_1,
categoryIds: ['observability'],
},
]);

const { findByText } = render(
<MaintenanceWindowCallout kibanaServices={kibanaServicesMock} />,
{ wrapper: TestProviders }
);

expect(
await findByText('A maintenance window is running for Observability rules')
).toBeInTheDocument();
});

it('should only display the specified categories in the callout title for a maintenance window that matches muliple categories', async () => {
fetchActiveMaintenanceWindowsMock.mockResolvedValue([
{
...RUNNING_MAINTENANCE_WINDOW_1,
categoryIds: ['observability', 'securitySolution', 'management'],
},
]);

const { findByText } = render(
<MaintenanceWindowCallout
kibanaServices={kibanaServicesMock}
categories={['observability', 'management']}
/>,
{ wrapper: TestProviders }
);

expect(
await findByText('A maintenance window is running for Observability and Stack rules')
).toBeInTheDocument();
});

it('should see an error toast if there was an error while fetching maintenance windows', async () => {
const createReactQueryWrapper = () => {
const queryClient = new QueryClient({
Expand Down Expand Up @@ -169,7 +248,7 @@ describe('MaintenanceWindowCallout', () => {
expect(kibanaServicesMock.notifications.toasts.addError).toHaveBeenCalledTimes(1);
expect(kibanaServicesMock.notifications.toasts.addError).toHaveBeenCalledWith(mockError, {
title: 'Failed to check if maintenance windows are active',
toastMessage: 'Rule notifications are stopped while the maintenance window is running.',
toastMessage: 'Rule notifications are stopped while maintenance windows are running.',
});
});
});
Expand All @@ -195,7 +274,7 @@ describe('MaintenanceWindowCallout', () => {
expect(container).toBeEmptyDOMElement();
});

it('should work as expected if window maintenance privilege is READ ', async () => {
it('should work as expected if window maintenance privilege is READ', async () => {
const servicesMock = {
...kibanaServicesMock,
application: {
Expand All @@ -213,7 +292,7 @@ describe('MaintenanceWindowCallout', () => {
wrapper: TestProviders,
});

expect(await findByText('Maintenance window is running')).toBeInTheDocument();
expect(await findByText('One or more maintenance windows are running')).toBeInTheDocument();
});

it('should display the callout if the category ids contains the specified category', async () => {
Expand Down
Loading

0 comments on commit e49edf6

Please sign in to comment.