Skip to content

Conversation

@jason810496
Copy link
Member

Depends on: #46544

related: #46517
related discussion: #46544 (comment)

Why

In the 3.0.0a1 release, some configurations have not yet been migrated or deprecated in the default configuration.

How

To prevent this from happening, add a pre-commit hook with airflow config lint.


^ 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.rst or {issue_number}.significant.rst, in newsfragments.

@jason810496 jason810496 force-pushed the ci/add-pre-commit-check-for-default-configuration branch 3 times, most recently from 18c2442 to 21d4972 Compare February 13, 2025 07:01
@Lee-W Lee-W self-requested a review February 13, 2025 07:05
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

mostly good

@jason810496 jason810496 force-pushed the ci/add-pre-commit-check-for-default-configuration branch from 21d4972 to e53bad4 Compare February 17, 2025 01:31
@Lee-W Lee-W merged commit 37464de into apache:main Feb 17, 2025
91 checks passed
potiuk added a commit to potiuk/airflow that referenced this pull request Feb 17, 2025
The check-default-configuration pre-commit added in apache#46622 is slow
and it's not necessary to be run always - only when configuration
definition changes. Also it does not really take any files from changed
PR as input, so it should be configured to not pass the files to it and
to not run parallel instances - because when run with `--all-files`
it will run as many parallel copies of it as many processors you have
and they will essentially run the same check.

Also this pre-commit requires breeze image to be present so it should
be addded at the end of pre-commit files, so that is not run when
breeze image is not built.

All this behaviours have been fixed in this PR. After this change:

* only one copy of the check is run when this pre-commit runs
* in local pre-commit will only be run if config.yml changes
* in canary runs it will always run (with --all-files)
* it is marked as "breeze image" tests by placing it at the end
  of pre-commit configuration file
potiuk added a commit that referenced this pull request Feb 17, 2025
The check-default-configuration pre-commit added in #46622 is slow
and it's not necessary to be run always - only when configuration
definition changes. Also it does not really take any files from changed
PR as input, so it should be configured to not pass the files to it and
to not run parallel instances - because when run with `--all-files`
it will run as many parallel copies of it as many processors you have
and they will essentially run the same check.

Also this pre-commit requires breeze image to be present so it should
be addded at the end of pre-commit files, so that is not run when
breeze image is not built.

All this behaviours have been fixed in this PR. After this change:

* only one copy of the check is run when this pre-commit runs
* in local pre-commit will only be run if config.yml changes
* in canary runs it will always run (with --all-files)
* it is marked as "breeze image" tests by placing it at the end
  of pre-commit configuration file
dantonbertuol pushed a commit to dantonbertuol/airflow that referenced this pull request Feb 17, 2025
* Add pre-commit check for default configuration

* Refactor: lint from default config list with tempdir

* Move check_default_configuration to in_container

* Fix nits

* Remane cmd as list_default_config_cmd, lint_config_cmd
dantonbertuol pushed a commit to dantonbertuol/airflow that referenced this pull request Feb 17, 2025
The check-default-configuration pre-commit added in apache#46622 is slow
and it's not necessary to be run always - only when configuration
definition changes. Also it does not really take any files from changed
PR as input, so it should be configured to not pass the files to it and
to not run parallel instances - because when run with `--all-files`
it will run as many parallel copies of it as many processors you have
and they will essentially run the same check.

Also this pre-commit requires breeze image to be present so it should
be addded at the end of pre-commit files, so that is not run when
breeze image is not built.

All this behaviours have been fixed in this PR. After this change:

* only one copy of the check is run when this pre-commit runs
* in local pre-commit will only be run if config.yml changes
* in canary runs it will always run (with --all-files)
* it is marked as "breeze image" tests by placing it at the end
  of pre-commit configuration file
ntr pushed a commit to ntr/airflow that referenced this pull request Feb 20, 2025
* Add pre-commit check for default configuration

* Refactor: lint from default config list with tempdir

* Move check_default_configuration to in_container

* Fix nits

* Remane cmd as list_default_config_cmd, lint_config_cmd
ntr pushed a commit to ntr/airflow that referenced this pull request Feb 20, 2025
The check-default-configuration pre-commit added in apache#46622 is slow
and it's not necessary to be run always - only when configuration
definition changes. Also it does not really take any files from changed
PR as input, so it should be configured to not pass the files to it and
to not run parallel instances - because when run with `--all-files`
it will run as many parallel copies of it as many processors you have
and they will essentially run the same check.

Also this pre-commit requires breeze image to be present so it should
be addded at the end of pre-commit files, so that is not run when
breeze image is not built.

All this behaviours have been fixed in this PR. After this change:

* only one copy of the check is run when this pre-commit runs
* in local pre-commit will only be run if config.yml changes
* in canary runs it will always run (with --all-files)
* it is marked as "breeze image" tests by placing it at the end
  of pre-commit configuration file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants