Skip to content

feat(Reports&Alerts): remove Selenium support, require Playwright - #43028

Open
madhushreeag wants to merge 5 commits into
apache:masterfrom
madhushreeag:feat-remove-selenium
Open

feat(Reports&Alerts): remove Selenium support, require Playwright#43028
madhushreeag wants to merge 5 commits into
apache:masterfrom
madhushreeag:feat-remove-selenium

Conversation

@madhushreeag

@madhushreeag madhushreeag commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

Removes all Selenium support from Superset's screenshot, thumbnail, and report pipeline. Playwright is now the sole WebDriver backend.

Why

The codebase has been incrementally migrating toward Playwright via the PLAYWRIGHT_REPORTS_AND_THUMBNAILS feature flag. That migration is complete. This PR removes the old Selenium code path entirely, eliminating a dual-code maintenance burden and enabling Playwright's superior WebGL/DeckGL screenshot support unconditionally.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — internal infrastructure change, no UI impact.

TESTING INSTRUCTIONS

  1. Install Playwright: pip install playwright && playwright install chromium
  2. Start Celery worker: celery --app=superset.tasks.celery_app:app worker --pool=solo
  3. Create an Alert or Report targeting a dashboard
  4. Click Run — execution should succeed, screenshot captured via Playwright, notification delivered
  5. Confirm old config keys (WEBDRIVER_TYPE, SCREENSHOT_SELENIUM_RETRIES) are no longer referenced and cause no errors if left in a local config

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

@dosubot dosubot Bot added alert-reports Namespace | Anything related to the Alert & Reports feature risk:breaking-change Issues or PRs that will introduce breaking changes labels Aug 10, 2026
@bito-code-review

bito-code-review Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #8decf2

Actionable Suggestions - 0
Additional Suggestions - 4
  • superset/utils/webdriver.py - 1
    • Behavior change: None return to RuntimeError · Line 518-522
      `get_screenshot` behavior changed: when Playwright is unavailable, it previously returned `None` (graceful degradation) but now raises `RuntimeError`. Callers in `screenshots.py` catch all exceptions via `except Exception` so they handle this, but any direct callers outside that pattern would break.
  • superset/mcp_service/screenshot/webdriver_pool.py - 1
    • Duplicate docstring content · Line 19-25
      The module docstring (lines 19-25) and WebDriverPool class docstring (lines 35-38) contain overlapping information about Playwright managing browser lifecycle. Consider consolidating to avoid docstring duplication.
  • superset/utils/screenshots.py - 1
    • Dead parameters in driver() method · Line 205-212
      `driver()` accepts `user` and `log_context` parameters but ignores them. The original implementation used `app.config["WEBDRIVER_TYPE"]` and passed `user` to `WebDriverSelenium`. The new code passes an empty string `""` for driver_type. These parameters should be documented or removed to avoid misleading callers.
  • tests/integration_tests/utils/machine_auth_tests.py - 1
    • Tests removed with method deprecation · Line 30-56
      The removed tests (`test_auth_driver_user`, `test_auth_driver_request`) tested the now-removed `authenticate_webdriver()` method (documented removal in `UPDATING.md:47`). The new `authenticate_browser_context()` method uses `playwright.sync_api.BrowserContext` instead of webdriver. Consider adding new tests to cover the browser context authentication flow.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • tests/unit_tests/utils/test_playwright_migration_working.py - 2
    • Assertion contradicts production behavior · Line 76-80
    • Missing type annotations on test methods and mock variables · Line 35-37
  • superset/utils/webdriver.py - 1
Review Details
  • Files reviewed - 16 · Commit Range: b80bec0..b80bec0
    • pyproject.toml
    • requirements/base.txt
    • requirements/development.txt
    • superset/config.py
    • superset/mcp_service/screenshot/pooled_screenshot.py
    • superset/mcp_service/screenshot/webdriver_pool.py
    • superset/tasks/cache.py
    • superset/utils/machine_auth.py
    • superset/utils/screenshots.py
    • superset/utils/webdriver.py
    • tests/integration_tests/thumbnails_tests.py
    • tests/integration_tests/utils/machine_auth_tests.py
    • tests/unit_tests/tasks/test_cache.py
    • tests/unit_tests/utils/screenshot_test.py
    • tests/unit_tests/utils/test_playwright_migration_working.py
    • tests/unit_tests/utils/webdriver_test.py
  • Files skipped - 2
    • UPDATING.md - Reason: Filter setting
    • docs/static/feature-flags.json - Reason: Filter setting
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label Aug 10, 2026
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit bd47178
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a7aab9b1a89e50008541965
😎 Deploy Preview https://deploy-preview-43028--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.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.72%. Comparing base (34b2d3a) to head (b49ee64).

