fitzee opened a new pull request, #44034:
URL: https://github.com/apache/superset/pull/44034

   ### SUMMARY
   
   Hardens scheduled report screenshot validation after a real blank PDF 
bypassed the existing exact-color heuristic. The failed artifact contained two 
near-white regions (roughly 85% white and 15% light gray), so no single RGB 
value reached the existing 99.5% dominant-color threshold even though the page 
contained no meaningful dark content.
   
   This change:
   
   - augments exact-color detection with near-white coverage, luminance 
variance, and grayscale entropy;
   - emits validation metrics at INFO for every report capture attempt;
   - retries perceptually blank standard screenshots as well as tiled 
screenshots;
   - validates the final combined tiled image;
   - fails scheduled reports after repeated blank captures instead of retaining 
and delivering the last blank tile; and
   - preserves existing lenient behavior for non-report thumbnail captures.
   
   The thresholds distinguish the reproduced two-tone blank signature from 
sparse screenshots that contain genuine dark content.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable; backend screenshot validation and logging only.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest -q tests/unit_tests/utils/test_screenshot_utils.py 
tests/unit_tests/utils/webdriver_test.py::TestStandardScreenshotValidation
   ```
   
   The focused suite covers pure-white captures, two-tone near-white captures 
matching the observed failure signature, sparse valid content, retry recovery, 
fail-closed retry exhaustion, tiled captures, standard captures, combined-image 
validation, and unchanged non-report behavior.
   
   Also run changed-file pre-commit checks:
   
   ```bash
   git add superset/utils/screenshot_utils.py superset/utils/webdriver.py 
tests/unit_tests/utils/test_screenshot_utils.py 
tests/unit_tests/utils/webdriver_test.py
   pre-commit run
   ```
   
   Local result: 73 passed; all changed-file pre-commit hooks passed.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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


-- 
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]

Reply via email to