Skip to content

Stop airflow config update from writing a backup during dry-run - #70979

Draft
Eason09053360 wants to merge 1 commit into
apache:mainfrom
Eason09053360:fix-config-update-dry-run-backup
Draft

Stop airflow config update from writing a backup during dry-run#70979
Eason09053360 wants to merge 1 commit into
apache:mainfrom
Eason09053360:fix-config-update-dry-run-backup

Conversation

@Eason09053360

Copy link
Copy Markdown
Contributor

airflow config update without --fix is documented as a dry-run, but it created the airflow.cfg.bak backup unconditionally before the dry-run branch. That meant a pure-preview command mutated the filesystem, and when the config directory is not writable the command aborted with AirflowConfigException before printing anything — so the preview the user asked for was never shown.

The backup now happens only on the --fix path, next to the write it protects.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {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.

Without --fix the command is meant to be a pure preview, so it should
leave the filesystem alone. Creating the .bak unconditionally also made
the command abort before printing anything when the config directory is
not writable, hiding the very preview the user asked for.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant