-
Notifications
You must be signed in to change notification settings - Fork 14k
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
chore: Migrate warm up cache endpoint to api v1 #23853
chore: Migrate warm up cache endpoint to api v1 #23853
Conversation
Codecov Report
@@ Coverage Diff @@
## master #23853 +/- ##
==========================================
+ Coverage 68.91% 69.01% +0.10%
==========================================
Files 1899 1901 +2
Lines 73843 73969 +126
Branches 8119 8119
==========================================
+ Hits 50892 51053 +161
+ Misses 20840 20805 -35
Partials 2111 2111
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Can you add the following line on UPDATING.md
- [22809](https://github.com/apache/superset/pull/23853): Migrated endpoint `/superset/warm_up_cache` to `/api/v1/cachekey/warm_up_cache/`. Corresponding permissions are `can warm_up_cache on Superset` to `can warm_up_cache on cachekey`. Make sure you add/replace the necessary permissions on any custom roles you may have.
Moved to api/v1/chart |
"table_name": "energy_usage", | ||
"db_name": get_example_database().database_name, | ||
}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems weird to be warming up cache for a dataset on /api/v1/chart/...
. The idea would be to create a new endpoint on dataset's and perhaps use the same Command, or split it your call. the PUT payload would be restricted to it's resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll defer to @john-bodley since he has more context here
req = request.Request(url, headers=headers) | ||
baseurl = "{WEBDRIVER_BASEURL}".format(**app.config) | ||
url = f"{baseurl}api/v1/chart/warm_up_cache" | ||
logger.info("Fetching %s with payload %s", url, data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: checked that data contains the get_payload
that only contains chart_id
and dashboard_id
so it's probably safe to log, but I would just remove it from the logs, it can also generate a huge log entry
SUMMARY
This PR deprecates the
superset/warm_up_cache
endpoint and creates theapi/v1/charts/warm_up_cache
andapi/v1/dataset/warm_up_cache
endpoints to replace it.The new endpoint has the following key differences:
PUT
instead ofGET
Also improves test coverage
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION