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

   ### SUMMARY
   `get_executor()` (used to pick who Alerts & Reports / thumbnails run as) 
resolved the creator, modifier, and editors of a report/dashboard without ever 
checking `User.is_active`. If the report's creator became inactive, execution 
would try to authenticate as that inactive user, and instead of raising a clear 
error it surfaced downstream as an opaque `ReportScheduleScreenshotFailedError` 
— even when the report had other, currently-active owners/editors.
   
   This fixes `get_executor` to skip inactive users at each resolution step 
(`CREATOR`, `MODIFIER`, `CREATOR_EDITOR`, `MODIFIER_EDITOR`, and within the 
`EDITOR` fallback chain: modifier → creator → direct user editor → indirect 
role/group editor), falling through to another active candidate instead of 
picking a dead-end user. `ExecutorNotFoundError` is now only raised once no 
active candidate remains.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A (backend logic fix)
   
   ### TESTING INSTRUCTIONS
   `pytest tests/unit_tests/tasks/test_utils.py -q`
   
   Added parametrized cases to `test_get_executor` that pin the bug: an 
inactive creator/modifier is skipped in favor of a fallback executor type or an 
active editor, and `ExecutorNotFoundError` is only raised when no active 
candidate exists at all. These new cases fail against the pre-fix code and pass 
after.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #33584
   - [ ] 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