You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/08/30 18:39:32 UTC

[airflow] branch main updated: Fix saving last choice of backend and other flags between breeze runs (#17913)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1d71441  Fix saving last choice of backend and other flags between breeze runs (#17913)
1d71441 is described below

commit 1d71441ceca304b9f6c326a4381626a60164b774
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Mon Aug 30 20:39:19 2021 +0200

    Fix saving last choice of backend and other flags between breeze runs (#17913)
    
    Breeze used to have the ability of storing the last choice of
    backend and few other flags in the ".BUILD" directory. While
    they were saved, one of the refactors changing the sequence
    of initialization made the default value to override the one
    provided by the .BUILD directory.
    
    This PR changes the sequence of initialization slightly:
    
    1) First we make sure that the .BUILD and few other temp dirs
       are created
    
    2) Then we read variables stored there (if they are stored)
    
    3) Then we follow through to the next steps of initialization and
       set the default values for parameters that do not have the
       values set yet
---
 breeze                                  | 6 ++++--
 scripts/ci/libraries/_initialization.sh | 1 -
 scripts/ci/libraries/_script_init.sh    | 2 ++
 tests/bats/bats_utils.bash              | 2 ++
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/breeze b/breeze
index cceaa89..e500b2f 100755
--- a/breeze
+++ b/breeze
@@ -3578,6 +3578,10 @@ function breeze::determine_python_version_to_use_in_breeze() {
 
 breeze::setup_default_breeze_constants
 
+initialization::create_directories
+
+breeze::read_saved_environment_variables
+
 initialization::initialize_common_environment
 
 initialization::get_environment_for_builds_on_ci
@@ -3597,8 +3601,6 @@ breeze::print_header_line
 
 build_images::forget_last_answer
 
-breeze::read_saved_environment_variables
-
 breeze::check_and_save_all_params
 
 build_images::determine_docker_cache_strategy
diff --git a/scripts/ci/libraries/_initialization.sh b/scripts/ci/libraries/_initialization.sh
index 9c6365c..f9ad3c5 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -601,7 +601,6 @@ function initialization::set_output_color_variables() {
 # Common environment that is initialized by both Breeze and CI scripts
 function initialization::initialize_common_environment() {
     initialization::set_output_color_variables
-    initialization::create_directories
     initialization::initialize_base_variables
     initialization::initialize_branch_variables
     initialization::initialize_available_integrations
diff --git a/scripts/ci/libraries/_script_init.sh b/scripts/ci/libraries/_script_init.sh
index dc79fd5..a690cd7 100755
--- a/scripts/ci/libraries/_script_init.sh
+++ b/scripts/ci/libraries/_script_init.sh
@@ -31,6 +31,8 @@ readonly AIRFLOW_SOURCES
 # shellcheck source=scripts/ci/libraries/_all_libs.sh
 . "${AIRFLOW_SOURCES}/scripts/ci/libraries/_all_libs.sh"
 
+initialization::create_directories
+
 initialization::initialize_common_environment
 
 sanity_checks::basic_sanity_checks
diff --git a/tests/bats/bats_utils.bash b/tests/bats/bats_utils.bash
index 2ca6fe8..8157be6 100644
--- a/tests/bats/bats_utils.bash
+++ b/tests/bats/bats_utils.bash
@@ -28,6 +28,8 @@ export SKIP_IN_CONTAINER_CHECK="true"
 # shellcheck source=scripts/ci/libraries/_all_libs.sh
 source "scripts/ci/libraries/_all_libs.sh"
 
+initialization::create_directories
+
 initialization::initialize_common_environment
 
 # shellcheck disable=SC1091