Update airflow config update to show breaking config changes by default#49223
Conversation
dc93d38 to
29968a7
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Airflow configuration update command to show only breaking configuration changes by default in dry-run mode and introduces new CLI arguments to optionally apply and include all recommendations.
- Change default behavior of airflow config update to display only breaking changes in dry-run mode.
- Introduce new CLI arguments (--fix and --all-recommendations) to control application of configuration changes.
- Update tests and documentation strings to reflect the revised behavior.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| airflow-core/tests/unit/cli/commands/test_config_command.py | Updates tests to check for dry-run messages and configuration backup, but uses an incorrect CLI flag. |
| airflow-core/src/airflow/cli/commands/config_command.py | Refactors configuration change message formatting and enhances the update_config command to include new flags. |
| airflow-core/src/airflow/cli/cli_config.py | Adds definitions for new CLI parameters (--fix and --all-recommendations) for the config update command. |
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
airflow-core/src/airflow/cli/commands/config_command.py:837
- The flag '--all-recommendation' is inconsistent with the '--all-recommendations' defined in cli_config.py. Consider standardizing the flag name to avoid confusion.
--all-recommendation: flag (optional)
04a1a07 to
1e1cda6
Compare
1e1cda6 to
ee12908
Compare
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
airflow-core/src/airflow/cli/commands/config_command.py:983
- [nitpick] Consider revising the message 'Dry-run is mode enabled.' to 'Dry-run mode enabled.' to improve clarity.
console.print("[blue]Dry-run is mode enabled. To apply above airflow.cfg run the command with `--fix`.[/blue]")
ee12908 to
21fe3e7
Compare
00a7ace to
1bb9c12
Compare
217f681 to
80b6009
Compare
Lee-W
left a comment
There was a problem hiding this comment.
I think we also cover some of the rules in newsfragments in this PR. Could you please also update the corresponding newsfragments?
You can list the rule todos through uv run scripts/ci/pre_commit/significant_newsfragments_checker.py
Thanks!
80b6009 to
3d50ac8
Compare
db8e993 to
3c15b64
Compare
8ad27e7 to
ef9f94c
Compare
airflow.cfgin Airflow 2. x usually has 2000+ lines of configs. Users typically want to change only the configurations causing issues in airflow migrations rather than dealing with a long list of config changes they may not fully understand.This PR refines the
airflow config updateto better serve users upgrading to Airflow 3.0. Key changes include:Dry-Run by default (Breaking Changes Only):
The
airflow config updatecommand now defaults to a dry run (same as--dry-run) and displays only the breaking configuration changes. This avoids overwhelming users with recommended but non-critical changes. The breaking changes here are the configs causing errors/ warnings / deprecations.New CLI Arguments:
--fix: Applies the breaking changes instead of a dry run.--all-recommendations: When used with either--dry-runor--fix, it includes all recommended changes (i.e., non-breaking ones) in addition to breaking ones.CLI Command Argument:
I tested it default airflow.cfg from Airflow 2.10.5:

I tested it default airflow.cfg from Airflow 2.10.5:

I tested it default airflow.cfg from Airflow 2.10.5:

Apply all recommended changes (both breaking and non-breaking):
Update only specific sections (e.g.
coreanddatabase):Update only specific options (e.g.
sql_alchemy_connanddag_concurrency):Ignore a specific section (e.g.
webserver):Ignore specific options (e.g.
smtp_userandsession_lifetime_days):Breaking config changes
closes: #49202
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.