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 68deb11e4e Add summary of dependencies for ci image build (#30976)
68deb11e4e is described below

commit 68deb11e4e31bc8d6bfa808cb4cfc13b06d706fa
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu May 4 20:31:14 2023 +0200

    Add summary of dependencies for ci image build (#30976)
---
 .github/actions/build-ci-images/action.yml       |  8 ++++++++
 scripts/in_container/run_generate_constraints.sh | 22 +++++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/.github/actions/build-ci-images/action.yml 
b/.github/actions/build-ci-images/action.yml
index 4323c05392..841ae2b049 100644
--- a/.github/actions/build-ci-images/action.yml
+++ b/.github/actions/build-ci-images/action.yml
@@ -40,6 +40,14 @@ runs:
         breeze release-management generate-constraints --run-in-parallel
         --airflow-constraints-mode constraints-source-providers
       if: env.UPGRADE_TO_NEWER_DEPENDENCIES != 'false'
+    - name: "Print dependency upgrade summary"
+      shell: bash
+      run: |
+        for PYTHON_VERSION in ${{ env.PYTHON_VERSIONS }}; do
+          echo "Summarizing Python $PYTHON_VERSION"
+          cat "files/constraints-${PYTHON_VERSION}/*.md" >> 
$GITHUB_STEP_SUMMARY || true
+        done
+      if: env.UPGRADE_TO_NEWER_DEPENDENCIES != 'false'
     - name: Push empty CI image ${{ env.PYTHON_MAJOR_MINOR_VERSION }}:${{ 
env.IMAGE }}
       if: failure() || cancelled()
       shell: bash
diff --git a/scripts/in_container/run_generate_constraints.sh 
b/scripts/in_container/run_generate_constraints.sh
index d16ef6707a..e6f8a95458 100755
--- a/scripts/in_container/run_generate_constraints.sh
+++ b/scripts/in_container/run_generate_constraints.sh
@@ -21,6 +21,7 @@
 CONSTRAINTS_DIR="/files/constraints-${PYTHON_MAJOR_MINOR_VERSION}"
 
 
LATEST_CONSTRAINT_FILE="${CONSTRAINTS_DIR}/original-${AIRFLOW_CONSTRAINTS_MODE}-${PYTHON_MAJOR_MINOR_VERSION}.txt"
+CONSTRAINTS_MARKDOWN_DIFF="${CONSTRAINTS_DIR}/diff-${AIRFLOW_CONSTRAINTS_MODE}-${PYTHON_MAJOR_MINOR_VERSION}.md"
 mkdir -pv "${CONSTRAINTS_DIR}"
 
 
@@ -111,6 +112,25 @@ echo "Constraints generated in ${CURRENT_CONSTRAINT_FILE}"
 echo
 
 set +e
-diff --color=always "${LATEST_CONSTRAINT_FILE}" "${CURRENT_CONSTRAINT_FILE}"
+if diff "--ignore-matching-lines=#" --color=always "${LATEST_CONSTRAINT_FILE}" 
"${CURRENT_CONSTRAINT_FILE}"; then
+    echo
+    echo "${COLOR_GREEN}No changes in constraints - exiting${COLOR_RESET}"
+    echo
+    rm -f "${CONSTRAINTS_MARKDOWN_DIFF}"
+    exit 0
+fi
+
+cat <<EOF >"${CONSTRAINTS_MARKDOWN_DIFF}"
+# Dependencies updated for Python ${PYTHON_MAJOR_MINOR_VERSION}
+
+\`\`\`diff
+$(diff --unified=0 --ignore-matching-lines=# "${LATEST_CONSTRAINT_FILE}" 
"${CURRENT_CONSTRAINT_FILE}")
+\`\`\`
+EOF
+
+echo
+echo "Constraints error markdown generated in ${CONSTRAINTS_MARKDOWN_DIFF}"
+echo
+
 
 exit 0

Reply via email to