Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(alerts): execute query as report executor #22167

Merged
merged 3 commits into from
Nov 18, 2022

Conversation

villebro
Copy link
Member

SUMMARY

This is a continuation of #21931 which made it possible to execute reports as the object owners/creators etc. Unfortunately that PR didn't enable the same functionality for alerts, which were still being executed as the selenium user. This implements the same logic for alerts and adds integration tests to ensure alerts are executed as the correct user.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Merging #22167 (3d0dda3) into master (17c2bd8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #22167   +/-   ##
=======================================
  Coverage   66.99%   66.99%           
=======================================
  Files        1833     1833           
  Lines       69936    69938    +2     
  Branches     7572     7572           
=======================================
+ Hits        46855    46857    +2     
  Misses      21121    21121           
  Partials     1960     1960           
Flag Coverage Δ
hive 52.60% <50.00%> (-0.01%) ⬇️
mysql 78.13% <100.00%> (+0.01%) ⬆️
postgres 78.20% <100.00%> (+0.01%) ⬆️
presto 52.49% <50.00%> (-0.01%) ⬇️
python 81.39% <100.00%> (+<0.01%) ⬆️
sqlite 76.66% <100.00%> (+0.01%) ⬆️
unit 50.89% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/reports/commands/alert.py 96.66% <100.00%> (+0.07%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

owner_names: List[str],
creator_name: Optional[str],
config: List[ReportScheduleExecutor],
executor: Union[str, Exception],
Copy link
Member

Choose a reason for hiding this comment

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

nit: it may be easier to read if you rename this to expected_result makes more sense when condensing usernames and exceptions

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea! 👍

@villebro villebro merged commit c3f9f0b into apache:master Nov 18, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants