[ 
https://issues.apache.org/jira/browse/AIRFLOW-5369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16932366#comment-16932366
 ] 

ASF subversion and git services commented on AIRFLOW-5369:
----------------------------------------------------------

Commit 37c5ca07dd4f07b00d2b8feff74b956b433f032f in airflow's branch 
refs/heads/v1-10-test from Jarek Potiuk
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=37c5ca0 ]

[AIRFLOW-5369] Adds interactivity to pre-commits (#5976)

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 857788e305bbefe4566a1988e2072a21c7aab319)


> Add interactivity to pre-commit image building
> ----------------------------------------------
>
>                 Key: AIRFLOW-5369
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5369
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: ci
>    Affects Versions: 2.0.0, 1.10.5
>            Reporter: Jarek Potiuk
>            Assignee: Jarek Potiuk
>            Priority: Major
>
> Currently when images are out-dated for pre-commit it just fails with message 
> how to re-run it with rebuild next time. Also when you already run 
> pre-commit, ^C does not work as expected - the main script is killed but the 
> docker images running the checks continue running in the background until 
> they finish. This is pretty annoying as killing such running docker 
> containers is not trivial and for pylint/mypy/flake we can run multiple 
> containers if we run it on many modified files. This is because wer are not 
> using dumb-init to run the checks.
>  
> This is discouraging a bit, so instead a bit of interactivity can be added:
> 1) If image gets out-dated a question is asked whether to rebuild it while 
> pre-commit is executed
> 2) If you run pre-commit directly you do not get asked for rebuild because 
> you can run multiple pre-commit scripts in parallel  (pre-commit does it) so 
> you should fail fast (with helpful instructions)
> 3) If you run pre-commit via breeze, it is optimised because only the image 
> that is actually needed is rebuilt (and question is asked then)
> 4) Additionally - you should be able to press ^C and kill all containers 
> running in the background as well as the main script. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to