Skip to content

Commit 7c51753

Browse files
committed
Merge branch 'master' into alerting/management-feature-privileges
* master: (34 commits) Adds Role Based Access-Control to the Alerting & Action plugins based on Kibana Feature Controls (elastic#67157) [Monitoring] Revert direct shipping code (elastic#72505) Use server basepath when creating reporting jobs (elastic#72722) Adding api test for transaction_groups /breakdown and /avg_duration_by_browser (elastic#72623) [Task Manager] Addresses flaky test introduced by buffered store (elastic#72815) [Observability] filter "hasData" api by processor event (elastic#72810) do not pass title as part of tsvb request (elastic#72619) [Lens] Legend config (elastic#70619) Stabilize closing toast (elastic#72097) stabilize failing test (elastic#72086) Stabilize filter bar test (elastic#72032) Unskip vislib tests (elastic#71452) [ML] Fix layout of anomaly chart tooltip for long field values (elastic#72689) fix preAuth/preRouting mocks (elastic#72663) [Security Solution] Hide KQL bar (all pages) and alerts filters (Detections) when Resolver is full screen (elastic#72788) [Uptime] Rename Whitelist to Allowlist in parse_filter_map (elastic#71584) [Security Solution] Fixes exception modal not loading content (elastic#72770) [Security Solution][Exceptions] - Require non empty entries and non empty string values in exception list items (elastic#72748) [Detections] Add validation for Threshold value field (elastic#72611) [SIEM][Detection Engine][Lists] Adds version and immutability data structures (elastic#72730) ...
2 parents fb1d793 + 4abe864 commit 7c51753

File tree

299 files changed

+12132
-3028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+12132
-3028
lines changed

.ci/Jenkinsfile_baseline_trigger

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ kibanaLibrary.load()
1616

1717
withGithubCredentials {
1818
branches.each { branch ->
19+
if (branch == '6.8') {
20+
// skip 6.8, it is tracked but we don't need snapshots for it and haven't backported
21+
// the baseline capture scripts to it.
22+
return;
23+
}
24+
1925
stage(branch) {
2026
def commits = getCommits(branch, MAXIMUM_COMMITS_TO_CHECK, MAXIMUM_COMMITS_TO_BUILD)
2127

src/core/server/http/http_server.mocks.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ function createKibanaRequestMock<P = any, Q = any, B = any>({
8989
settings: { tags: routeTags, auth: routeAuthRequired, app: kibanaRouteState },
9090
},
9191
raw: {
92-
req: { socket },
92+
req: {
93+
socket,
94+
// these are needed to avoid an error when consuming KibanaRequest.events
95+
on: jest.fn(),
96+
off: jest.fn(),
97+
},
9398
},
9499
}),
95100
{

src/core/server/http/http_service.mock.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { OnPreRoutingToolkit } from './lifecycle/on_pre_routing';
3333
import { AuthToolkit } from './lifecycle/auth';
3434
import { sessionStorageMock } from './cookie_session_storage.mocks';
3535
import { OnPostAuthToolkit } from './lifecycle/on_post_auth';
36+
import { OnPreAuthToolkit } from './lifecycle/on_pre_auth';
3637
import { OnPreResponseToolkit } from './lifecycle/on_pre_response';
3738

3839
type BasePathMocked = jest.Mocked<InternalHttpServiceSetup['basePath']>;
@@ -175,15 +176,19 @@ const createHttpServiceMock = () => {
175176
return mocked;
176177
};
177178

178-
const createOnPreAuthToolkitMock = (): jest.Mocked<OnPreRoutingToolkit> => ({
179+
const createOnPreAuthToolkitMock = (): jest.Mocked<OnPreAuthToolkit> => ({
179180
next: jest.fn(),
180-
rewriteUrl: jest.fn(),
181181
});
182182

183183
const createOnPostAuthToolkitMock = (): jest.Mocked<OnPostAuthToolkit> => ({
184184
next: jest.fn(),
185185
});
186186

187+
const createOnPreRoutingToolkitMock = (): jest.Mocked<OnPreRoutingToolkit> => ({
188+
next: jest.fn(),
189+
rewriteUrl: jest.fn(),
190+
});
191+
187192
const createAuthToolkitMock = (): jest.Mocked<AuthToolkit> => ({
188193
authenticated: jest.fn(),
189194
notHandled: jest.fn(),
@@ -205,6 +210,7 @@ export const httpServiceMock = {
205210
createOnPreAuthToolkit: createOnPreAuthToolkitMock,
206211
createOnPostAuthToolkit: createOnPostAuthToolkitMock,
207212
createOnPreResponseToolkit: createOnPreResponseToolkitMock,
213+
createOnPreRoutingToolkit: createOnPreRoutingToolkitMock,
208214
createAuthToolkit: createAuthToolkitMock,
209215
createRouter: mockRouter.create,
210216
};

src/plugins/data/public/search/search_source/normalize_sort_request.test.ts

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,31 @@ import { IIndexPattern } from '../..';
2323

2424
describe('SearchSource#normalizeSortRequest', function () {
2525
const scriptedField = {
26-
name: 'script string',
26+
name: 'script number',
2727
type: 'number',
2828
scripted: true,
2929
sortable: true,
3030
script: 'foo',
3131
lang: 'painless',
3232
};
33+
const stringScriptedField = {
34+
...scriptedField,
35+
name: 'script string',
36+
type: 'string',
37+
};
38+
const booleanScriptedField = {
39+
...scriptedField,
40+
name: 'script boolean',
41+
type: 'boolean',
42+
};
3343
const murmurScriptedField = {
3444
...scriptedField,
3545
sortable: false,
3646
name: 'murmur script',
3747
type: 'murmur3',
3848
};
3949
const indexPattern = {
40-
fields: [scriptedField, murmurScriptedField],
50+
fields: [scriptedField, stringScriptedField, booleanScriptedField, murmurScriptedField],
4151
} as IIndexPattern;
4252

4353
it('should return an array', function () {
@@ -106,6 +116,54 @@ describe('SearchSource#normalizeSortRequest', function () {
106116
]);
107117
});
108118

119+
it('should use script based sorting with string type', function () {
120+
const result = normalizeSortRequest(
121+
[
122+
{
123+
[stringScriptedField.name]: SortDirection.asc,
124+
},
125+
],
126+
indexPattern
127+
);
128+
129+
expect(result).toEqual([
130+
{
131+
_script: {
132+
script: {
133+
source: stringScriptedField.script,
134+
lang: stringScriptedField.lang,
135+
},
136+
type: 'string',
137+
order: SortDirection.asc,
138+
},
139+
},
140+
]);
141+
});
142+
143+
it('should use script based sorting with boolean type as string type', function () {
144+
const result = normalizeSortRequest(
145+
[
146+
{
147+
[booleanScriptedField.name]: SortDirection.asc,
148+
},
149+
],
150+
indexPattern
151+
);
152+
153+
expect(result).toEqual([
154+
{
155+
_script: {
156+
script: {
157+
source: booleanScriptedField.script,
158+
lang: booleanScriptedField.lang,
159+
},
160+
type: 'string',
161+
order: SortDirection.asc,
162+
},
163+
},
164+
]);
165+
});
166+
109167
it('should use script based sorting only on sortable types', function () {
110168
const result = normalizeSortRequest(
111169
[

src/plugins/data/public/search/search_source/normalize_sort_request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function normalize(
6969

7070
// The ES API only supports sort scripts of type 'number' and 'string'
7171
function castSortType(type: string) {
72-
if (['number', 'string'].includes(type)) {
72+
if (['number'].includes(type)) {
7373
return 'number';
7474
} else if (['string', 'boolean'].includes(type)) {
7575
return 'string';

src/plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axis_options.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/vis_type_vislib/public/components/options/metrics_axes/value_axis_options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ function ValueAxisOptions({
187187

188188
<LabelOptions
189189
axisLabels={axis.labels}
190-
axisFilterCheckboxName={`yAxisFilterLabelsCheckbox${axis.id}`}
190+
axisFilterCheckboxName={`yAxisFilterLabelsCheckbox-${axis.id}`}
191191
setAxisLabel={setAxisLabel}
192192
/>
193193
</>

src/plugins/visualizations/public/legacy/build_pipeline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export const buildPipelineVisFunction: BuildPipelineVisFunction = {
255255
input_control_vis: (params) => {
256256
return `input_control_vis ${prepareJson('visConfig', params)}`;
257257
},
258-
metrics: (params, schemas, uiState = {}) => {
258+
metrics: ({ title, ...params }, schemas, uiState = {}) => {
259259
const paramsJson = prepareJson('params', params);
260260
const uiStateJson = prepareJson('uiState', uiState);
261261

test/functional/apps/dashboard/dashboard_filter_bar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export default function ({ getService, getPageObjects }) {
3030
const browser = getService('browser');
3131
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'visualize', 'timePicker']);
3232

33-
// FLAKY: https://github.com/elastic/kibana/issues/71987
34-
describe.skip('dashboard filter bar', () => {
33+
describe('dashboard filter bar', () => {
3534
before(async () => {
3635
await esArchiver.load('dashboard/current/kibana');
3736
await kibanaServer.uiSettings.replace({
@@ -69,6 +68,7 @@ export default function ({ getService, getPageObjects }) {
6968
it('uses default index pattern on an empty dashboard', async () => {
7069
await testSubjects.click('addFilter');
7170
await dashboardExpect.fieldSuggestions(['bytes']);
71+
await filterBar.ensureFieldEditorModalIsClosed();
7272
});
7373

7474
it('shows index pattern of vis when one is added', async () => {
@@ -77,6 +77,7 @@ export default function ({ getService, getPageObjects }) {
7777
await filterBar.ensureFieldEditorModalIsClosed();
7878
await testSubjects.click('addFilter');
7979
await dashboardExpect.fieldSuggestions(['animal']);
80+
await filterBar.ensureFieldEditorModalIsClosed();
8081
});
8182

8283
it('works when a vis with no index pattern is added', async () => {

test/functional/apps/dashboard/dashboard_snapshots.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) {
2828
const dashboardPanelActions = getService('dashboardPanelActions');
2929
const dashboardAddPanel = getService('dashboardAddPanel');
3030

31-
// FLAKY: https://github.com/elastic/kibana/issues/52854
32-
describe.skip('dashboard snapshots', function describeIndexTests() {
31+
describe('dashboard snapshots', function describeIndexTests() {
3332
before(async function () {
3433
await esArchiver.load('dashboard/current/kibana');
3534
await kibanaServer.uiSettings.replace({

0 commit comments

Comments
 (0)