-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Speed-up check-default-configuration pre-commit #46821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed-up check-default-configuration pre-commit #46821
Conversation
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
|
cc @jason810496 also @Lee-W @jedcunningham -> we should be careful with adding new pre-commits. This small addition in pre-commit-config had almost all performance problems I could think of with pre-commits :D |
|
cc: @jason810496 --> You likely did not know that :) but:
Pre-commit relevant docs: https://pre-commit.com/#creating-new-hooks |
|
Thanks, @potiuk, for the explanation! Indeed, I'm not very familiar with |
|
Yeah. We have VERY complex and VERY comprehensive test harness and it has a few "you need to read a few pages few times and get burned once or twice to start to understand how things work" |
|
@potiuk Thanks for reminding us! Yep, I should have thought it through. 🤦♂️ |
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
I realise that only a handful of people including me live and breathe the CI and dev env of Airflow, so I will keep on reminding and explaining - no worries :) |
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
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-filesit 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:
^ 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 newsfragments.