codeant-ai-for-open-source[bot] commented on code in PR #42481:
URL: https://github.com/apache/superset/pull/42481#discussion_r3689547745


##########
superset/commands/report/update.py:
##########
@@ -179,5 +180,17 @@ def validate(self) -> None:  # noqa: C901
             include_viewers=False,
         )
 
+        # Validate retry config: send_failed_reports requires retry_on_failure.
+        # Fall back to the existing DB value for fields not in the payload.
+        send_failed = self._properties.get(
+            "send_failed_reports", self._model.send_failed_reports
+        )
+        retry_enabled = self._properties.get(
+            "retry_on_failure", self._model.retry_on_failure
+        )
+        if send_failed and not retry_enabled:
+            msg = _("send_failed_reports requires retry_on_failure to be 
enabled")
+            exceptions.append(ValidationError({"send_failed_reports": [msg]}))

Review Comment:
   **Suggestion:** Partial updates can enable retries on alert schedules. 
`ReportSchedulePutSchema` does not require `type`, so an update containing only 
`retry_on_failure: true` bypasses the schema's alert restriction, and this 
command-level validation checks only the retry/send-failed dependency, not the 
effective `report_type`. Reject retry configuration when the existing or 
updated schedule type is an alert, otherwise alert executions can enter the 
retry flow even though retries are documented as report-only. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Alert failures can be re-executed through the report retry workflow.
   - ⚠️ Alert owners or recipients may receive unsupported retry notifications.
   - ⚠️ Repeated alert evaluations can create duplicate delivery attempts.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=59829086919b441d8018a7dcf8ae0a1f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=59829086919b441d8018a7dcf8ae0a1f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/commands/report/update.py
   **Line:** 183:193
   **Comment:**
        *Api Mismatch: Partial updates can enable retries on alert schedules. 
`ReportSchedulePutSchema` does not require `type`, so an update containing only 
`retry_on_failure: true` bypasses the schema's alert restriction, and this 
command-level validation checks only the retry/send-failed dependency, not the 
effective `report_type`. Reject retry configuration when the existing or 
updated schedule type is an alert, otherwise alert executions can enter the 
retry flow even though retries are documented as report-only.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42481&comment_hash=dd23528dc4fa18fc7e606959eb77ad39fc3cc33169b8539a769fe601fb5aa713&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42481&comment_hash=dd23528dc4fa18fc7e606959eb77ad39fc3cc33169b8539a769fe601fb5aa713&reaction=dislike'>👎</a>



-- 
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]

Reply via email to