Skip to content

Commit

Permalink
Merge remote-tracking branch upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Jul 21, 2021
2 parents 771f6c4 + 482d3c7 commit 89e7ea1
Show file tree
Hide file tree
Showing 57 changed files with 1,293 additions and 500 deletions.
43 changes: 3 additions & 40 deletions src/core/server/status/get_summary_status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,7 @@ describe('getSummaryStatus', () => {
summary: '[s2]: Lorem ipsum',
detail: 'See the status page for more information',
meta: {
affectedServices: {
s2: {
level: ServiceStatusLevels.unavailable,
summary: 'Lorem ipsum',
meta: {
custom: { data: 'here' },
},
},
},
affectedServices: ['s2'],
},
});
});
Expand All @@ -136,17 +128,7 @@ describe('getSummaryStatus', () => {
detail: 'Vivamus pulvinar sem ac luctus ultrices.',
documentationUrl: 'http://helpmenow.com/problem1',
meta: {
affectedServices: {
s2: {
level: ServiceStatusLevels.unavailable,
summary: 'Lorem ipsum',
detail: 'Vivamus pulvinar sem ac luctus ultrices.',
documentationUrl: 'http://helpmenow.com/problem1',
meta: {
custom: { data: 'here' },
},
},
},
affectedServices: ['s2'],
},
});
});
Expand Down Expand Up @@ -183,26 +165,7 @@ describe('getSummaryStatus', () => {
summary: '[2] services are unavailable',
detail: 'See the status page for more information',
meta: {
affectedServices: {
s2: {
level: ServiceStatusLevels.unavailable,
summary: 'Lorem ipsum',
detail: 'Vivamus pulvinar sem ac luctus ultrices.',
documentationUrl: 'http://helpmenow.com/problem1',
meta: {
custom: { data: 'here' },
},
},
s3: {
level: ServiceStatusLevels.unavailable,
summary: 'Proin mattis',
detail: 'Nunc quis nulla at mi lobortis pretium.',
documentationUrl: 'http://helpmenow.com/problem2',
meta: {
other: { data: 'over there' },
},
},
},
affectedServices: ['s2', 's3'],
},
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/status/get_summary_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getSummaryStatus = (
// TODO: include URL to status page
detail: status.detail ?? `See the status page for more information`,
meta: {
affectedServices: { [serviceName]: status },
affectedServices: [serviceName],
},
};
} else {
Expand All @@ -41,7 +41,7 @@ export const getSummaryStatus = (
// TODO: include URL to status page
detail: `See the status page for more information`,
meta: {
affectedServices: Object.fromEntries(highestStatuses),
affectedServices: highestStatuses.map(([serviceName]) => serviceName),
},
};
}
Expand Down
7 changes: 1 addition & 6 deletions src/core/server/status/plugins_status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,7 @@ describe('PluginStatusService', () => {
summary: '[a]: Status check timed out after 30s',
detail: 'See the status page for more information',
meta: {
affectedServices: {
a: {
level: ServiceStatusLevels.unavailable,
summary: 'Status check timed out after 30s',
},
},
affectedServices: ['a'],
},
},
});
Expand Down
18 changes: 6 additions & 12 deletions src/core/server/status/status_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,9 @@ describe('StatusService', () => {
"detail": "See the status page for more information",
"level": degraded,
"meta": Object {
"affectedServices": Object {
"savedObjects": Object {
"level": degraded,
"summary": "This is degraded!",
},
},
"affectedServices": Array [
"savedObjects",
],
},
"summary": "[savedObjects]: This is degraded!",
},
Expand Down Expand Up @@ -307,12 +304,9 @@ describe('StatusService', () => {
"detail": "See the status page for more information",
"level": degraded,
"meta": Object {
"affectedServices": Object {
"savedObjects": Object {
"level": degraded,
"summary": "This is degraded!",
},
},
"affectedServices": Array [
"savedObjects",
],
},
"summary": "[savedObjects]: This is degraded!",
},
Expand Down
4 changes: 2 additions & 2 deletions src/core/types/elasticsearch/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ type Source = estypes.SearchSourceFilter | boolean | estypes.Fields;

type ValueTypeOfField<T> = T extends Record<string, string | number>
? ValuesType<T>
: T extends string[] | number[]
? ValueTypeOfField<ValuesType<T>>
: T extends Array<infer U>
? ValueTypeOfField<U>
: T extends { field: estypes.Field }
? T['field']
: T extends string | number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ kibana_vars=(
xpack.securitySolution.maxTimelineImportExportSize
xpack.securitySolution.maxTimelineImportPayloadBytes
xpack.securitySolution.packagerTaskInterval
xpack.securitySolution.prebuiltRulesFromFileSystem
xpack.securitySolution.prebuiltRulesFromSavedObjects
xpack.spaces.enabled
xpack.spaces.maxSpaces
xpack.task_manager.enabled
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 89e7ea1

Please sign in to comment.