Skip to content

Commit 3d64f3c

Browse files
joseph-isaacsdimitarvdimitrov
authored andcommitted
fix: compat script (#7024)
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent d9be2f8 commit 3d64f3c

3 files changed

Lines changed: 41 additions & 30 deletions

File tree

.github/workflows/compat-gen-upload.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ on:
1313

1414
jobs:
1515
dry-run:
16-
runs-on: ubuntu-latest
16+
runs-on: >-
17+
${{ github.repository == 'vortex-data/vortex'
18+
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=compat-gen-dry-run', github.run_id)
19+
|| 'ubuntu-latest' }}
1720
permissions:
1821
contents: read
1922
outputs:
2023
version: ${{ steps.detect.outputs.version }}
2124
steps:
22-
- uses: actions/checkout@v4
25+
- uses: runs-on/action@v2
26+
if: github.repository == 'vortex-data/vortex'
27+
with:
28+
sccache: s3
29+
- uses: actions/checkout@v6
2330
with:
2431
fetch-depth: 0
25-
26-
- uses: dtolnay/rust-toolchain@stable
27-
28-
- uses: Swatinem/rust-cache@v2
32+
- uses: ./.github/actions/setup-prebuild
2933

3034
- name: Detect version
3135
id: detect
@@ -43,7 +47,7 @@ jobs:
4347
- name: Dry run publish
4448
run: |
4549
GIT_REF="${{ inputs.git_ref }}"
46-
CMD="python3 vortex-test/compat-gen/scripts/compat.py publish --dry-run"
50+
CMD="uv run vortex-test/compat-gen/scripts/compat.py publish --dry-run"
4751
if [ -n "$GIT_REF" ]; then
4852
CMD="$CMD --git-ref $GIT_REF"
4953
fi
@@ -52,19 +56,23 @@ jobs:
5256
upload:
5357
needs: dry-run
5458
if: inputs.confirm_upload == 'yes'
55-
runs-on: ubuntu-latest
59+
runs-on: >-
60+
${{ github.repository == 'vortex-data/vortex'
61+
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=compat-gen-upload', github.run_id)
62+
|| 'ubuntu-latest' }}
5663
environment: compat-upload
5764
permissions:
5865
id-token: write
5966
contents: read
6067
steps:
61-
- uses: actions/checkout@v4
68+
- uses: runs-on/action@v2
69+
if: github.repository == 'vortex-data/vortex'
70+
with:
71+
sccache: s3
72+
- uses: actions/checkout@v6
6273
with:
6374
fetch-depth: 0
64-
65-
- uses: dtolnay/rust-toolchain@stable
66-
67-
- uses: Swatinem/rust-cache@v2
75+
- uses: ./.github/actions/setup-prebuild
6876

6977
- name: Configure AWS credentials
7078
uses: aws-actions/configure-aws-credentials@v5
@@ -75,7 +83,7 @@ jobs:
7583
- name: Upload fixtures for v${{ needs.dry-run.outputs.version }}
7684
run: |
7785
GIT_REF="${{ inputs.git_ref }}"
78-
CMD="python3 vortex-test/compat-gen/scripts/compat.py publish --yes"
86+
CMD="uv run vortex-test/compat-gen/scripts/compat.py publish --yes"
7987
if [ -n "$GIT_REF" ]; then
8088
CMD="$CMD --git-ref $GIT_REF"
8189
fi

.github/workflows/compat-validation.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ on:
1515
mode:
1616
description: "Validation mode"
1717
required: true
18-
default: "all"
18+
default: "last"
1919
type: choice
2020
options:
21-
- all
2221
- last
22+
- all
2323

2424
jobs:
2525
compat-test:
2626
runs-on: >-
2727
${{ github.repository == 'vortex-data/vortex'
28-
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre/tag=compat-validation', github.run_id)
28+
&& format('runs-on={0}/runner=amd64-medium/image=ubuntu24-full-x64-pre-v2/tag=compat-validation', github.run_id)
2929
|| 'ubuntu-latest' }}
3030
timeout-minutes: 120
3131
steps:
@@ -35,12 +35,8 @@ jobs:
3535
sccache: s3
3636
- uses: actions/checkout@v6
3737
- uses: ./.github/actions/setup-prebuild
38-
- name: Install uv
39-
uses: spiraldb/actions/.github/actions/setup-uv@0.18.5
40-
with:
41-
sync: false
4238
- name: Run compat tests
4339
run: |
44-
MODE="${{ inputs.mode || 'all' }}"
40+
MODE="${{ inputs.mode || 'last' }}"
4541
uv run vortex-test/compat-gen/scripts/compat.py check \
4642
--mode "$MODE"

vortex-test/compat-gen/scripts/compat.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
import subprocess
3636
import sys
3737
import tempfile
38+
import time
3839
from concurrent.futures import ThreadPoolExecutor, as_completed
3940
from datetime import UTC, datetime
4041
from pathlib import Path
41-
from urllib.error import HTTPError
42+
from urllib.error import HTTPError, URLError
4243
from urllib.request import urlopen
4344

4445
import jsonschema
@@ -169,13 +170,19 @@ def __init__(self, bucket: str):
169170

170171
def read(self, key: str) -> bytes | None:
171172
url = f"{self.https_base}/{key}"
172-
try:
173-
with urlopen(url) as resp:
174-
return resp.read()
175-
except HTTPError as e:
176-
if e.code in (403, 404):
177-
return None
178-
raise
173+
for attempt in range(3):
174+
try:
175+
with urlopen(url, timeout=10) as resp:
176+
return resp.read()
177+
except HTTPError as e:
178+
if e.code in (403, 404):
179+
return None
180+
raise
181+
except (URLError, ConnectionError, TimeoutError):
182+
if attempt < 2:
183+
time.sleep(1 * (attempt + 1))
184+
continue
185+
raise
179186

180187
def write(self, key: str, data: bytes) -> None:
181188
with tempfile.NamedTemporaryFile(delete=False) as f:

0 commit comments

Comments
 (0)