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 2020/05/16 10:53:50 UTC

[airflow] branch master updated: Fix master failing on generating requirements (#8885)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new a3a3411  Fix master failing on generating requirements (#8885)
a3a3411 is described below

commit a3a3411838cdbfd9aa99783690d4fba8b9f2dc57
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Sat May 16 12:53:30 2020 +0200

    Fix master failing on generating requirements (#8885)
    
    By default github actions checks out only latest commit but in order to
    see if there are any changes since the last readme generated
    we need to see the whole history so we need to fetch it all.
    
    We also skip generating the new README in case there is only one
    commit in the history since the last release. The nature of readme
    generation is that the commit with the README itself will never
    be in the list of commits for the previous release so there is
    always at least one commit more than the one listed in the readme.
---
 .github/workflows/ci.yml                     | 2 ++
 backport_packages/setup_backport_packages.py | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f1f7cd2..762f40d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -140,6 +140,8 @@ jobs:
       PYTHON_MAJOR_MINOR_VERSION: 3.6
     steps:
       - uses: actions/checkout@master
+        with:
+          fetch-depth: 0
       - uses: actions/setup-python@v1
         with:
           python-version: '3.x'
diff --git a/backport_packages/setup_backport_packages.py b/backport_packages/setup_backport_packages.py
index c946fa0..7b212ff 100644
--- a/backport_packages/setup_backport_packages.py
+++ b/backport_packages/setup_backport_packages.py
@@ -988,7 +988,13 @@ def update_release_notes_for_package(provider_package_id: str, current_release_v
     git_cmd = get_git_command(previous_release)
     changes = subprocess.check_output(git_cmd, cwd=provider_package_path, universal_newlines=True)
     if changes == "":
-        print(f"The code has not changed since last release {last_release}. Skipping generating README.")
+        print(f"No change since {last_release}")
+        print("Skipping generating README.")
+        return
+    if len(changes.splitlines()) == 1:
+        print(f"Only one change since {last_release}")
+        print(f"The change is about committing the README: ${changes}.")
+        print("Skipping generating README.")
         return
     changes_table = convert_git_changes_to_table(
         changes,