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

Fix attempts badge and history event detail #776

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ const workflowHistoryEventDetailsConfig = [
});
},
},
{
name: 'Retry config attempt as retryAttempt',
key: 'attempt',
getLabel: () => 'retryAttempt',
},
] as const satisfies WorkflowHistoryEventDetailsConfig[];

export default workflowHistoryEventDetailsConfig;
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export default function getActivityGroupFromEvents(
label = `Activity ${scheduleEvent[scheduleAttr]?.activityId}: ${scheduleEvent[scheduleAttr]?.activityType?.name}`;
}
if (startEvent && startEvent[startAttr]?.attempt) {
const attempts = startEvent[startAttr].attempt;
const retryAttemptNumber = startEvent[startAttr].attempt;

badges.push({
content: `${attempts + 1} Attempts`,
content:
retryAttemptNumber === 1 ? '1 Retry' : `${retryAttemptNumber} Retries`,
});
}
if (firstEvent.attributes !== 'activityTaskScheduledEventAttributes') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ export default function getDecisionGroupFromEvents(
}

if (scheduleEvent && scheduleEvent[scheduleAttr]?.attempt) {
const attempts = scheduleEvent[scheduleAttr].attempt;
const retryAttemptNumber = scheduleEvent[scheduleAttr].attempt;

badges.push({
content: `${attempts + 1} Attempts`,
content:
retryAttemptNumber === 1 ? '1 Retry' : `${retryAttemptNumber} Retries`,
});
}
const eventToLabel: HistoryGroupEventToStringMap<DecisionHistoryGroup> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ export default function getSingleEventGroupFromEvents(
event.attributes === 'workflowExecutionStartedEventAttributes' &&
event.workflowExecutionStartedEventAttributes?.attempt
) {
const attempts = event.workflowExecutionStartedEventAttributes.attempt;
const retryAttemptNumber =
event.workflowExecutionStartedEventAttributes.attempt;

badges.push({
content: `${attempts + 1} Attempts`,
content:
retryAttemptNumber === 1 ? '1 Retry' : `${retryAttemptNumber} Retries`,
});
}

Expand Down
Loading