tien238lnd opened a new pull request, #44338: URL: https://github.com/apache/superset/pull/44338
### SUMMARY `generate_explore_link` returns `/explore/p/<key>/` links, and Explore's Share button produces the same kind of link, but no MCP tool can read one back: `get_chart_info` only accepts `form_data_key`, whose cache entry expires. `get_dashboard_info` already resolves dashboard permalinks. `get_chart_info` now accepts `permalink_key`, either the bare key or the full permalink URL: - The permalink is read with `GetExplorePermalinkCommand`, which enforces access to its datasource and chart, before the chart lookup. - A permalink created from a saved chart resolves that chart, so `identifier` becomes optional, and the permalink's `form_data` replaces the saved one (`is_permalink_state=true`). Passing the `identifier` of a different chart is an error rather than a silent merge. - A permalink of an Explore session that was never saved is returned the way a `form_data_key`-only request is, with the datasource named from the permalink rather than left blank. - `chartId` is normalized to `int`, since it is copied from the client-supplied `formData.slice_id`. - Refused for embedded guest reads, which are scoped to a dashboard. The `viz_type`/filters refresh used by the `form_data_key` override is split into a helper so both overrides share it. ### TESTING INSTRUCTIONS `pytest tests/unit_tests/mcp_service/chart` Manually, through an MCP client: - Call `generate_explore_link` for a saved chart, pass the returned URL to `get_chart_info` as `permalink_key` — the chart resolves and `is_permalink_state` is true. - In Explore, change a chart without saving, Share → Copy permalink, pass that key — the unsaved state comes back with the datasource named. - Pass that permalink together with the `identifier` of an unrelated chart — the call is rejected. - As a user without access to the permalink's dataset, the call returns `PermalinkAccessDenied`. ### ADDITIONAL INFORMATION - [x] Introduces new feature or API -- 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]
