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


##########
superset/mcp_service/dashboard/tool/manage_dashboard_certification.py:
##########
@@ -92,6 +98,25 @@ def manage_dashboard_certification(
             warnings=["No fields provided; dashboard unchanged."],
         )
 
+    # Externally managed dashboards refuse certification CHANGES (the
+    # no-field inspect path above still returns current values): their
+    # source of truth lives outside Superset, so a badge set here would be
+    # overwritten (or drift from the certifying system) on the next
+    # external sync. This tool writes by direct attribute assignment +
+    # commit rather than through a command, so no command-layer check can
+    # protect it — the refusal must live in the tool itself, after the
+    # editorship check, where a caller with no edit rights keeps getting
+    # the plain editorship denial.
+    if dashboard.is_managed_externally:
+        return ManageDashboardCertificationResponse(

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > For governance tools that directly commit dashboard changes, re-read and 
lock the externally managed flag within the writing transaction to prevent 
TOCTOU races; centralize this check in the shared managed-externally guard.
   
   **Applied to:**
     - `superset/mcp_service/dashboard/tool/manage_dashboard_certification.py`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



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