Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1356591?usp=email )

Change subject: [CI] Fetch submodules outside actions/checkout
......................................................................

[CI] Fetch submodules outside actions/checkout

Checkout overrides GIT_HTTP_USER_AGENT for its Git commands, so the
workflow-level user agent does not reach Gerrit during submodule fetches.

Fetch submodules in a separate Bash step in all eight workflows so Git
inherits the identifying user agent. Preserve the pinned revision and
shallow checkout behavior, and remove the redundant Windows update.

Bug: T441529
Change-Id: I5556de7ccc004b298cae476db29518695e25e810
---
M .github/workflows/doctest.yml
M .github/workflows/graalpy_tests.yml
M .github/workflows/login_tests-ci.yml
M .github/workflows/oauth_tests-ci.yml
M .github/workflows/pre-commit.yml
M .github/workflows/pywikibot-ci.yml
M .github/workflows/sysop_write_tests-ci.yml
M .github/workflows/windows_tests.yml
8 files changed, 48 insertions(+), 9 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml
index 8c7bd43..4740f2d 100644
--- a/.github/workflows/doctest.yml
+++ b/.github/workflows/doctest.yml
@@ -41,8 +41,13 @@
       - name: Checkout Repository
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v7
         if: matrix.python-version != '3.16-dev'
diff --git a/.github/workflows/graalpy_tests.yml 
b/.github/workflows/graalpy_tests.yml
index 0ef46c3..faf1073 100644
--- a/.github/workflows/graalpy_tests.yml
+++ b/.github/workflows/graalpy_tests.yml
@@ -33,8 +33,13 @@
       - name: Checkout Repository
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v7
         with:
diff --git a/.github/workflows/login_tests-ci.yml 
b/.github/workflows/login_tests-ci.yml
index 2b709ed..4617748 100644
--- a/.github/workflows/login_tests-ci.yml
+++ b/.github/workflows/login_tests-ci.yml
@@ -86,8 +86,13 @@
       - name: Checkout Repository
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v7
         if: matrix.python-version != '3.16-dev'
diff --git a/.github/workflows/oauth_tests-ci.yml 
b/.github/workflows/oauth_tests-ci.yml
index edbc7a7..aa288f6 100644
--- a/.github/workflows/oauth_tests-ci.yml
+++ b/.github/workflows/oauth_tests-ci.yml
@@ -58,8 +58,13 @@
       - name: Checkout Repository
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v7
         if: matrix.python-version != '3.16-dev'
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index 4116add..3f9cc35 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -41,8 +41,13 @@
       - name: checkout
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: run pre-commit
         uses: pre-commit/[email protected]
         env:
diff --git a/.github/workflows/pywikibot-ci.yml 
b/.github/workflows/pywikibot-ci.yml
index daee9d2..73058b4 100644
--- a/.github/workflows/pywikibot-ci.yml
+++ b/.github/workflows/pywikibot-ci.yml
@@ -80,8 +80,13 @@
       - name: Checkout Repository
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v7
         if: matrix.python-version != '3.16-dev'
diff --git a/.github/workflows/sysop_write_tests-ci.yml 
b/.github/workflows/sysop_write_tests-ci.yml
index b2b07e6..2090746 100644
--- a/.github/workflows/sysop_write_tests-ci.yml
+++ b/.github/workflows/sysop_write_tests-ci.yml
@@ -34,8 +34,13 @@
       - name: Checkout Repository
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v7
         with:
diff --git a/.github/workflows/windows_tests.yml 
b/.github/workflows/windows_tests.yml
index c73c0e9..aa746dd 100644
--- a/.github/workflows/windows_tests.yml
+++ b/.github/workflows/windows_tests.yml
@@ -34,8 +34,13 @@
       - name: Checkout Repository
         uses: actions/checkout@v7
         with:
-          submodules: true
           persist-credentials: false
+      # Fetch separately because checkout overrides GIT_HTTP_USER_AGENT.
+      - name: Fetch submodules
+        shell: bash
+        run: |
+          git submodule sync
+          git -c protocol.version=2 submodule update --init --force --depth=1
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v7
         with:
@@ -45,7 +50,6 @@
       - name: Install dependencies
         shell: powershell
         run: |
-          git submodule update --init
           python --version
           python -c "import struct; print('PYTHON_ARCH:', struct.calcsize('P') 
<< 3)"
           python -m pip install --upgrade pip

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1356591?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I5556de7ccc004b298cae476db29518695e25e810
Gerrit-Change-Number: 1356591
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: JJMC89 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to