bito-code-review[bot] commented on code in PR #42481:
URL: https://github.com/apache/superset/pull/42481#discussion_r3682820377
##########
superset-frontend/src/pages/AlertReportList/index.tsx:
##########
@@ -78,6 +78,7 @@ const AlertStateLabel: Record<AlertState, string> = {
[AlertState.Error]: t('Error'),
[AlertState.Noop]: t('Not triggered'),
[AlertState.Grace]: t('On Grace'),
+ [AlertState.Retrying]: t('Retrying'),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Inconsistent filter option coverage</b></div>
<div id="fix">
The `AlertStateLabel` map now includes `Retrying` (line 81), but the Status
filter dropdown at lines 581-593 is missing the corresponding filter option.
Users can see alerts in 'Retrying' state but cannot filter by this state,
creating an inconsistent user experience compared to other states that have
both labels and filter options.
</div>
</div>
<small><i>Code Review Run #165e40</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx:
##########
@@ -39,6 +39,8 @@ function getStatusColor(status: string, theme: SupersetTheme)
{
return theme.colorTextSecondary;
case AlertState.Grace:
return theme.colorErrorText;
+ case AlertState.Retrying:
+ return theme.colorPrimaryText;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing unit tests for Retrying</b></div>
<div id="fix">
The new `AlertState.Retrying` state lacks test coverage. Existing tests
cover Success, Error, Grace, Noop, and empty state, but the Retrying case is
untested. Per rule [6262], tests should verify behavior logic directly, not
just rendering.
</div>
</div>
<small><i>Code Review Run #165e40</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -2730,6 +2735,123 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
</>
),
},
+ ...(isReport
+ ? [
+ {
+ key: 'error-handling',
+ label: (
+ <CollapseLabelInModal
+ title={t('Error handling')}
+ subtitle={t(
+ 'Configure retry behavior on delivery failure.',
+ )}
+ testId="error-handling-panel"
+ />
+ ),
+ children: (
+ <div className="header-section">
+ <StyledSwitchContainer
+ css={css`
+ margin-bottom: ${theme.sizeUnit * 4}px;
+ `}
+ >
+ <Switch
+ checked={!!currentAlert?.retry_on_failure}
+ onChange={(checked: boolean) => {
+ updateAlertState('retry_on_failure', checked);
+ if (!checked) {
+ updateAlertState('send_failed_reports', false);
+ updateAlertState('retry_notify_owners', true);
+ updateAlertState(
+ 'retry_notify_recipients',
+ false,
+ );
+ updateAlertState('retry_max_attempts', 3);
+ }
+ }}
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing test for disable toggle</b></div>
<div id="fix">
The existing test 'shows retry options when Enable Retries is toggled on'
(line 2895) only covers the enable direction. There is no test for the disable
toggle, leaving the reset behavior uncovered. Adding a test for toggling OFF
will prevent regressions.
</div>
</div>
<small><i>Code Review Run #165e40</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]