From bb48c8775a5415f2c86663e356067b53f414a0cc Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 18 Oct 2023 05:59:57 -0400 Subject: [PATCH 1/2] Don't pre-clone submodules on CI, at least for now This has actions/checkout no longer automatically clone submodules in the CI test workflows. This change is for the purpose of reproducing #1713, to allow the forthcoming fix for it to be tested. However, continuing to rely on init-tests-after-clone.sh to get the submodules would serve as a kind of regression testing for #1713. So it is unclear at this time if and when this change should be undone. --- .github/workflows/cygwin-test.yml | 1 - .github/workflows/pythonpackage.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/cygwin-test.yml b/.github/workflows/cygwin-test.yml index d190f1132..89c03a394 100644 --- a/.github/workflows/cygwin-test.yml +++ b/.github/workflows/cygwin-test.yml @@ -26,7 +26,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: recursive - name: Install Cygwin uses: cygwin/cygwin-install-action@v4 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 2a82e0e03..2dd97183b 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -27,7 +27,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: recursive - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 8ea3133bb15a4498cfa7ab256a0d79287ac564c9 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 18 Oct 2023 06:40:40 -0400 Subject: [PATCH 2/2] Have init script clone submodules unconditionally Since 7110bf8 (in #1693), "git submodule update --init --recursive" was not run on CI, on the mistaken grounds that the CI test workflows would already have taken care of cloning all submodules (ever since 4eef3ec when the "submodules: recursive" option was added to the actions/checkout step). This changes the init-tests-after-clone.sh script to again run that command unconditionally, including on CI. The assumption that it wasn't needed on CI was based on the specific content of GitPython's own GitHub Actions workflows. But this disregarded that the test suite is run on CI for *other* projects: specifically, for downstream projects that package GitPython (#1713). This also brings back the comment from fc96980 that says more about how the tests rely on submodules being present (specifically, that they need a submodule with a submodule). However, that is not specifically related to the bug being fixed. --- init-tests-after-clone.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/init-tests-after-clone.sh b/init-tests-after-clone.sh index 21d1f86d8..118e1de22 100755 --- a/init-tests-after-clone.sh +++ b/init-tests-after-clone.sh @@ -47,10 +47,8 @@ git reset --hard HEAD~1 # Point the master branch where we started, so we test the correct code. git reset --hard __testing_point__ -# The tests need submodules. (On CI, they would already have been checked out.) -if ! ci; then - git submodule update --init --recursive -fi +# The tests need submodules, including a submodule with a submodule. +git submodule update --init --recursive # The tests need some version tags. Try to get them even in forks. This fetches # other objects too. So, locally, we always do it, for a consistent experience.