Skip to content

Commit 718eac8

Browse files
committed
Switch to latest "stash" action from apache/infrastructure-actions
There are a few improvements just merged in the latest version of the "stash" suite of actions that we contributed. Most of the changes were result of making the apache#45289 works with stash action and since the changes were added we found that we need to do things differently (for example rather than storing .cache directly we need to tar the directories because we need to preserve permissions and symbolic links). There is however one useful feature that remained - namely protecting against accidentally downloading stash from the main branch, when the PR needs only "its own" artifact (helpful in case of typos in the workflow where wrong image artifact name is specified). This PR switches to latest version of the action and enables the protection in "prepare images" composite actions.
1 parent d7c2871 commit 718eac8

File tree

7 files changed

+16
-14
lines changed

7 files changed

+16
-14
lines changed

.github/actions/install-pre-commit/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ runs:
5656
echo
5757
shell: bash
5858
- name: "Restore pre-commit cache"
59-
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
59+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
6060
with:
6161
key: cache-pre-commit-v4-${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
6262
path: /tmp/

.github/actions/prepare_breeze_and_image/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ runs:
5353
run: sudo chown -R ${USER} /mnt
5454
shell: bash
5555
- name: "Restore ${{ inputs.image-type }} docker image ${{ inputs.platform }}:${{ inputs.python }}"
56-
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
56+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
5757
with:
5858
key: ${{ inputs.image-type }}-image-save-${{ inputs.platform }}-${{ inputs.python }}
5959
path: "/mnt/"
60+
only-current-branch: 'true'
6061
- name: "Load ${{ inputs.image-type }} image ${{ inputs.platform }}:${{ inputs.python }}"
6162
env:
6263
PLATFORM: ${{ inputs.platform }}

.github/actions/prepare_single_ci_image/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ runs:
4242
run: sudo chown -R ${USER} /mnt
4343
shell: bash
4444
- name: "Restore CI docker images ${{ inputs.platform }}:${{ inputs.python }}"
45-
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
45+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
4646
with:
4747
key: ci-image-save-${{ inputs.platform }}-${{ inputs.python }}
4848
path: "/mnt/"
49+
only-current-branch: 'true'
4950
if: contains(inputs.python-versions-list-as-string, inputs.python)
5051
- name: "Load CI image ${{ inputs.platform }}:${{ inputs.python }}"
5152
env:

.github/workflows/basic-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
cache: 'pnpm'
112112
cache-dependency-path: 'airflow/ui/pnpm-lock.yaml'
113113
- name: "Restore eslint cache (ui)"
114-
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
114+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
115115
with:
116116
path: airflow/ui/node_modules/
117117
key: cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
@@ -121,7 +121,7 @@ jobs:
121121
env:
122122
FORCE_COLOR: 2
123123
- name: "Save eslint cache (ui)"
124-
uses: apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
124+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
125125
with:
126126
path: airflow/ui/node_modules/
127127
key: cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
@@ -149,7 +149,7 @@ jobs:
149149
with:
150150
node-version: 21
151151
- name: "Restore eslint cache (www)"
152-
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
152+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
153153
with:
154154
path: airflow/www/node_modules/
155155
key: cache-www-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/www/**/yarn.lock') }}
@@ -159,7 +159,7 @@ jobs:
159159
env:
160160
FORCE_COLOR: 2
161161
- name: "Save eslint cache (www)"
162-
uses: apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
162+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
163163
with:
164164
path: airflow/www/node_modules/
165165
key: cache-www-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/www/**/yarn.lock') }}

.github/workflows/ci-image-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
with:
137137
use-uv: ${{ inputs.use-uv }}
138138
- name: "Restore ci-cache mount image ${{ inputs.platform }}:${{ env.PYTHON_MAJOR_MINOR_VERSION }}"
139-
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
139+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
140140
with:
141141
key: "ci-cache-mount-save-v2-${{ inputs.platform }}-${{ env.PYTHON_MAJOR_MINOR_VERSION }}"
142142
path: "/tmp/"
@@ -187,7 +187,7 @@ jobs:
187187
run: breeze ci-image save --platform "${PLATFORM}" --image-file-dir "/mnt"
188188
if: inputs.upload-image-artifact == 'true'
189189
- name: "Stash CI docker image ${{ env.PYTHON_MAJOR_MINOR_VERSION }}"
190-
uses: apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
190+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
191191
with:
192192
key: ci-image-save-${{ inputs.platform }}-${{ env.PYTHON_MAJOR_MINOR_VERSION }}
193193
path: "/mnt/ci-image-save-*-${{ env.PYTHON_MAJOR_MINOR_VERSION }}.tar"
@@ -202,7 +202,7 @@ jobs:
202202
--cache-file /tmp/ci-cache-mount-save-v2-${PYTHON_MAJOR_MINOR_VERSION}.tar.gz
203203
if: inputs.upload-mount-cache-artifact == 'true'
204204
- name: "Stash cache mount ${{ inputs.platform }}:${{ env.PYTHON_MAJOR_MINOR_VERSION }}"
205-
uses: apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
205+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
206206
with:
207207
key: "ci-cache-mount-save-v2-${{ inputs.platform }}-${{ env.PYTHON_MAJOR_MINOR_VERSION }}"
208208
path: "/tmp/ci-cache-mount-save-v2-${{ env.PYTHON_MAJOR_MINOR_VERSION }}.tar.gz"

.github/workflows/ci-image-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
shell: bash
147147
if: inputs.canary-run == 'true'
148148
- name: "Save pre-commit cache"
149-
uses: apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
149+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
150150
with:
151151
# yamllint disable rule:line-length
152152
key: cache-pre-commit-v4-${{ steps.breeze.outputs.host-python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
@@ -271,7 +271,7 @@ jobs:
271271
python: ${{ inputs.default-python-version }}
272272
use-uv: ${{ inputs.use-uv }}
273273
- name: "Restore docs inventory cache"
274-
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
274+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
275275
with:
276276
path: ./docs/_inventory_cache/
277277
# TODO(potiuk): do better with determining the key
@@ -283,7 +283,7 @@ jobs:
283283
run: >
284284
breeze build-docs ${DOCS_LIST_AS_STRING} ${{ matrix.flag }}
285285
- name: "Save docs inventory cache"
286-
uses: apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
286+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
287287
with:
288288
path: ./docs/_inventory_cache/
289289
key: cache-docs-inventory-v1-${{ hashFiles('pyproject.toml') }}

.github/workflows/prod-image-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ jobs:
296296
breeze prod-image save --platform "${PLATFORM}" --image-file-dir "/mnt"
297297
if: inputs.upload-image-artifact == 'true'
298298
- name: "Stash PROD docker image ${{ env.PYTHON_MAJOR_MINOR_VERSION }}"
299-
uses: apache/infrastructure-actions/stash/save@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
299+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
300300
with:
301301
key: prod-image-save-${{ inputs.platform }}-${{ env.PYTHON_MAJOR_MINOR_VERSION }}
302302
path: "/mnt/prod-image-save-*-${{ env.PYTHON_MAJOR_MINOR_VERSION }}.tar"

0 commit comments

Comments
 (0)