fix: cache warmup unable to login (#9597, #18933)
SUMMARY
Currently cache warmup feature is unusable due to #9597 & #18933 This implement intend to fix it by following changes:
- Use security_manager.find_user to find a user credential
- Use WebDriverProxy to perform warmups
- In Superset, front-end tend to send multiple api with complex filter and many options, which is difficult to replay via simple request apis. In order to reduce the probability to cache the wrong slices or with wrong parameters, we use web driver to simulate a user's real behavior.
- Refine WebDriverProxy to support multiple operations without re-initialize web driver
- Cache toward dashboard instead of slices, because slices cache aren't always able to use in dashboards
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
- [x] 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 Report
Merging #20387 (42b11f6) into master (ccba5b2) will decrease coverage by
0.01%. The diff coverage is78.57%.
@@ Coverage Diff @@
## master #20387 +/- ##
==========================================
- Coverage 66.70% 66.69% -0.02%
==========================================
Files 1739 1739
Lines 65137 65121 -16
Branches 6897 6897
==========================================
- Hits 43452 43433 -19
- Misses 19932 19935 +3
Partials 1753 1753
| Flag | Coverage Δ | |
|---|---|---|
| hive | 53.72% <30.95%> (+0.02%) |
:arrow_up: |
| mysql | 82.27% <78.57%> (-0.02%) |
:arrow_down: |
| postgres | 82.34% <78.57%> (-0.02%) |
:arrow_down: |
| presto | 53.58% <30.95%> (+0.02%) |
:arrow_up: |
| python | 82.76% <78.57%> (-0.02%) |
:arrow_down: |
| sqlite | 82.07% <78.57%> (-0.02%) |
:arrow_down: |
| unit | 50.19% <23.80%> (+0.03%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| superset/utils/screenshots.py | 48.24% <25.00%> (ø) |
|
| superset/tasks/cache.py | 63.63% <54.54%> (-10.28%) |
:arrow_down: |
| superset/utils/webdriver.py | 79.79% <96.15%> (+1.14%) |
:arrow_up: |
| superset/config.py | 91.44% <100.00%> (+0.02%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
I'm going to mention maintainers randomly due to pending reviews. Any feedback is welcome. @kgabryje @diegomedina248
Closed because of #21076
https://github.com/apache/superset/pull/21076#issuecomment-1239851199 re-open because of this comment. Oops. :P
Some one please when this fix will be released?
Wow, sorry this slid under so many people's radar for so long. This PR is in need of a rebase if you're still willing to do that, but I'll add some reviewers for good measure in case anyone is able/willing to assess the situation and carry any necessary work forward.