codeant-ai-for-open-source[bot] commented on code in PR #45698:
URL: https://github.com/apache/superset/pull/45698#discussion_r4379482341
##########
superset/commands/report/execute.py:
##########
@@ -791,17 +802,55 @@ def _get_url(
):
return self._get_tab_url(dashboard_state,
user_friendly=user_friendly)
+ return self._get_plain_dashboard_url(user_friendly=user_friendly,
**kwargs)
+
+ def _get_plain_dashboard_url(
+ self, user_friendly: bool = False, **kwargs: Any
+ ) -> str:
+ """Return the dashboard URL without any stored permalink state."""
+ dashboard = self._report_schedule.dashboard
dashboard_id_or_slug = (
dashboard.uuid if dashboard.uuid is not None else dashboard.id
)
return get_url_path(
"Superset.dashboard",
user_friendly=user_friendly,
dashboard_id_or_slug=dashboard_id_or_slug,
- force=force,
+ force=self._get_force_param(),
**kwargs,
)
+ def _get_failure_notification_url(self) -> str:
+ """
+ Return the link for a failure notification.
+
+ The stateful link is a permalink created as the executor. When the
+ executor cannot access the dashboard, that is the very failure being
+ reported, so link to the dashboard itself rather than letting the
+ notification fail too.
+ """
+ try:
+ return self._get_url(user_friendly=True)
+ except ReportScheduleExecutorAccessDeniedError:
+ return self._get_plain_dashboard_url(user_friendly=True)
+
+ def _raise_for_executor_dashboard_access(self) -> None:
+ """
+ Fail with an actionable error when the executor cannot see the
dashboard.
+
+ Without this, a plain dashboard URL renders the not-found page for the
+ executor and surfaces only as a generic screenshot failure.
+ """
+ user = get_user()
+ if user is None or getattr(user, "is_anonymous", False):
+ return
+ try:
+
security_manager.raise_for_access(dashboard=self._report_schedule.dashboard)
Review Comment:
**Suggestion:** This RBAC check ignores `EXTRA_ACCESS_QUERY_EXCLUSIONS`; an
excluded executor passes save validation, then permalink creation raises
uncaught `DashboardNotFoundError` before claiming or logging.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d33d8214308f47bb94969baaa1601cc9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d33d8214308f47bb94969baaa1601cc9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/commands/report/execute.py
**Line:** 848:848
**Comment:**
*Api Mismatch: This RBAC check ignores `EXTRA_ACCESS_QUERY_EXCLUSIONS`;
an excluded executor passes save validation, then permalink creation raises
uncaught `DashboardNotFoundError` before claiming or logging.
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%2F45698&comment_hash=913d060a7babe5e5802d063c2de57070a10a29e06b990f662efc5613a656082e&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45698&comment_hash=913d060a7babe5e5802d063c2de57070a10a29e06b990f662efc5613a656082e&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]