Add airflow dags stability check CLI command#70446
Open
202201142 wants to merge 4 commits into
Open
Conversation
202201142
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
July 25, 2026 17:09
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new airflow dags stability CLI subcommand intended to detect unstable Dag serialization across repeated parses (a potential contributor to dag_version inflation). It wires the command into the CLI configuration, adds unit tests to validate pass/fail behavior, and updates the FAQ to mention the new workflow option.
Changes:
- Add
dag_stability_checkimplementation that parses Dags twice and reports differing serialization via unified diffs. - Register a new
airflow dags stability [dag_folder]command and--fail-fastflag in the CLI. - Add unit tests covering stable/unstable Dags and missing
--dag-idhandling, plus a small FAQ update.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| airflow-core/src/airflow/cli/commands/dag_command.py | Implements Dag stability check helpers and the new CLI action. |
| airflow-core/src/airflow/cli/cli_config.py | Adds CLI args and registers the new dags stability command. |
| airflow-core/tests/unit/cli/commands/test_dag_command.py | Adds unit tests validating stability check success/failure behavior. |
| airflow-core/docs/faq.rst | Mentions the new CLI command as an additional way to catch Dag version inflation issues. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Add a new CLI command to detect non-deterministic DAG serialization by parsing and serializing DAGs twice and comparing the resulting hashes.
Non-deterministic DAG definitions can cause unnecessary
dag_versionchanges, making deployments and code reviews harder. This command helps identify such DAGs and can be used in CI/CD to catch serialization instability before merging.If the serialized hash differs between parses for the DAG, the command reports the differences between the serialized representations and exits with status code
1.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.