Companion to the previous commit's positive per-tile readiness check,
carrying the rest of PR #42119's changes onto this base:
- Per-tile readiness timeout logs at WARNING (customer chart-loading
issue, not a system fault -- matching #38130/#38441) with elapsed wait
time, tile index/total, load_wait, and the identity + stuck-state of
each unready chart holder (waiting_on_database / spinner_mounted /
nothing_mounted), then re-raises so the report fails rather than
shipping a blank or spinner tile. A per-tile DEBUG line logs readiness
wait time for profiling.
- The deliberate readiness-timeout re-raise is tracked with an explicit
flag rather than `except PlaywrightTimeout` at the outer level, since
PlaywrightTimeout is aliased to bare Exception when playwright isn't
installed and would otherwise swallow-or-propagate the wrong cases.
- Threads an optional log_context (e.g. "execution_id=<uuid>") from
BaseReportState._get_screenshots through BaseScreenshot.get_screenshot
and both WebDriverProxy implementations into take_tiled_screenshot,
so timeout logs correlate back to the report run. Defaults to None
for callers outside the report pipeline (thumbnails).
Backported from apache/superset#42119 (commits 37da786b52, f6feb70eca,
97d15485ad squashed) onto this branch's base; only the log lines this
change itself adds or touches carry the context suffix -- pre-existing
log lines on this base (f-string style) are left as-is.
Co-Authored-By: Claude <noreply@anthropic.com>
`take_tiled_screenshot()` waited for the *absence* of `.loading` elements
visible in the viewport before capturing each tile. With
DashboardVirtualization on (default), a chart holder that has just scrolled
into view but hasn't fired its IntersectionObserver callback yet mounts
neither a spinner nor a chart, so the predicate passed vacuously and the
tile was captured blank. On top of that, a per-tile timeout was caught,
logged as a warning, and the tile was captured anyway -- delivering a
spinner screenshot to report recipients instead of failing the report.
Replace the absence-of-`.loading` predicate with a positive readiness
check: every chart holder (`data-test="dashboard-component-chart-holder"`)
intersecting the viewport must show a terminal state (a rendered chart via
`.slice_container`, or an error/empty state via `[role="alert"]` /
`.ant-empty` / `.missing-chart-container`) before a tile is captured. A
holder with nothing mounted no longer satisfies the wait.
A per-tile timeout is now logged at ERROR with the tile index, the
load_wait, and the identities of the still-unready chart holders, and
re-raises instead of being swallowed -- the report now fails
(ReportScheduleScreenshotFailedError) instead of silently shipping a
degraded screenshot.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit bd9ba24266)
[6.0 adaptation] Production schema aliases (chart/dashboard/dataset schemas.py)
applied to the 6.0 baseline. Two files needed adaptation because 6.0 predates
later MCP refactors:
- chart/schemas.py: kept the 6.0 base classes and added only
`model_config = ConfigDict(populate_by_name=True)` to GenerateExploreLinkRequest
and UpdateChartPreviewRequest. Dropped upstream's ChartRequestNormalizerMixin
base (absent on 6.0 — would be F821); the model_config achieves the same
populate-by-name behavior the aliases require.
- test_dashboard_schemas.py: kept TestRequestSchemaAliasChoices (exercises
GetDashboardInfoRequest / ListDashboardsRequest / AddChartToDashboardRequest —
all present on 6.0). Dropped upstream's TestDuplicateDashboardResponse (the
Duplicate Dashboard feature is absent on 6.0).
dashboard/dataset schemas.py, chart/dataset tests, and the new dataset test
file applied clean. pytest: 184 passed (42 alias/canonical-resolution cases)
across all three schema test files.
Manual port of apache/superset#39917 (commit 85935b0b) onto 6.0-release.
A clean cherry-pick does not apply because mcp_service/auth.py has diverged
structurally on this branch, but the vulnerable code path is present verbatim:
sync_wrapper calls db.session.remove() before user resolution on reused
thread-pool threads. If the thread-local DBAPI connection died between
requests (RDS SSL idle-timeout / max-connection-age), the implicit rollback
raises a DBAPIError and crashes the tool call.
Wrap the pre-call remove in _remove_session_safe(), which catches DBAPIError,
invalidates the dead connection so the pool discards it, and retries remove()
so the tool proceeds on a fresh connection. Ports the accompanying regression
test byte-for-byte behaviorally.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit ef7379c47e)
Adapted for 6.0-release: on this branch only the css_template and theme MCP
tool groups exist, so this pick removes those two groups (their list/get tools,
schemas, and unit tests) along with their docstring and get_schema references.
The plugin, action_log, and task-management tool groups the upstream change
also touched do not exist on 6.0 and were left untouched.