Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Jarek Potiuk 649ce4ba9d
Implement Google Shell Conventions for breeze script (#10695)
* Implement Google Shell Conventions for breeze script … (#10651)

Part of #10576

First (and the biggest of the series of commits to introduce
Google Shell Conventions in our bash scripts.

This is about the biggest and the most complex breeze script
so it is rather huge but it is difficult to split it into
smaller pieces.

The rules implemented (from the conventions):

 * constants and exported variables are CAPITALIZED, where
   local/temporary variables are lowercase

 * following the shell guide, once all the variables are set to their
   final values (either from exported variables, calculation or --switches
   ) I have a single function that makes all the variables read-only. That
   helped to clean-up a lot of places where same functions was called
   several times, or where variables were defined in a few places. Now the
   behavior should be rather consistent and we should easily catch some
   duplications

 * function headers (following the guide) explaining arguments,
   variables expected, variables modified in the functions used.

 * setting the variables as read-only also helped to clean-up the "ifs"
   where we often had ":=}" in variables and != "" or == "". Those are
   replaced with `=}` and tests are replaced with `-n` and `-z` - also
   following the shell guide (readonly helped to detect and clean all
   such cases). This also should be much more robust in the future.

 * reorganized initialization of those constants and variables - simplified
   a few places where initialization was overlapping. It should be much more
   straightforward and clean now

 * a number of internal function breeze variables are "local" - this is
   helpful in accidental variables overwriting and keeping stuff localized

 * trap_add function is separated out to help in cases where we had
   several traps handling the same signals.

(cherry picked from commit 46c8d6714c)
(cherry picked from commit c822fd7b4bf2a9c5a9bb3c6e783cbea9dac37246)

* fixup! Implement Google Shell Conventions for breeze script … (#10651)
2020-09-02 21:55:50 +02:00
Kaxil Naik 9a10f83ab0
Revert recent breeze changes (#10651 & #10670) (#10694)
* Revert "Add packages to function names in bash (#10670)"

This reverts commit cc551ba793.

* Revert "Implement Google Shell Conventions for breeze script … (#10651)"

This reverts commit 46c8d6714c.
2020-09-02 17:27:36 +01:00
Jarek Potiuk 46c8d6714c
Implement Google Shell Conventions for breeze script … (#10651)
Part of #10576

First (and the biggest of the series of commits to introduce
Google Shell Conventions in our bash scripts.

This is about the biggest and the most complex breeze script
so it is rather huge but it is difficult to split it into
smaller pieces.

The rules implemented (from the conventions):

 * constants and exported variables are CAPITALIZED, where
   local/temporary variables are lowercase

 * following the shell guide, once all the variables are set to their
   final values (either from exported variables, calculation or --switches
   ) I have a single function that makes all the variables read-only. That
   helped to clean-up a lot of places where same functions was called
   several times, or where variables were defined in a few places. Now the
   behavior should be rather consistent and we should easily catch some
   duplications

 * function headers (following the guide) explaining arguments,
   variables expected, variables modified in the functions used.

 * setting the variables as read-only also helped to clean-up the "ifs"
   where we often had ":=}" in variables and != "" or == "". Those are
   replaced with `=}` and tests are replaced with `-n` and `-z` - also
   following the shell guide (readonly helped to detect and clean all
   such cases). This also should be much more robust in the future.

 * reorganized initialization of those constants and variables - simplified
   a few places where initialization was overlapping. It should be much more
   straightforward and clean now

 * a number of internal function breeze variables are "local" - this is
   helpful in accidental variables overwriting and keeping stuff localized

 * trap_add function is separated out to help in cases where we had
   several traps handling the same signals.
2020-08-31 13:24:53 +02:00
Michał Słowikowski 5c7f5369f2
fixed typo in confirm script (#8419)
Co-authored-by: michalslowikowski00 <michal.slowikowski@polidea.com>
2020-04-17 17:14:28 +02:00
Jarek Potiuk d18513ceb1
[AIRFLOW-5828] Move build logic out from hooks/build (#7618)
This is the final step of simplifying the Breeze scripts by
moving all the logic out from Travis' hooks/build
2020-03-07 16:09:06 +01:00
dstandish d1c7f3c293 AIRFLOW-XXXX improve clarity of confirm message (#7110) 2020-01-09 07:14:23 +01:00
Jarek Potiuk 857788e305
[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.
2019-09-18 13:43:30 +02:00
Jarek Potiuk 70e937a8d8
[AIRFLOW-5161] Static checks are run automatically in pre-commit hooks (#5777) 2019-08-14 20:53:28 -04:00
Jarek Potiuk da938a1ee0
[AIRFLOW-5078] User is asked if an image needs to be rebuild (#5691)
This is not happening when the user explicitely wants to build image
or in CI environment (DockerHub always builds the image via
hooks/build script.
2019-07-31 09:50:31 +02:00
Jarek Potiuk 817cf5b3b1
[AIRFLOW-5064] Switched to python 3.5 (#5678) 2019-07-29 15:27:42 +02:00