-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
[AIRFLOW-5369] Add interactivity to pre-commits #5976
[AIRFLOW-5369] Add interactivity to pre-commits #5976
Conversation
d7ede84
to
cfc4b54
Compare
This one is really useful if you have pre-commit installed and use it. It integrates well with breeze not only wit pre-commits - it will now let you answer y/n/q when pre-commit detects that the files need rebuilding. If you answer "no" it will run all tests in pre-commit using the old, previously built images (which in vast majority of cases will be ok). This is really useful for offline cases (now you can run all pre-commits in offline mode easily and when we also merge #5972 it will be really fast and no necessary rebuilds when you switch between branches and you will be able to use full power of consistent pre-commits without waiting too long for occasional image rebuilds. |
This one is more difficult/longer to review but I think it might help a lot with adoption and regular use of pre-commit. I myself started using --no-verify far too often, but after we merge #5972 and this one, it should be really smooth to use pre-commit daily (@mik-laj @nuclearpinguin can confirm that pre-commits are really great for daily routine I think). |
@potiuk Is there any way to break this into smaller PRs? There's just... a lot going on here... |
@dimberman . You are totally right! It started from interactivity but I added a number of other small fixes along the way and now it's too big /complex/has a lot of unrelated changes. I will break it. |
ab839e4
to
783e1f7
Compare
Hey @dimberman - I moved out the dumb-init change, and I tried to split it even further, but it seem what's left is totally related. I needed to make a bit more consistent behaviour when I ask interactively whether to rebuild the images. Now we have a really nice behaviour that there are no more failures when you have out-of-date images but it is all interactive. BTW. I am seriously thinking about adding unit tests for the bash scripts already ;). |
@mik-laj -> that also addresses your recent questions about rebuilding the images when you run pre-commit manually. I thought this change is already merged, but it was not. |
783e1f7
to
f8d04be
Compare
Codecov Report
@@ Coverage Diff @@
## master #5976 +/- ##
=========================================
- Coverage 80.03% 79.9% -0.14%
=========================================
Files 607 607
Lines 35019 35019
=========================================
- Hits 28029 27983 -46
- Misses 6990 7036 +46
Continue to review full report at Codecov.
|
959f47e
to
5be9342
Compare
Hey @dimberman -> it's still big but it adds really nice feature to pre-commits now. It's fully interactive now and when you need to rebuild an image, it will ask you - so that you can make decision. Just tested it and it is really nice to work with it. |
It would be great to get this merged before the workshop in Guadalahara :) |
Hey @dimberman :)? |
🙏 |
@potiuk Can you do rebase? |
This commit adds full interactivity to pre-commits. Whenever you run pre-commit and it detects that the image should be rebuild, an interactive question will pop up instead of failing the build and asking to rebuild with REBUILD=yes This is much nicer from the user perspective. You can choose whether to: 1) Rebuild the image (which will take some time) 2) Not rebuild the image (this will use the old image with hope it's OK) 3) Quit. Answer to that question is carried across all images needed to rebuild. There is the special "build" pre-commit hook that takes care about that. Note that this interactive question cannot be asked if you run only single pre-commit hook with Dockerfile because it can run multiple processes and you can start building in parallel. This is not desired so instead we fail such builds.
5be9342
to
46a22e7
Compare
This commit adds full interactivity to pre-commits. Whenever you run pre-commit and it detects that the image should be rebuild, an interactive question will pop up instead of failing the build and asking to rebuild with REBUILD=yes This is much nicer from the user perspective. You can choose whether to: 1) Rebuild the image (which will take some time) 2) Not rebuild the image (this will use the old image with hope it's OK) 3) Quit. Answer to that question is carried across all images needed to rebuild. There is the special "build" pre-commit hook that takes care about that. Note that this interactive question cannot be asked if you run only single pre-commit hook with Dockerfile because it can run multiple processes and you can start building in parallel. This is not desired so instead we fail such builds. (cherry picked from commit 857788e)
This commit adds full interactivity to pre-commits. Whenever you run pre-commit and it detects that the image should be rebuild, an interactive question will pop up instead of failing the build and asking to rebuild with REBUILD=yes This is much nicer from the user perspective. You can choose whether to: 1) Rebuild the image (which will take some time) 2) Not rebuild the image (this will use the old image with hope it's OK) 3) Quit. Answer to that question is carried across all images needed to rebuild. There is the special "build" pre-commit hook that takes care about that. Note that this interactive question cannot be asked if you run only single pre-commit hook with Dockerfile because it can run multiple processes and you can start building in parallel. This is not desired so instead we fail such builds. (cherry picked from commit 857788e)
Make sure you have checked all steps below.
Jira
This commit adds full interactivity to pre-commits. Whenever you run pre-commit
and it detects that the image should be rebuild, an interactive question will
pop up instead of failing the build and asking to rebuild with REBUILD=yes
This is much nicer from the user perspective. You can choose whether to:
1) Rebuild the image (which will take some time)
2) Not rebuild the image (this will use the old image with hope it's OK)
3) Quit.
Answer to that question is carried across all images needed to rebuild.
There is the special "build" pre-commit hook that takes care about that.
Note that this interactive question cannot be asked if you run only
single pre-commit hook with Dockerfile because it can run multiple processes
and you can start building in parallel. This is not desired so instead we fail
such builds.
Description
Tests
No tests for bash scripts (maybe we should add them eventually!)
Commits
Documentation
Code Quality
flake8