-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Rewrite Extensions registry not to depend on Flask app #3466
Comments
Please allow me to specify again why the backend extensions need the Flask app instance (at the moment) passed directly (and can't use
Some ideas how to solve this:
For some examples, feel free to check out https://github.com/mozilla/redash-stmo which contains a few extensions already, including examples that:
I would be extremely happy if we were not to break any of those features 😬 But I'm also happy to work on this if you'd like and make sure the extension API becomes rock solid. |
I should've elaborated more in the issue description... The idea here is not to prevent existing use cases, but to improve the code architecture. The registry not being coupled with Flask doesn't mean we can't use it with Flask, it just means we don't need Flask to make it work in Celery. Currently |
This separates the extension registry from the Flask app and also introduces a separate registry for preriodic tasks. Fix #3466.
This separates the extension registry from the Flask app and also introduces a separate registry for preriodic tasks. Fix #3466.
## What type of PR is this? (check all applicable) <!-- Please leave only what's applicable --> - [x] Refactor - [x] Bug Fix ## Description This basically makes sure that when import the redash package we don't accidentally trigger import-time side-effects such as requiring Redis. Refs #3569 and #3466.
This separates the extension registry from the Flask app and also introduces a separate registry for preriodic tasks. Fix #3466.
* Decouple extensions from Flask app. This separates the extension registry from the Flask app and also introduces a separate registry for preriodic tasks. Fix #3466. * Address review feedback. * Update redash/extensions.py Co-Authored-By: jezdez <[email protected]> * Minor comment in requirements. * Refactoring after getting feedback. * Uncoupled bin/bundle-extensions from Flas app instance. * Load bundles in bundle script and don’t rely on Flask. * Upgraded to importlib-metadata 0.9. * Add missing requirement. * Fix TypeError. * Added requirements for bundle_extension script. * Install bundles requirement file correctly. * Decouple bundle loading code from Redash. * Install bundle requirements from requirements.txt. * Use circleci/node for build-docker-image step, too.
…ash#3601) ## What type of PR is this? (check all applicable) <!-- Please leave only what's applicable --> - [x] Refactor - [x] Bug Fix ## Description This basically makes sure that when import the redash package we don't accidentally trigger import-time side-effects such as requiring Redis. Refs getredash#3569 and getredash#3466.
* Decouple extensions from Flask app. This separates the extension registry from the Flask app and also introduces a separate registry for preriodic tasks. Fix getredash#3466. * Address review feedback. * Update redash/extensions.py Co-Authored-By: jezdez <[email protected]> * Minor comment in requirements. * Refactoring after getting feedback. * Uncoupled bin/bundle-extensions from Flas app instance. * Load bundles in bundle script and don’t rely on Flask. * Upgraded to importlib-metadata 0.9. * Add missing requirement. * Fix TypeError. * Added requirements for bundle_extension script. * Install bundles requirement file correctly. * Decouple bundle loading code from Redash. * Install bundle requirements from requirements.txt. * Use circleci/node for build-docker-image step, too.
add_periodic_tasks
(disabled in Make sure Flask app created in Celery's worker process #3465)The text was updated successfully, but these errors were encountered: