You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "fitzee (via GitHub)" <gi...@apache.org> on 2026/09/12 06:09:54 UTC

[PR] fix(reports): fail closed after capture rejection [superset]

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

   ## TL;DR
   
   - Prevents scheduled PDF/PNG delivery after any terminal capture validation rejection.
   - Covers standard, tiled, and combined captures for both reports and alerts with rendered attachments.
   - Keeps successful in-budget recapture and text-only failure notifications working; thumbnail behavior remains permissive but uses distinct log event names.
   
   ## Why
   
   A tiled report could classify its final combined image as perceptually blank, log `report_capture_blank_combined_retained`, and still return the image for PDF/PNG delivery. Capture exceptions normally stopped delivery, but there was no durable execution-level rejection state or independent notification-boundary guard. This meant a permissive or accidentally swallowed capture path could violate the intended fail-closed behavior.
   
   The required invariant is: once a scheduled rendered capture is terminally rejected, no PDF or PNG from that execution may be delivered through any recipient path. Individual retry attempts remain recoverable; rejection becomes terminal only after capture retries are exhausted or the final combined image is invalid.
   
   ## What
   
   Terminal blank classifications are recorded as sticky rejection reasons on the report execution context. Persistently blank standard captures, individual tiles, and final combined images record the rejection and raise. Both the multi-recipient dispatcher and the individual notification sender enforce the same delivery gate, and rendered artifacts without a capture context fail closed. Text-only failure notifications remain deliverable. Thumbnail-only retained-tile logging is renamed to `thumbnail_capture_*` to distinguish it from scheduled delivery.
   
   ## Blast radius
   
   This affects scheduled PDF and PNG attachments generated by Alerts & Reports, including alerts using `ALERTS_ATTACH_REPORTS`. It does not change CSV/XLSX delivery, text alerts, UI/API PDF export, thumbnail permissiveness, schemas, authentication, RLS, or tenant isolation.
   
   ## How to test
   
   Regression coverage proves:
   
   - persistently blank standard captures record terminal rejection and raise;
   - persistently blank report tiles record terminal rejection and never combine;
   - perceptually blank combined report images raise instead of being retained;
   - report and alert PNG/PDF delivery is blocked after rejection;
   - rendered delivery without a capture context is blocked;
   - a direct notification call cannot bypass the gate;
   - text-only failure notifications remain allowed;
   - permissive thumbnail events use a thumbnail-specific name.
   
   Local verification:
   
   ```text
   327 passed, 1 skipped
   pre-commit: all applicable hooks passed, including MyPy, Ruff, Ruff format, and Pylint
   ```
   
   ## Risk & rollback
   
   The deliberate risk is additional failed report executions when final output is suspicious or capture provenance is missing. This is preferable to silently delivering a known-invalid artifact. Legitimate terminal empty-state tiles retain their existing state-aware exemption. There are no migrations or persistent-format changes; rollback is a normal commit revert.
   
   ## Screenshots
   
   No UI changes.
   
   ## Review guidance
   
   Please start with the final combined-image rejection in `superset/utils/screenshot_utils.py`, then the sticky context state in `superset/utils/report_execution.py`, and finally the two notification-boundary checks in `superset/commands/report/execute.py`. The most important review question is whether any scheduled rendered delivery path can construct or send an attachment without passing these gates.
   
   ## SUMMARY
   
   Enforces a fail-closed invariant for scheduled rendered reports: terminally rejected capture output cannot be delivered as PDF or PNG through report or attached-alert paths.
   
   ## BEFORE/AFTER
   
   Before: a perceptually blank final combined tiled image could be logged and returned for delivery. A swallowed capture rejection had no durable state checked at notification time. Magnified thumbnail logs could also be mistaken for report delivery events.
   
   After: terminal rejection is sticky for the execution; blank combined report output raises; notification dispatch refuses rejected or context-free rendered artifacts; thumbnail retained-tile events are clearly separated.
   
   ## TESTING INSTRUCTIONS
   
   Run:
   
   ```bash
   pytest -q tests/unit_tests/utils/test_report_execution.py tests/unit_tests/utils/test_screenshot_utils.py tests/unit_tests/utils/webdriver_test.py tests/unit_tests/commands/report/execute_test.py
   uvx pre-commit run --files UPDATING.md docs/admin_docs/configuration/alerts-reports.mdx superset/commands/report/execute.py superset/utils/report_execution.py superset/utils/screenshot_utils.py superset/utils/webdriver.py tests/unit_tests/commands/report/execute_test.py tests/unit_tests/utils/test_report_execution.py tests/unit_tests/utils/test_screenshot_utils.py tests/unit_tests/utils/webdriver_test.py
   ```
   
   ## ADDITIONAL INFORMATION
   
   - [ ] Relevant busets आयोज YenSED?
   - [ ] Bug fix: user-facing issue
   - [ ] New feature
   - [ ] UI change
   - [ ] Documentation change
   - [ ] Database migration
   - [ ] Dependency update


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): fail closed after capture rejection [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi merged PR #44191:
URL: https://github.com/apache/superset/pull/44191


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): fail closed after capture rejection [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44191:
URL: https://github.com/apache/superset/pull/44191#issuecomment-5645048830

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers an incremental AI Review.
   - `/review full` - 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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): fail closed after capture rejection [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44191:
URL: https://github.com/apache/superset/pull/44191#issuecomment-5644124158

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44191?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `29.16667%` with `17 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 57.44%. Comparing base ([`3e7bdec`](https://app.codecov.io/gh/apache/superset/commit/3e7bdec53bb7830b524a4b2b53478332b00d9c72?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a519f8e`](https://app.codecov.io/gh/apache/superset/commit/a519f8e1cdc0ed4e188052f52729b2ba4c1c30e6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/44191?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/commands/report/execute.py](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&filepath=superset%2Fcommands%2Freport%2Fexecute.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbWFuZHMvcmVwb3J0L2V4ZWN1dGUucHk=) | 9.09% | [10 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/utils/report\_execution.py](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&filepath=superset%2Futils%2Freport_execution.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdXRpbHMvcmVwb3J0X2V4ZWN1dGlvbi5weQ==) | 66.66% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/utils/screenshot\_utils.py](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&filepath=superset%2Futils%2Fscreenshot_utils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdXRpbHMvc2NyZWVuc2hvdF91dGlscy5weQ==) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/utils/webdriver.py](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&filepath=superset%2Futils%2Fwebdriver.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdXRpbHMvd2ViZHJpdmVyLnB5) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (3e7bdec) and HEAD (a519f8e). Click for more details.
   > 
   > <details><summary>HEAD has 33 uploads less than BASE</summary>
   >
   >| Flag | BASE (3e7bdec) | HEAD (a519f8e) |
   >|------|------|------|
   >|python|27|2|
   >|presto|5|1|
   >|hive|5|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #44191       +/-   ##
   ===========================================
   - Coverage   80.16%   57.44%   -22.72%     
   ===========================================
     Files        2925     2925               
     Lines      172563   172587       +24     
     Branches    40058    40060        +2     
   ===========================================
   - Hits       138339    99149    -39190     
   - Misses      31627    72506    +40879     
   + Partials     2597      932     -1665     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `37.33% <29.16%> (-0.01%)` | :arrow_down: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.22% <29.16%> (-0.01%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.27% <29.16%> (-45.28%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/44191/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44191?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): fail closed after capture rejection [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #44191:
URL: https://github.com/apache/superset/pull/44191#issuecomment-5644108608

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | a519f8e1cdc0ed4e188052f52729b2ba4c1c30e6 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6aa4ecb3de165800081070d9 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-44191--superset-docs-preview.netlify.app](https://deploy-preview-44191--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQ0MTkxLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.gS-PZYHfq_G48sQqY8ns7re0WzvNXWQLmU-VIsrr-SM)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DctLDkBADADQu3RNVPzdwDGqrZAMM5nPAnF3s3ub94Lz9nQRZoACVk8X79nbER_VaqPDlGxsUCkD7yrJZDG5mLyGHESdsfciufRErfLaiNZ9NyLiWOOAMsH3Aw) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-44191--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): fail closed after capture rejection [superset]

Posted by "fitzee (via GitHub)" <gi...@apache.org>.
fitzee commented on PR #44191:
URL: https://github.com/apache/superset/pull/44191#issuecomment-5671448568

   Addressed the sparse-dashboard false positive in 921b2cde7f. Combined-image validation now rechecks the corresponding content-bearing tile regions rather than classifying the full composite, so permitted empty-state tiles cannot dilute valid sparse content. A real-combiner regression test covers one sparse content tile plus seven empty tiles, while the existing corruption test still proves that lost content fails closed. I also replaced invalid `b"combined"` mocks with real PNGs, used `capture_was_rejected` in the gate, and corrected the thumbnail log documentation. Validation: 328 passed, 1 skipped; pinned Ruff/MyPy passed; Superset Pylint plugin 10/10.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): fail closed after capture rejection [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44191:
URL: https://github.com/apache/superset/pull/44191#issuecomment-5644097458

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): fail closed after capture rejection [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44191:
URL: https://github.com/apache/superset/pull/44191#issuecomment-5673111319

   **Bito Automatic Review Skipped – PR Already Merged**<br/><br/>Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.<br/>No action is needed if you didn't intend to review it. To get a review, you can type `/review` in a comment and save it


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org