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 c77ce4c0ab Remove unnecessary cache for MyPy jobs (#38162)
c77ce4c0ab is described below

commit c77ce4c0abf3b259b739174523f3ae984100381e
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Mar 14 22:23:03 2024 +0100

    Remove unnecessary cache for MyPy jobs (#38162)
    
    The MyPy jobs started to fail pretty randomly in docs and dev
    builds and the main suspect for that is cache - either pre-commit
    cache or docker cache stored locally in docker volume.
    
    We can actually disable the cache, because a) pre-commit cache is
    not really needed for this job as we only one venv to create and
    b) the docker volume cache in case of CI job is at most harmless
    as we exect to start all jobs from a clean state.
---
 .github/workflows/mypy.yml                      | 10 +---------
 scripts/ci/pre_commit/pre_commit_mypy_folder.py |  2 +-
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml
index debac81173..7fdaec187b 100644
--- a/.github/workflows/mypy.yml
+++ b/.github/workflows/mypy.yml
@@ -79,15 +79,6 @@ jobs:
         with:
           python-version: ${{ inputs.breeze-python-version }}
         if: inputs.needs-mypy == 'true'
-      - name: Cache pre-commit envs
-        uses: actions/cache@v4
-        with:
-          path: ~/.cache/pre-commit
-          # yamllint disable-line rule:line-length
-          key: "pre-commit-${{steps.breeze.outputs.host-python-version}}-${{ 
hashFiles('.pre-commit-config.yaml') }}"
-          restore-keys: |
-            pre-commit-${{steps.breeze.outputs.host-python-version}}-
-        if: inputs.needs-mypy == 'true'
       - name: "MyPy checks for ${{ matrix.mypy-folder }}"
         run: |
           pip install pre-commit
@@ -98,4 +89,5 @@ jobs:
           SKIP_GROUP_OUTPUT: "true"
           DEFAULT_BRANCH: ${{ inputs.default-branch }}
           RUFF_FORMAT: "github"
+          INCLUDE_MYPY_VOLUME: "false"
         if: inputs.needs-mypy == 'true'
diff --git a/scripts/ci/pre_commit/pre_commit_mypy_folder.py 
b/scripts/ci/pre_commit/pre_commit_mypy_folder.py
index 9a22a07c75..4fd4a17777 100755
--- a/scripts/ci/pre_commit/pre_commit_mypy_folder.py
+++ b/scripts/ci/pre_commit/pre_commit_mypy_folder.py
@@ -53,7 +53,7 @@ res = run_command_via_breeze_shell(
     ],
     warn_image_upgrade_needed=True,
     extra_env={
-        "INCLUDE_MYPY_VOLUME": "true",
+        "INCLUDE_MYPY_VOLUME": os.environ.get("INCLUDE_MYPY_VOLUME", "true"),
         # Need to mount local sources when running it - to not have to rebuild 
the image
         # and to let CI work on it when running on PRs from forks - because 
mypy-dev uses files
         # that are not available at the time when image is built in CI

Reply via email to