-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Support Dynamic UI Alerts #54677
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
Support Dynamic UI Alerts #54677
Conversation
1fc2e95 to
b358eda
Compare
pierrejeambrun
left a comment
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.
I'm not sure of the use case you are trying to address here.
Also mutating the underlying list after startup would have the same effect.
I don't understand why we should recreate a new list on each config call.
Mutating the list is definitely possible. However, attempts to find a hook that that is invoked at any interval to affect such a mutation can't be found. Such an invocation would need to occur within the api-server process, or require communicating from some other thread. From what I could find, this was the simplest way to create this ability without over-engineering some other new api route, async loop or threaded solution. If you have suggestions, I will happily implement otherwise, provided it has the same outcome. As far as I can tell, mutating this list can only occur with physical code changes and service restarts. The use cases for such an iteration are numerous. In the case there are transient issues with a production environment, temporary alerts can be provided without requiring additional code merges and service restarts (both of which create the potential for additional risk and delay in alerting). Other cases include informing developers the state of GitOps processing of their merged code (current commit, build progress, etc) as processes are in progress. I suppose, in my mind, the nature of alerts should be short-lived and transient in nature. Having more runtime control over which alerts are displayed is very helpful in this regard. Also -- we have made use of this functionality in Airflow 2 for years and would love to continue using it in Airflow 3. |
|
Maybe add a comment above, to explain that this allows to override the value with an Iterable. Otherwise I'm affreaid someone might remove it. |
Will do! |
This is very good if we can do that! @pierrejeambrun The use case of such capability is for announcing something in large dag author deployments. For example: "We have issues with K8s cluster, task may be delayed no need to contact cluster admins". @codecae I think this feature needs some explanation in the UI alert docs about how to make it dynamic
|
b358eda to
9415506
Compare
Not that it really matters, but in Airflow 2, we've been successful at making them dynamic by subclassing Line 1070 in d9ed7b9
I'll try to come up with some simple doc updates to explain how to implement. |
pierrejeambrun
left a comment
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.
Glad to hear that this will serve users, I agree a small piece of documentation would be great!
|
@codecae any chance you can address the docs change soon? |
|
Absolutely! |
9415506 to
c97766a
Compare
|
Documentation updated |
504e6ca to
2464b58
Compare
|
Looks good to me, we need to fix the CI. And I would also remove the |
2464b58 to
2294543
Compare
|
labeling as bugfix because this was supported in AF2 and we probably don't want to wait for |
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- (cherry picked from commit 12a9d7b) Co-authored-by: codecae <codecae@users.noreply.github.com> Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- (cherry picked from commit 12a9d7b) Co-authored-by: codecae <codecae@users.noreply.github.com> Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- (cherry picked from commit 12a9d7b) Co-authored-by: codecae <codecae@users.noreply.github.com> Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
* feat: Dynamic UI Alerts * docs: updated ui customization docs to include dynamic alerts * docs: updated dynamic alerts documentation * fix: corrected whitespace in customize-ui.rst * fix: corrected whitespace in customize-ui.rst --------- Co-authored-by: Curtis Bangert <bangert.curtis+git@gmail.com>
UI Alerts are helpful for a variety of reasons, but in the current Airflow 3 implementation, they are strictly static for the entire lifetime of the webserver/api-server. Therefore, updates to UI alerts require code changes and special automation or manual rollouts/restarts when alerts must change.
This change simply updates the
get_configs()response to obtain alerts fromDASHBOARD_UIALERTSusing a list comprehension instead of simply returning theDASHBOARD_UIALERTSlist as a constant. This is actually legacy behavior from Airflow 2 that has become more rigid Airflow 3.This change allows for the ability define
DASHBOARD_UIALERTSas an iterator instead of simply a static list, allowing for dynamic updates of UI alerts upon refresh of the dashboard page. Given that a static list acts as a iterator, the existing behavior ofDASHBOARD_UIALERTSis not affected.For example, checkout this code and:
breeze start-airflow --python 3.11 --dev-modeEvery refresh should render a new set of fortune outputs at the top of the dashboard page in "info", "warning" and "error" formats.