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


##########
superset/reports/schemas.py:
##########
@@ -175,6 +177,43 @@ def validate_addresses(field: str, value: str | None, 
required: bool) -> None:
         validate_addresses("ccTarget", config.get("ccTarget"), required=False)
         validate_addresses("bccTarget", config.get("bccTarget"), 
required=False)
 
+    @validates_schema
+    def validate_slack_recipients(self, data: dict[str, Any], **kwargs: Any) 
-> None:
+        """Slack recipients must be channel ids, because a name never 
delivers."""
+        if data.get("type") not in (
+            ReportRecipientType.SLACK.value,
+            ReportRecipientType.SLACKV2.value,
+        ):
+            return

Review Comment:
   **Suggestion:** The new validator rejects existing Slack V1 targets such as 
`#general` and `channel`, so the unchanged schema and API tests now fail and 
existing clients can no longer create or update legacy Slack recipients. This 
conflicts with the legacy notification path, which still accepts channel names 
and resolves them during the Slack V1-to-V2 upgrade. Either limit this 
validation to `SlackV2`, or migrate/resolve legacy names before applying the 
ID-only validation and update the affected tests and API contract together. 
[api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Legacy Slack API creation rejects previously supported channel names.
   - ❌ Existing clients cannot update name-based Slack recipients.
   - ⚠️ Runtime migration remains unreachable for newly submitted names.
   ```
   </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=3f675bc5c1b04b728df3a5f18366d0e5&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=3f675bc5c1b04b728df3a5f18366d0e5&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/reports/schemas.py
   **Line:** 183:187
   **Comment:**
        *Api Mismatch: The new validator rejects existing Slack V1 targets such 
as `#general` and `channel`, so the unchanged schema and API tests now fail and 
existing clients can no longer create or update legacy Slack recipients. This 
conflicts with the legacy notification path, which still accepts channel names 
and resolves them during the Slack V1-to-V2 upgrade. Either limit this 
validation to `SlackV2`, or migrate/resolve legacy names before applying the 
ID-only validation and update the affected tests and API contract together.
   
   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%2F42850&comment_hash=e5d3937dbb08923968463736b5d7c18ba7cff8e417fae53c4b41076c22dc5546&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42850&comment_hash=e5d3937dbb08923968463736b5d7c18ba7cff8e417fae53c4b41076c22dc5546&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