Repository navigation
Add dry-run mode to teams sync - #72494
Conversation
b708a4f to
720a583
Compare
justinpakzad
left a comment
There was a problem hiding this comment.
Looks good to me. Left one comment
a7f2b18 to
972847f
Compare
justinpakzad
left a comment
There was a problem hiding this comment.
Looks good, thanks.
potiuk
left a comment
There was a problem hiding this comment.
Thanks — computing teams_to_add / pools_to_add up front and then either reporting or applying them keeps the real sync path behaviour-identical, and the three tests each assert that nothing was written. Approving.
Small, non-blocking notes:
- The description says the sync command now reports default-pool creation separately from team creation, but the non-dry-run path still only prints
N teams added.; pool creation is only surfaced under--dry-run. Either add a matching line for the real sync or adjust the description. - The newsfragment isn't required —
AGENTS.mdreservesairflow-core/newsfragments/for major or breaking changes — keep or drop as you prefer. - #72036 (
teams inspect) just landed and touches the sameteam_command.py/cli_config.py, so I'm rebasing the branch to get a CI run against it before merge.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Airflow handles maintainer review:
contributing-docs/05_pull_requests.rst.
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
…t team pools derived from the DAG bundle configuration without writing to the metadata database. Add tests covering dry-run behavior for missing teams, missing default team pools, and no-op sync scenarios.
972847f to
12ab2e8
Compare
Description
This change adds a
--dry-runoption toairflow teams sync.The new dry-run mode reports the teams and default team pools that would be created from the DAG bundle configuration without writing anything to the metadata database. The sync command also reports default team pool creation separately from team creation, making the output clearer when existing teams are missing their default pools.
Rationale
airflow teams synccan create teams and default team pools from DAG bundle configuration. In managed or production deployments, operators may want to preview those changes before applying them. A dry-run mode makes the command safer to use in deployment workflows and gives users visibility into pending multi-team synchronization changes.Tests
Added unit tests verifying that:
test_team_sync_dry_run_reports_changes_without_writingconfirms dry-run reports pending teams/default pools without creating them.test_team_sync_dry_run_reports_missing_default_pool_without_writingconfirms dry-run reports a missing default pool for an existing team without creating it.test_team_sync_dry_run_reports_no_changesconfirms dry-run reports when there are no pending teams or default pools to synchronize.Backwards compatibility
Existing
airflow teams syncbehavior is unchanged unless the new--dry-runflag is provided.Was generative AI tooling used to co-author this PR?
Generated-by: [GPT 5.6] following the guidelines