Files with missing lines Patch % Lines
superset/tasks/cache.py 10.00% 9 Missing ⚠️
superset/mcp_service/screenshot/webdriver_pool.py 0.00% 4 Missing ⚠️
superset/utils/screenshots.py 25.00% 3 Missing ⚠️
...perset/mcp_service/screenshot/pooled_screenshot.py 0.00% 1 Missing ⚠️
superset/utils/webdriver.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #43028      +/-   ##
==========================================
+ Coverage   66.55%   66.72%   +0.17%     
==========================================
  Files        2864     2864              
  Lines      161891   161274     -617     
  Branches    37304    37236      -68     
==========================================
- Hits       107739   107615     -124     
+ Misses      52105    51636     -469     
+ Partials     2047     2023      -24     
Flag Coverage Δ
hive 38.40% <14.28%> (+0.24%) ⬆️
mysql 57.97% <14.28%> (+0.28%) ⬆️
postgres 58.02% <14.28%> (+0.28%) ⬆️
presto 40.38% <14.28%> (+0.26%) ⬆️
python 59.42% <14.28%> (+0.30%) ⬆️
sqlite 57.64% <14.28%> (+0.28%) ⬆️
unit 100.00% <ø> (ø)

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.

@villebro
villebro self-requested a review August 10, 2026 23:25
@villebro villebro self-assigned this Aug 10, 2026
@villebro villebro moved this to Work in Progress in Apache Superset 7.0 Aug 10, 2026
@rusackas

rusackas commented Aug 11, 2026

Copy link
Copy Markdown
Member

Can you fill out the PR description please, when you have a chance? Thanks for the PR, and happy to see this go!

@madhushreeag madhushreeag changed the title feat(Reports&Alerts):remove Selenium support, require Playwright feat(Reports&Alerts): remove Selenium support, require Playwright Aug 11, 2026
@bito-code-review

bito-code-review Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #ecced6

Actionable Suggestions - 0
Additional Suggestions - 4
  • superset/mcp_service/screenshot/pooled_screenshot.py - 1
    • Semantic duplication with ChartScreenshot constructor · Line 61-84
      PooledChartScreenshot (lines 61-84) and ChartScreenshot (screenshots.py lines 432-446) implement nearly identical constructors: same url modification with ChartStandaloneMode.HIDE_NAV, same window_size default (800, 600). This semantic duplication creates divergence risk.
  • superset/utils/screenshots.py - 2
    • WebDriverSelenium class may be dead code · Line 28-57
      The diff removes WebDriverSelenium from the screenshot workflow. Verify if the WebDriverSelenium class definition itself is now dead code that should be removed, or if it's still used elsewhere in the codebase.
    • Empty driver_type passed to Playwright · Line 210-210
      The `driver_type` property was removed but empty string `''` is passed to `WebDriverPlaywright`. Verify this is intentional — if `_driver_type` is truly unused in the Playwright path, passing an empty string is safe but should be documented.
  • tests/unit_tests/utils/webdriver_test.py - 1
    • Test assertion mismatch · Line 115-121
      Test `test_check_playwright_availability_ignores_runtime_errors` has misleading comment 'Even if the mock raises' but mock is not configured to raise. Since the implementation at line 83 only checks `sync_playwright is not None` (no function invocation), this test passes vacuously without validating the stated error-handling behavior.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • tests/unit_tests/utils/webdriver_test.py - 5
  • superset/tasks/cache.py - 1
  • tests/unit_tests/mcp_service/test_pooled_screenshot.py - 1
  • superset/mcp_service/screenshot/pooled_screenshot.py - 1
  • tests/unit_tests/utils/test_playwright_migration_working.py - 1
    • Semantic inconsistency in unavailable path · Line 35-86
Review Details
  • Files reviewed - 17 · Commit Range: a941b24..b49ee64
    • pyproject.toml
    • requirements/base.txt
    • requirements/development.txt
    • superset/config.py
    • superset/mcp_service/screenshot/pooled_screenshot.py
    • superset/mcp_service/screenshot/webdriver_pool.py
    • superset/tasks/cache.py
    • superset/utils/machine_auth.py
    • superset/utils/screenshots.py
    • superset/utils/webdriver.py
    • tests/integration_tests/thumbnails_tests.py
    • tests/integration_tests/utils/machine_auth_tests.py
    • tests/unit_tests/mcp_service/test_pooled_screenshot.py
    • tests/unit_tests/tasks/test_cache.py
    • tests/unit_tests/utils/screenshot_test.py
    • tests/unit_tests/utils/test_playwright_migration_working.py
    • tests/unit_tests/utils/webdriver_test.py
  • Files skipped - 2
    • UPDATING.md - Reason: Filter setting
    • docs/static/feature-flags.json - Reason: Filter setting
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alert-reports Namespace | Anything related to the Alert & Reports feature doc Namespace | Anything related to documentation risk:breaking-change Issues or PRs that will introduce breaking changes size/XXL

Projects

Status: Work in Progress

Development

Successfully merging this pull request may close these issues.

3 participants