Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.14] Remove recursive plugin status in meta field (#106286) #106390

Merged
merged 1 commit into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -252,12 +252,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 @@ -305,12 +302,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