Skip to content

Commit

Permalink
Merge branch 'main' into reporting/error-log-queue-retry
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Mar 7, 2022
2 parents cfb0778 + c9e66b8 commit 38861ce
Show file tree
Hide file tree
Showing 162 changed files with 9,447 additions and 743 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/uptime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ echo "--- Uptime @elastic/synthetics Tests"
cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION"
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ x-pack/plugins/security_solution/cypress/upgrade_integration @elastic/security-e
x-pack/plugins/security_solution/cypress/README.md @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress @elastic/security-engineering-productivity

## Security Solution sub teams - adaptive-workload-protection
x-pack/plugins/session_view @elastic/awp-platform

# Security Intelligence And Analytics
/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/add-to-imui-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Add to Infra Monitoring UI project
on:
issues:
types:
- labeled
jobs:
add_to_project:
runs-on: ubuntu-latest
if: |
contains(github.event.issue.labels.*.name, 'Team:Infra Monitoring UI') ||
contains(github.event.issue.labels.*.name, 'Feature:Stack Monitoring') ||
contains(github.event.issue.labels.*.name, 'Feature:Logs UI') ||
contains(github.event.issue.labels.*.name, 'Feature:Metrics UI')
steps:
- uses: octokit/graphql-action@v2.x
id: add_to_project
with:
headers: '{"GraphQL-Features": "projects_next_graphql"}'
query: |
mutation add_to_project($projectid:ID!,$contentid:ID!) {
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
projectNextItem {
id
}
}
}
projectid: ${{ env.PROJECT_ID }}
contentid: ${{ github.event.issue.node_id }}
env:
PROJECT_ID: "PN_kwDOAGc3Zs1EEA"
GITHUB_TOKEN: ${{ secrets.PROJECT_ASSIGNER_TOKEN }}
4 changes: 1 addition & 3 deletions .github/workflows/project-assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
{"label": "Feature:Canvas", "projectNumber": 38, "columnName": "Inbox"},
{"label": "Feature:Dashboard", "projectNumber": 68, "columnName": "Inbox"},
{"label": "Feature:Drilldowns", "projectNumber": 68, "columnName": "Inbox"},
{"label": "Feature:Input Controls", "projectNumber": 72, "columnName": "Inbox"},
{"label": "Team:Security", "projectNumber": 320, "columnName": "Awaiting triage", "projectScope": "org"},
{"label": "Team:Operations", "projectNumber": 314, "columnName": "Triage", "projectScope": "org"}
{"label": "Feature:Input Controls", "projectNumber": 72, "columnName": "Inbox"}
]
ghToken: ${{ secrets.PROJECT_ASSIGNER_TOKEN }}
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ Kibana.
|Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing.
|{kib-repo}blob/{branch}/x-pack/plugins/session_view/README.md[sessionView]
|Session View is meant to provide a visualization into what is going on in a particular Linux environment where the agent is running. It looks likes a terminal emulator; however, it is a tool for introspecting process activity and understanding user and service behaviour in your Linux servers and infrastructure. It is a time-ordered series of process executions displayed in a tree over time.
|{kib-repo}blob/{branch}/x-pack/plugins/snapshot_restore/README.md[snapshotRestore]
|or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Update multiple documents at once
<b>Signature:</b>

```typescript
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<unknown>>;
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<T>>;
```

## Parameters
Expand All @@ -20,7 +20,7 @@ bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<Saved

<b>Returns:</b>

Promise&lt;SavedObjectsBatchResponse&lt;unknown&gt;&gt;
Promise&lt;SavedObjectsBatchResponse&lt;T&gt;&gt;

The result of the update operation containing both failed and updated saved objects.

23 changes: 1 addition & 22 deletions fleet_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,4 @@
in order to verify package integrity.
*/

[
{
"name": "apm",
"version": "8.1.0"
},
{
"name": "elastic_agent",
"version": "1.3.0"
},
{
"name": "endpoint",
"version": "1.5.0"
},
{
"name": "fleet_server",
"version": "1.1.0"
},
{
"name": "synthetics",
"version": "0.9.2"
}
]
[]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
"react-moment-proptypes": "^1.7.0",
"react-monaco-editor": "^0.41.2",
"react-popper-tooltip": "^2.10.1",
"react-query": "^3.34.0",
"react-query": "^3.34.7",
"react-redux": "^7.2.0",
"react-resizable": "^1.7.5",
"react-resize-detector": "^4.2.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@ pageLoadAssetSize:
expressionPartitionVis: 26338
sharedUX: 16225
ux: 20784
visTypeGauge: 24113
sessionView: 77750
cloudSecurityPosture: 19109
visTypeGauge: 24113
2 changes: 1 addition & 1 deletion src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ export class SavedObjectsClient {
}>) => Promise<{
resolved_objects: ResolvedSimpleSavedObject<T>[];
}>;
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<unknown>>;
bulkUpdate<T = unknown>(objects?: SavedObjectsBulkUpdateObject[]): Promise<SavedObjectsBatchResponse<T>>;
create: <T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise<SimpleSavedObject<T>>;
// Warning: (ae-forgotten-export) The symbol "SavedObjectsDeleteOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "SavedObjectsClientContract" needs to be exported by the entry point index.d.ts
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/saved_objects/saved_objects_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export class SavedObjectsClient {
return renameKeys<
PromiseType<ReturnType<SavedObjectsApi['bulkUpdate']>>,
SavedObjectsBatchResponse
>({ saved_objects: 'savedObjects' }, resp) as SavedObjectsBatchResponse;
>({ saved_objects: 'savedObjects' }, resp) as SavedObjectsBatchResponse<T>;
});
}

