Skip to content

Add support for handling failing checks without error patterns in account summary #85

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

Merged
merged 1 commit into from
Mar 24, 2025
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
13 changes: 13 additions & 0 deletions src/slackbot/blocks/accountSummaryBlock.script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ async function main() {
},
],
}),
// Failing checks without error patterns
createAccountSummaryBlock({
accountName: "FailingNoErrors",
passingChecks: 42,
degradedChecks: 3,
failingChecks: 5,
hasIssues: true,
issuesSummary:
"New degrading or failing checks detected in the last 24h.",
failingChecksGoals: "Some checks have failed in the last 24h.",
failingCheckIds: ["126", "127", "128", "129", "130"],
errorPatterns: [],
}),
// Some failing
createAccountSummaryBlock({
accountName: "Failing",
Expand Down
50 changes: 29 additions & 21 deletions src/slackbot/blocks/accountSummaryBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,31 +123,39 @@ export function createAccountSummaryBlock({
text: `:white_check_mark: *PASSING*: ${passingChecks} :warning: *DEGRADED*: ${degradedChecks} :x: *FAILING*: ${failingChecks}`,
},
},
...(failingCheckIds.length > 0
...(failingCheckIds.length > 0 || errorPatterns.length > 0
? [
{
type: "actions",
elements: [
{
type: "button",
text: {
type: "plain_text",
emoji: true,
text: "List Failing Checks",
},
action_id: LIST_FAILING_CHECKS_ACTION_ID,
value: failingCheckIds.join(","),
},
{
type: "button",
text: {
type: "plain_text",
emoji: true,
text: "List Error Patterns",
},
action_id: LIST_ERROR_PATTERNS_ACTION_ID,
value: errorPatterns.map((ep) => ep.id).join(","),
},
...(failingCheckIds.length > 0
? [
{
type: "button",
text: {
type: "plain_text",
emoji: true,
text: "List Failing Checks",
},
action_id: LIST_FAILING_CHECKS_ACTION_ID,
value: failingCheckIds.join(","),
},
]
: []),
...(errorPatterns.length > 0
? [
{
type: "button",
text: {
type: "plain_text",
emoji: true,
text: "List Error Patterns",
},
action_id: LIST_ERROR_PATTERNS_ACTION_ID,
value: errorPatterns.map((ep) => ep.id).join(","),
},
]
: []),
],
},
]
Expand Down