reignmina opened a new pull request, #40589:
URL: https://github.com/apache/superset/pull/40589
### SUMMARY
- Added DashboardReviewCommand for read-only dashboard checks.
- Added GET /api/v1/dashboard/{id_or_slug}/review/.
Review flags:
- invalid dashboard JSON metadata/layout
- layout chart references not attached to dashboard
- attached charts missing from layout
- duplicate chart layout references
- missing chart viz type/datasource
- invalid chart params/query context JSON
- optional runtime chart query errors via run_chart_queries=true
- Added response schemas and read permission mapping.
- Added focused dashboard API integration tests.
### TESTING INSTRUCTIONS
1. Start Superset with a development/test database that has at least one
dashboard with charts.
2. Run the focused backend tests:
```bash
python3 -m pytest \
tests/integration_tests/dashboards/api_tests.py::TestDashboardApi::test_review_dashboard
\
tests/integration_tests/dashboards/api_tests.py::TestDashboardApi::test_review_dashboard_flags_layout_chart_not_attached
\
tests/integration_tests/dashboards/api_tests.py::TestDashboardApi::test_review_dashboard_with_chart_query_errors
3. Manually verify the new review endpoint for an existing dashboard:
```
curl -s \
-H "Authorization: Bearer $SUPERSET_ACCESS_TOKEN" \
"$SUPERSET_BASE_URL/api/v1/dashboard/<dashboard_id_or_slug>/review/"
```
Expected:
- Response status is 200.
- Response includes result.status.
- Healthy dashboards return status: "pass" and an empty issues array.
- Dashboards with structural problems return status: "warning" or status:
"error" with structured issue objects.
4. Verify optional chart query checks:
```
curl -s \
-H "Authorization: Bearer $SUPERSET_ACCESS_TOKEN" \
"$SUPERSET_BASE_URL/api/v1/dashboard/<dashboard_id_or_slug>/review/?run_chart_queries=true"
```
Expected:
- Response includes run_chart_queries: true.
- Response includes chart_results.
- Charts with query/runtime failures produce error-level issues with
viz_error details.
--
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]