Skip to content

fix(reports): replace stale Selenium references in screenshot messages - #44244

Merged
rusackas merged 5 commits into
apache:masterfrom
sfirke:fix/reports-stale-selenium-messages
Sep 22, 2026
Merged

rusackas merged 5 commits into
apache:masterfrom
sfirke:fix/reports-stale-selenium-messages

Conversation

@sfirke

@sfirke sfirke commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

SUMMARY

Follow-up to #43028, which removed Selenium support and made Playwright with Chromium the only screenshot backend. A few messages and comments still referred to Selenium (or Cypress) and can mislead operators:

  • superset/utils/webdriver.py: the hint appended to the Playwright is required for screenshots. error said "To complete the migration from Cypress and enable WebGL/DeckGL screenshot support". It now just says how to install Playwright and Chromium.
  • superset/config.py:
    • the thumbnail comment claimed rendering falls back to a "Selenium user" for anonymous users (that user was replaced by executors in chore: replace selenium user with fixed user #31844);
    • a note says SCREENSHOT_SELENIUM_HEADSTART and SCREENSHOT_SELENIUM_ANIMATION_WAIT apply to Playwright despite their names. The keys are not renamed, so existing configs keep working.
  • superset/utils/screenshots.py: a comment and the Selenium image size debug log.
  • superset/mcp_service/README.md: remove WEBDRIVER_TYPE = 'chrome' from both sample configs. That key was removed in feat(Reports&Alerts): remove Selenium support, require Playwright #43028.
  • docker-compose.yml: the worker memory-limit comment.

Apart from the wording of that one error message and one debug log line, there are no behavior changes.

Related: #44243 fixes the same references in the docs. #44245 (master only) removes the unused INCLUDE_FIREFOX build arg and other dead config.

Cherry-pick: this is text-only and a candidate for 7.0, so the install error shown on 7.0.x deployments without Playwright is accurate.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Error raised when Playwright or Chromium is unavailable:

Before:

Playwright is required for screenshots. To complete the migration from Cypress and enable WebGL/DeckGL screenshot support, install Playwright with: pip install playwright && playwright install chromium

After:

Playwright is required for screenshots. Install Playwright and Chromium with: pip install playwright && playwright install chromium

TESTING INSTRUCTIONS

  • pytest tests/unit_tests/utils/webdriver_test.py tests/unit_tests/utils/test_screenshot_cache_fix.py (the only test touching PLAYWRIGHT_INSTALL_MESSAGE checks that it is a string).
  • Optional: in an environment without Playwright installed, trigger a report or thumbnail screenshot and confirm the worker error uses the new wording.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Drafted by Claude Code, co-signed by @sfirke.

Selenium support was removed in apache#43028. Reword the Playwright install
hint, which referred to a migration from Cypress, and update config
comments, a debug log, the MCP README sample configs and a
docker-compose comment that still described Selenium. The
SCREENSHOT_SELENIUM_* config keys keep their names so existing
configs continue to work.
@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.56%. Comparing base (394bca5) to head (069ade1).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
superset/utils/screenshots.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #44244   +/-   ##
=======================================
  Coverage   80.56%   80.56%           
=======================================
  Files        2938     2940    +2     
  Lines      175246   175303   +57     
  Branches    40680    40688    +8     
=======================================
+ Hits       141184   141238   +54     
- Misses      31396    31400    +4     
+ Partials     2666     2665    -1     
Flag Coverage Δ
hive 37.25% <0.00%> (-0.02%) ⬇️
mysql 56.50% <0.00%> (+0.02%) ⬆️
postgres 56.52% <0.00%> (+0.02%) ⬆️
presto 39.14% <0.00%> (-0.01%) ⬇️
python 84.87% <50.00%> (+0.01%) ⬆️
sqlite 56.23% <0.00%> (+0.02%) ⬆️
unit 76.61% <50.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sfirke
sfirke marked this pull request as ready for review September 14, 2026 16:33
@sfirke

sfirke commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

@villebro my last docs candidate for 7.0 cherrying

@netlify

netlify Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 97534b3
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6aaca3fbcfddf70008d601b1
😎 Deploy Preview https://deploy-preview-44244--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread superset/config.py Outdated

# Time before selenium times out after trying to locate an element on the page and wait
# for that element to load for a screenshot.
# Time before the headless browser times out after trying to locate an element on the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCREENSHOT_LOCATE_WAIT is only copied into _screenshot_locate_wait, which the Playwright path never reads, so this new comment makes an inert setting look like the browser's element-timeout control. Could we mark it as compatibility-only and point operators to the active Playwright wait settings, or remove it with the other dead screenshot config?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, confirmed: nothing has read _screenshot_locate_wait since #43028. Element waits come from the report execution deadline, or SCREENSHOT_PLAYWRIGHT_DEFAULT_TIMEOUT outside reports. Since it's dead config, I reverted my comment change here and removed the key in #44245, along with the other dead screenshot config. That PR also drops the unused attribute, its test entries and the docs example that set it, and notes the removal in UPDATING.md.


🤖 Drafted by Claude Code, co-signed by @sfirke.

@bito-code-review

Copy link
Copy Markdown
Contributor

The observation is correct. SCREENSHOT_LOCATE_WAIT is currently defined in superset/config.py but is not utilized by the Playwright implementation, making it misleading for operators. Marking it as compatibility-only or removing it alongside other legacy configuration is a sound approach to reduce confusion.

superset/config.py

# "SELENIUM" in the next two key names is historical; both apply to Playwright.
# Time before the headless browser times out after trying to locate an element on the
# page and wait for that element to load for a screenshot.
SCREENSHOT_LOCATE_WAIT = int(timedelta(seconds=10).total_seconds())

Comment on lines 61 to 64
PLAYWRIGHT_INSTALL_MESSAGE = (
"To complete the migration from Cypress "
"and enable WebGL/DeckGL screenshot support, install Playwright with: "
"Install Playwright and Chromium with: "
"pip install playwright && playwright install chromium"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Browser launch failures from invalid arguments, permissions, or crashes are reported as missing dependencies, sending operators toward an incorrect fix.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Error handling

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset/utils/webdriver.py
**Line:** 61:64
**Comment:**
	*Error Handling: Browser launch failures from invalid arguments, permissions, or crashes are reported as missing dependencies, sending operators toward an incorrect fix.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, and it applied more broadly than the line it was flagged on: every failure to start the browser was being reported as a missing dependency, not just some of them. A worker running as root without --no-sandbox, a bad entry in WEBDRIVER_OPTION_ARGS, a Chromium killed for running out of memory, an unwritable temp directory — all of them told the operator to install Playwright, which was already installed.

Fixed in 069ade1 by deleting the message rather than correcting it. Playwright's own error is now passed through untouched.

That turned out to be better even for the case the message was written for. When the browser binary really is missing, Playwright says so, names the exact path where it expected to find it, and gives the command to install it. The path is the useful part — it's how you spot a wrong PLAYWRIGHT_BROWSERS_PATH or a Docker layer that dropped the browser cache. The old message had none of that, and its "pip install playwright" advice couldn't ever be right here, because this code only runs after Playwright has already imported successfully.

The install hint is still used in one place: when the Playwright import itself fails. There's no underlying error to show there, so a written message is all that's available.

One consequence worth flagging. When a report fails, this text can be emailed to the report's recipients, not just written to the worker log. So a failed screenshot can now put Playwright's wording — and sometimes Chromium's own output — in front of people who just subscribe to the report. That was already true of every other error on this path, so it isn't a new kind of exposure, but it does widen what those emails can contain. The real fix is to stop using one string for both operator diagnostics and recipient-facing mail, which is a bigger change than belongs in this PR.


🤖 Drafted by Claude Code, reviewed and approved by @sfirke.

ghost Sep 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I will note: this error was not introduced in this PR, this is just a chance to fix another prior outstanding issue)

@pull-request-size pull-request-size Bot added size/L and removed size/S labels Sep 18, 2026
Every exception from the Playwright browser launch was rewritten into the
"install Playwright" message, so a container running as root without
--no-sandbox, a bad WEBDRIVER_OPTION_ARGS flag, an OOM-killed Chromium or an
unwritable temp dir all told the operator to reinstall a package that was
already present.

Playwright's own error is raised instead. It is more useful than the message it
replaces, including for the missing-browser case it was written for: Playwright
names the path where the binary was expected, which is how a wrong
PLAYWRIGHT_BROWSERS_PATH or a dropped Docker layer gets spotted, and gives the
install command. The old hint's "pip install playwright" half was wrong here by
construction, since this code only runs once the import has succeeded.

The install hint is kept for the failed-import branch, which has no error of its
own to report. Launch args and the traceback are logged.
@sfirke
sfirke force-pushed the fix/reports-stale-selenium-messages branch from 81d4286 to 069ade1 Compare September 18, 2026 14:14
@pull-request-size pull-request-size Bot added size/M and removed size/L labels Sep 18, 2026

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup, and appreciate you chasing the browser-launch error handling down to the real bug instead of just the line that got flagged. Both threads look genuinely closed, the dead _screenshot_locate_wait config split into #44245 and the launch failure now surfaces Playwright's own error with a regression test. LGTM, approving, will merge soon.

@rusackas
rusackas merged commit f47fcad into apache:master Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants