Closed ashb closed 4 years ago
Screenshots of what this looks like in the UI:
The "Ignore this update" will only be visible to admins right now (technically anyone with the "can_dismiss on UpdateAvailableView" permission - which admins get automatically)
@ashb in general LGTM, tests would be nice to have :)
Now with bearest of minimal tests.
(Checks that the plugin loads, and that the template hackery I've added has worked)
Need to add some tests against the HTTP checker part then this is done.
~Oh and I need to change that message.~
The unit tests should probably be extneded, but good enough for now.
This plugin operates as follows:
It uses
functools.wraps
to "hook" in to various places in Airflow that don't have pre-existing hook points.This does mean that if those function names change in the future this will stop working.
It runs a thread in the scheduler process to make requests to the update server.
It hooks in to airflow.jobs.scheduler_job.SchedulerJob._execute_helper to start the thread.
Available updates are stored in the database for the UI to query
The UI display is done by customizing the
appbuilder.base_template
, as again, there aren't enough hook points to inject our front end code any other way. This needs AIRFLOW-6733 and AIRFLOW-6734 to work.This notice is shown for all (logged in) users, but the dismiss button is only visible for admins.
There aren't any tests right now :(