Repository navigation
Scope plugin macros to their team in multi-team mode - #73224
Merged
o-nikolas merged 1 commit intoSep 22, 2026
Merged
Conversation
vincbeck
reviewed
Sep 16, 2026
o-nikolas
force-pushed
the
onikolas/multi-team-plugins/macro-scoping
branch
from
September 18, 2026 02:31
6ff3bb2 to
e8ff1c6
Compare
A team-scoped plugin's macros were reachable from every task's templates, so any team could call macros written to talk to another team's systems. The worker decides this from a new ``multi_team`` flag on the run context rather than from its own config, which is not guaranteed to match the scheduler's (misconfigured or intentional attempt to read macros from other teams): reading it as disabled while it is in fact enabled would drop scoping and apply a team's macros everywhere. The existing ``team_name`` cannot carry that signal, being ``None`` both for a teamless task and for every task when multi-team is off, so a plugin declaring a team would otherwise lose its macros in single-team deployments. Scoping is applied at attribute access rather than when macros are loaded, because the loader mutates a process-wide module and a worker process can serve tasks from more than one team.
vincbeck
approved these changes
Sep 21, 2026
o-nikolas
force-pushed
the
onikolas/multi-team-plugins/macro-scoping
branch
from
September 21, 2026 21:51
e8ff1c6 to
5d30dfc
Compare
This was referenced Sep 30, 2026
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A team-scoped plugin's macros were reachable from every task's templates, so any team could call macros written to talk to another team's systems.
The worker decides this from a new
multi_teamflag on the run context rather than from its own config, which is not guaranteed to match the scheduler's (misconfigured or intentional attempt to read macros from other teams): reading it as disabled while it is in fact enabled would drop scoping and apply a team's macros everywhere. The existingteam_namecannot carry that signal, beingNoneboth for a teamless task and for every task when multi-team is off, so a plugin declaring a team would otherwise lose its macros in single-team deployments.Scoping is applied at attribute access rather than when macros are loaded, because the loader mutates a process-wide module and a worker process can serve tasks from more than one 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.