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

potiuk pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new ae3755511c0 [v3-0-test] Initialize custom variables before running 
db-reset (#54324) (#54327)
ae3755511c0 is described below

commit ae3755511c0c7845d50dc39d7c73b34d8971c1e1
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Aug 10 23:24:27 2025 +0200

    [v3-0-test] Initialize custom variables before running db-reset (#54324) 
(#54327)
    
    Before that change, when you set custom variables or intialization in
    airflow-breeze-config, the initialization was kind of wrongly done.
    
    a) in case of regular breeze command, it was done AFTER db-reset
    b) when start-airflow was done, the initialization was done during
       the start-airflow - separately - which was kinda strangely duplicated
    
    This change unifies it - the initialization of custom variables and
    scripts happens before we run db-reset or check if we should start
    airflow.
    (cherry picked from commit 9334484edc1711226ee1c2e0617f58e8e2c078ea)
    
    Co-authored-by: Jarek Potiuk <[email protected]>
---
 Dockerfile.ci                             | 12 ++++++------
 scripts/docker/entrypoint_ci.sh           | 12 ++++++------
 scripts/in_container/check_environment.sh |  5 -----
 3 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/Dockerfile.ci b/Dockerfile.ci
index a38cebd0086..f6ebb5cd700 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -975,6 +975,11 @@ function environment_initialization() {
 
     set +e
 
+    # shellcheck source=scripts/in_container/configure_environment.sh
+    . "${IN_CONTAINER_DIR}/configure_environment.sh"
+    # shellcheck source=scripts/in_container/run_init_script.sh
+    . "${IN_CONTAINER_DIR}/run_init_script.sh"
+
     "${IN_CONTAINER_DIR}/check_environment.sh"
     ENVIRONMENT_EXIT_CODE=$?
     set -e
@@ -984,6 +989,7 @@ function environment_initialization() {
         echo
         exit ${ENVIRONMENT_EXIT_CODE}
     fi
+
     mkdir -p /usr/lib/google-cloud-sdk/bin
     touch /usr/lib/google-cloud-sdk/bin/gcloud
     ln -s -f /usr/bin/gcloud /usr/lib/google-cloud-sdk/bin/gcloud
@@ -1009,12 +1015,6 @@ function environment_initialization() {
         ssh-keyscan -H localhost >> ~/.ssh/known_hosts 2>/dev/null
     fi
 
-    # shellcheck source=scripts/in_container/configure_environment.sh
-    . "${IN_CONTAINER_DIR}/configure_environment.sh"
-
-    # shellcheck source=scripts/in_container/run_init_script.sh
-    . "${IN_CONTAINER_DIR}/run_init_script.sh"
-
     cd "${AIRFLOW_SOURCES}"
 
     # Temporarily add /opt/airflow/providers/standard/tests to PYTHONPATH in 
order to see example dags
diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh
index 831be7e241f..210c7f40f75 100755
--- a/scripts/docker/entrypoint_ci.sh
+++ b/scripts/docker/entrypoint_ci.sh
@@ -139,6 +139,11 @@ function environment_initialization() {
 
     set +e
 
+    # shellcheck source=scripts/in_container/configure_environment.sh
+    . "${IN_CONTAINER_DIR}/configure_environment.sh"
+    # shellcheck source=scripts/in_container/run_init_script.sh
+    . "${IN_CONTAINER_DIR}/run_init_script.sh"
+
     "${IN_CONTAINER_DIR}/check_environment.sh"
     ENVIRONMENT_EXIT_CODE=$?
     set -e
@@ -148,6 +153,7 @@ function environment_initialization() {
         echo
         exit ${ENVIRONMENT_EXIT_CODE}
     fi
+
     mkdir -p /usr/lib/google-cloud-sdk/bin
     touch /usr/lib/google-cloud-sdk/bin/gcloud
     ln -s -f /usr/bin/gcloud /usr/lib/google-cloud-sdk/bin/gcloud
@@ -173,12 +179,6 @@ function environment_initialization() {
         ssh-keyscan -H localhost >> ~/.ssh/known_hosts 2>/dev/null
     fi
 
-    # shellcheck source=scripts/in_container/configure_environment.sh
-    . "${IN_CONTAINER_DIR}/configure_environment.sh"
-
-    # shellcheck source=scripts/in_container/run_init_script.sh
-    . "${IN_CONTAINER_DIR}/run_init_script.sh"
-
     cd "${AIRFLOW_SOURCES}"
 
     # Temporarily add /opt/airflow/providers/standard/tests to PYTHONPATH in 
order to see example dags
diff --git a/scripts/in_container/check_environment.sh 
b/scripts/in_container/check_environment.sh
index 9f3e67172fc..6c385f98173 100755
--- a/scripts/in_container/check_environment.sh
+++ b/scripts/in_container/check_environment.sh
@@ -95,8 +95,6 @@ function startairflow_if_requested() {
         echo
         export AIRFLOW__CORE__LOAD_EXAMPLES=${LOAD_EXAMPLES}
 
-        . "$( dirname "${BASH_SOURCE[0]}" )/configure_environment.sh"
-
         if airflow db migrate
         then
             if [[ ${LOAD_DEFAULT_CONNECTIONS=} == "true" || 
${LOAD_DEFAULT_CONNECTIONS=} == "True" ]]; then
@@ -119,9 +117,6 @@ function startairflow_if_requested() {
         else
             echo "Skipping user creation as auth manager different from Fab is 
used"
         fi
-
-        . "$( dirname "${BASH_SOURCE[0]}" )/run_init_script.sh"
-
     fi
     return $?
 }

Reply via email to