Skip to content
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

Fix caching in CI for pre-commits #27368

Merged
merged 1 commit into from Oct 30, 2022
Merged

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Oct 29, 2022

For some time, caching in pre-commits was broken and some of the pre-commit installation was unnecessary. There were few missing or mis-sequenced steps when the CI cache was declered and it made regular PRs us a bit (1-2 minutes) longer time for pre-commit setup than it was needed. In case of image building, there is no need to setup all pre-commits because only one pre-commit is needed (update-generated dependencies) - instead we can simply install rich and yaml locally and run the pre-comit script directly.

This PR cleans it up.


^ 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.

@potiuk
Copy link
Member Author

potiuk commented Oct 29, 2022

This one shaves about 1m from every "build image" step. The images are build in most commits and there is usually "wait for images" step in the "Pull Request" workflow. This might seem small, but in fact it should make most of our workflow complete faster and - most importantly - block other jobs for quite a bit shorter time.

@potiuk
Copy link
Member Author

potiuk commented Oct 29, 2022

It's about 20-something seconds in fact for build images - but I think it's entirely worth it:

Before:

Screenshot 2022-10-29 at 21 20 26

After:

Screenshot 2022-10-29 at 21 20 00

Speeding up static checks is also cool but we will see if it works well only after we merge it.

@potiuk
Copy link
Member Author

potiuk commented Oct 29, 2022

There are cool follow-ups coming (#27369) so let's merge this one quick :)

For some time, caching in pre-commits was broken and some of the
pre-commit installation was unnecessary. There were few missing
or mis-sequenced steps when the CI cache was declered and it made
regular PRs us a bit (1-2 minutes) longer time for pre-commit
setup than it was needed. In case of image building, there is no
need to setup all pre-commits because only one pre-commit is
needed (update-generated dependencies) - instead we can simply
install rich and yaml locally and run the pre-comit script directly.

This PR cleans it up.
@potiuk potiuk force-pushed the fix-caching-for-static-checks-in-ci branch from 2ff835c to 8574f6f Compare October 30, 2022 02:12
@potiuk potiuk merged commit 62a870b into main Oct 30, 2022
@uranusjr uranusjr deleted the fix-caching-for-static-checks-in-ci branch October 30, 2022 06:02
ephraimbuddy pushed a commit that referenced this pull request Nov 10, 2022
For some time, caching in pre-commits was broken and some of the
pre-commit installation was unnecessary. There were few missing
or mis-sequenced steps when the CI cache was declered and it made
regular PRs us a bit (1-2 minutes) longer time for pre-commit
setup than it was needed. In case of image building, there is no
need to setup all pre-commits because only one pre-commit is
needed (update-generated dependencies) - instead we can simply
install rich and yaml locally and run the pre-comit script directly.

This PR cleans it up.

(cherry picked from commit 62a870b)
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Nov 11, 2022
@ephraimbuddy ephraimbuddy added this to the Airflow 2.4.3 milestone Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants