Add team_name attribute to plugins for multi-team#69502
Conversation
First step for Plugin team awareness. This adds a team_name attribute to AirflowPlugin so a plugin can be scoped to a team, exposes it through the plugins API, and filters the /api/v2/plugins listing so users only see global plugins and plugins for teams they are authorized for when multi-team mode is enabled. The API server also validates at startup that every team-scoped plugin references an existing team.
| return _get_plugins()[1] | ||
|
|
||
|
|
||
| def validate_plugin_teams() -> None: |
There was a problem hiding this comment.
I am only wondering if this is necessary to be honest. The person managing the environment might not be the same as the one managing the plugins? If a team gets deleted (I know, rare event), then all the plugins mentioning this team must be updated as well. In the API server we had this check and some users were complaining about it, thus we converted to warning instead of exception because it is too aggressive
There was a problem hiding this comment.
Hmm interesting, is this any different than all the other checks we do in the Scheduler and Dag Processor for team existence?
Also the plugins are installed by the global admin and teams are created by them as well, so I think on that front it should be well synchronized.
There was a problem hiding this comment.
Alright :) Hard to know anyway so we can go with that and adjust if needed
There was a problem hiding this comment.
Sounds good, let's proceed with the most cautious approach and then we can roll it back from there if users are not liking it!
First step for Plugin team awareness. This adds a team_name attribute to AirflowPlugin so a plugin can be scoped to a team, exposes it through the plugins API, and filters the /api/v2/plugins listing so users only see global plugins and plugins for teams they are authorized for when multi-team mode is enabled. The API server also validates at startup that every team-scoped plugin references an existing team.
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.