Skip to content

Commit

Permalink
Initialize plugins for cli appbuilder (#30934)
Browse files Browse the repository at this point in the history
Plugins can provide things that need to be initialized before we can use
the slim appbuilder for cli actions. For example, plugins can add menu items,
which need to be loaded for sync-perm to do everything it needs to do.

(cherry picked from commit 3560b92)
  • Loading branch information
jedcunningham authored and ephraimbuddy committed Apr 28, 2023
1 parent 82548ba commit e2e8f12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/utils/cli_app_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
from flask import Flask

from airflow.www.extensions.init_appbuilder import AirflowAppBuilder, init_appbuilder
from airflow.www.extensions.init_views import init_plugins


@lru_cache(maxsize=None)
def _return_appbuilder(app: Flask) -> AirflowAppBuilder:
"""Returns an appbuilder instance for the given app"""
return init_appbuilder(app)
init_appbuilder(app)
init_plugins(app)
return app.appbuilder # type: ignore[attr-defined]


@contextmanager
Expand Down

0 comments on commit e2e8f12

Please sign in to comment.