Expand Down
14 changes: 5 additions & 9 deletions src/core/server/ui_settings/settings/date_formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getDateFormatSettings = (): Record<string, UiSettingsParams> => {
}),
value: 'MMM D, YYYY @ HH:mm:ss.SSS',
description: i18n.translate('core.ui_settings.params.dateFormatText', {
defaultMessage: 'When displaying a pretty formatted date, use this {formatLink}',
defaultMessage: 'The {formatLink} for pretty formatted dates.',
description:
'Part of composite text: core.ui_settings.params.dateFormatText + ' +
'core.ui_settings.params.dateFormat.optionsLinkText',
Expand All @@ -48,15 +48,11 @@ export const getDateFormatSettings = (): Record<string, UiSettingsParams> => {
},
'dateFormat:tz': {
name: i18n.translate('core.ui_settings.params.dateFormat.timezoneTitle', {
defaultMessage: 'Timezone for date formatting',
defaultMessage: 'Time zone',
}),
value: 'Browser',
description: i18n.translate('core.ui_settings.params.dateFormat.timezoneText', {
defaultMessage:
'Which timezone should be used. {defaultOption} will use the timezone detected by your browser.',
values: {
defaultOption: '"Browser"',
},
defaultMessage: 'The default time zone.',
}),
type: 'select',
options: timezones,
Expand Down Expand Up @@ -115,7 +111,7 @@ export const getDateFormatSettings = (): Record<string, UiSettingsParams> => {
}),
value: defaultWeekday,
description: i18n.translate('core.ui_settings.params.dateFormat.dayOfWeekText', {
defaultMessage: 'What day should weeks start on?',
defaultMessage: 'The day that starts the week.',
}),
type: 'select',
options: weekdays,
Expand All @@ -141,7 +137,7 @@ export const getDateFormatSettings = (): Record<string, UiSettingsParams> => {
}),
value: 'MMM D, YYYY @ HH:mm:ss.SSSSSSSSS',
description: i18n.translate('core.ui_settings.params.dateNanosFormatText', {
defaultMessage: 'Used for the {dateNanosLink} datatype of Elasticsearch',
defaultMessage: 'The format for {dateNanosLink} data.',
values: {
dateNanosLink:
'<a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/date_nanos.html" target="_blank" rel="noopener noreferrer">' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function DevToolsSettingsModal(props: Props) {
const [fields, setFields] = useState(props.settings.autocomplete.fields);
const [indices, setIndices] = useState(props.settings.autocomplete.indices);
const [templates, setTemplates] = useState(props.settings.autocomplete.templates);
const [dataStreams, setDataStreams] = useState(props.settings.autocomplete.dataStreams);
const [polling, setPolling] = useState(props.settings.polling);
const [pollInterval, setPollInterval] = useState(props.settings.pollInterval);
const [tripleQuotes, setTripleQuotes] = useState(props.settings.tripleQuotes);
Expand Down Expand Up @@ -97,12 +98,20 @@ export function DevToolsSettingsModal(props: Props) {
}),
stateSetter: setTemplates,
},
{
id: 'dataStreams',
label: i18n.translate('console.settingsPage.dataStreamsLabelText', {
defaultMessage: 'Data streams',
}),
stateSetter: setDataStreams,
},
];

const checkboxIdToSelectedMap = {
fields,
indices,
templates,
dataStreams,
};

const onAutocompleteChange = (optionId: AutocompleteOptions) => {
Expand All @@ -120,6 +129,7 @@ export function DevToolsSettingsModal(props: Props) {
fields,
indices,
templates,
dataStreams,
},
polling,
pollInterval,
Expand Down Expand Up @@ -170,6 +180,7 @@ export function DevToolsSettingsModal(props: Props) {
fields,
indices,
templates,
dataStreams,
});
}}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { getDataStreams } from '../../mappings/mappings';
import { ListComponent } from './list_component';

