Skip to content

Conversation

@steveahnahn
Copy link
Contributor

Followup

New CLI commands can be added to airflowctl/api/operations.py without corresponding integration test coverage that can lead to a drift in untested commands.

Solution

Add a pre-commit hook that statically analyzes all test-able CLI commands to be included in test coverage. The hook fails if any command is missing coverage and not explicitly listed in the excluded commands list
Stats:

  • 55 total CLI commands
  • 38 tested in integration tests
  • 29 excluded with documented reasons (assets require state, backfill requires IDs, destructive operations, etc.)

Related Issues

Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks, Steve! One comment related to assets, what is the blocker for those?

@steveahnahn
Copy link
Contributor Author

Thanks, just added the fix and went through the logs of the commands again, assets materialize fails with id=1 I believe due to collision with asset id 1. I've ended up adding and removing more commands that were either silently failing or passed when tested. An improvement to the integration tests will give us better accuracy in the future imo.

@potiuk
Copy link
Member

potiuk commented Nov 30, 2025

Still some issues :)

@potiuk potiuk merged commit 80ca9f5 into apache:main Nov 30, 2025
58 checks passed
@github-actions
Copy link

Backport failed to create: v3-1-test. View the failure log Run details

Status Branch Result
v3-1-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 80ca9f5 v3-1-test

This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Dec 3, 2025
* pre-commit adds airflowctl int check

* cleanup

* remove asset materialize & others

* dags update param, mege conflict, cicd error
@bugraoz93
Copy link
Contributor

Amazing, thanks Steve!

Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
* pre-commit adds airflowctl int check

* cleanup

* remove asset materialize & others

* dags update param, mege conflict, cicd error
itayweb pushed a commit to itayweb/airflow that referenced this pull request Dec 6, 2025
* pre-commit adds airflowctl int check

* cleanup

* remove asset materialize & others

* dags update param, mege conflict, cicd error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a pre-commit hook to check that airflowctl commands exist in integration tests

3 participants