export class DataStreamAutocompleteComponent extends ListComponent {
constructor(name, parent, multiValued) {
super(name, getDataStreams, parent, multiValued);
}

getContextKey() {
return 'data_stream';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ export { IdAutocompleteComponent } from './id_autocomplete_component';
export { UsernameAutocompleteComponent } from './username_autocomplete_component';
export { IndexTemplateAutocompleteComponent } from './index_template_autocomplete_component';
export { ComponentTemplateAutocompleteComponent } from './component_template_autocomplete_component';
export { DataStreamAutocompleteComponent } from './data_stream_autocomplete_component';
export * from './legacy';
4 changes: 4 additions & 0 deletions src/plugins/console/public/lib/kb/kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
UsernameAutocompleteComponent,
IndexTemplateAutocompleteComponent,
ComponentTemplateAutocompleteComponent,
DataStreamAutocompleteComponent,
} from '../autocomplete/components';

import $ from 'jquery';
Expand Down Expand Up @@ -94,6 +95,9 @@ const parametrizedComponentFactories = {
component_template: function (name, parent) {
return new ComponentTemplateAutocompleteComponent(name, parent);
},
data_stream: function (name, parent) {
return new DataStreamAutocompleteComponent(name, parent);
},
};

export function getUnmatchedEndpointComponents() {
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/console/public/lib/mappings/mapping.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,13 @@ describe('Mappings', () => {
expect(mappings.getIndexTemplates()).toEqual(expectedResult);
expect(mappings.getComponentTemplates()).toEqual(expectedResult);
});

test('Data streams', function () {
mappings.loadDataStreams({
data_streams: [{ name: 'test_index1' }, { name: 'test_index2' }, { name: 'test_index3' }],
});

const expectedResult = ['test_index1', 'test_index2', 'test_index3'];
expect(mappings.getDataStreams()).toEqual(expectedResult);
});
});
24 changes: 21 additions & 3 deletions src/plugins/console/public/lib/mappings/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ let perAliasIndexes = [];
let legacyTemplates = [];
let indexTemplates = [];
let componentTemplates = [];
let dataStreams = [];

const mappingObj = {};

Expand Down Expand Up @@ -60,6 +61,10 @@ export function getComponentTemplates() {
return [...componentTemplates];
}

export function getDataStreams() {
return [...dataStreams];
}

export function getFields(indices, types) {
// get fields for indices and types. Both can be a list, a string or null (meaning all).
let ret = [];
Expand Down Expand Up @@ -128,7 +133,9 @@ export function getTypes(indices) {
export function getIndices(includeAliases) {
const ret = [];
$.each(perIndexTypes, function (index) {
ret.push(index);
if (!index.startsWith('.ds')) {
ret.push(index);
}
});
if (typeof includeAliases === 'undefined' ? true : includeAliases) {
$.each(perAliasIndexes, function (alias) {
Expand Down Expand Up @@ -204,6 +211,10 @@ export function loadComponentTemplates(data) {
componentTemplates = (data.component_templates ?? []).map(({ name }) => name);
}

export function loadDataStreams(data) {
dataStreams = (data.data_streams ?? []).map(({ name }) => name);
}

export function loadMappings(mappings) {
perIndexTypes = {};

Expand Down Expand Up @@ -265,6 +276,7 @@ function retrieveSettings(settingsKey, settingsToRetrieve) {
legacyTemplates: '_template',
indexTemplates: '_index_template',
componentTemplates: '_component_template',
dataStreams: '_data_stream',
};

// Fetch autocomplete info if setting is set to true, and if user has made changes.
Expand Down Expand Up @@ -326,14 +338,16 @@ export function retrieveAutoCompleteInfo(settings, settingsToRetrieve) {
'componentTemplates',
templatesSettingToRetrieve
);
const dataStreamsPromise = retrieveSettings('dataStreams', settingsToRetrieve);

$.when(
mappingPromise,
aliasesPromise,
legacyTemplatesPromise,
indexTemplatesPromise,
componentTemplatesPromise
).done((mappings, aliases, legacyTemplates, indexTemplates, componentTemplates) => {
componentTemplatesPromise,
dataStreamsPromise
).done((mappings, aliases, legacyTemplates, indexTemplates, componentTemplates, dataStreams) => {
let mappingsResponse;
try {
if (mappings && mappings.length) {
Expand Down Expand Up @@ -365,6 +379,10 @@ export function retrieveAutoCompleteInfo(settings, settingsToRetrieve) {
loadComponentTemplates(JSON.parse(componentTemplates[0]));
}

if (dataStreams) {
loadDataStreams(JSON.parse(dataStreams[0]));
}

if (mappings && aliases) {
// Trigger an update event with the mappings, aliases
$(mappingObj).trigger('update', [mappingsResponse, aliases[0]]);
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/console/public/services/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const DEFAULT_SETTINGS = Object.freeze({
pollInterval: 60000,
tripleQuotes: true,
wrapMode: true,
autocomplete: Object.freeze({ fields: true, indices: true, templates: true }),
autocomplete: Object.freeze({ fields: true, indices: true, templates: true, dataStreams: true }),
historyDisabled: false,
});

Expand All @@ -25,6 +25,7 @@ export interface DevToolsSettings {
fields: boolean;
indices: boolean;
templates: boolean;
dataStreams: boolean;
};
polling: boolean;
pollInterval: number;
Expand Down
Loading

0 comments on commit 38861ce

Please sign in to comment.