Skip to content

Commit c63a800

Browse files
feat[back-compat]: Add a script to upload fixtures to a repo (#6993)
This is the final PR in initial creation of the back-compat testing rfc: This PR updates the docs. Add a script to upload, list and validate changes. --------- Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 12fe78e commit c63a800

20 files changed

Lines changed: 1817 additions & 1000 deletions

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

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,64 @@ name: Compat Fixture Upload
33
on:
44
workflow_dispatch:
55
inputs:
6-
version:
7-
description: "Version to generate fixtures for (e.g. 0.62.0)"
6+
git_ref:
7+
description: "Git ref for version detection (e.g. v0.62.0). Defaults to HEAD."
8+
required: false
9+
confirm_upload:
10+
description: "Type 'yes' to confirm upload after reviewing the dry-run output."
811
required: true
12+
default: "no"
913

1014
jobs:
11-
upload-fixtures:
15+
dry-run:
1216
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
outputs:
20+
version: ${{ steps.detect.outputs.version }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: dtolnay/rust-toolchain@stable
27+
28+
- uses: Swatinem/rust-cache@v2
29+
30+
- name: Detect version
31+
id: detect
32+
run: |
33+
GIT_REF="${{ inputs.git_ref }}"
34+
if [ -n "$GIT_REF" ]; then
35+
TAG=$(git describe --tags --abbrev=0 "$GIT_REF")
36+
else
37+
TAG=$(git describe --tags --abbrev=0)
38+
fi
39+
VERSION="${TAG#v}"
40+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
41+
echo "Detected version: $VERSION (from tag: $TAG)"
42+
43+
- name: Dry run publish
44+
run: |
45+
GIT_REF="${{ inputs.git_ref }}"
46+
CMD="python3 vortex-test/compat-gen/scripts/compat.py publish --dry-run"
47+
if [ -n "$GIT_REF" ]; then
48+
CMD="$CMD --git-ref $GIT_REF"
49+
fi
50+
$CMD
51+
52+
upload:
53+
needs: dry-run
54+
if: inputs.confirm_upload == 'yes'
55+
runs-on: ubuntu-latest
56+
environment: compat-upload
1357
permissions:
1458
id-token: write
1559
contents: read
1660
steps:
1761
- uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0
1864

1965
- uses: dtolnay/rust-toolchain@stable
2066

@@ -23,10 +69,14 @@ jobs:
2369
- name: Configure AWS credentials
2470
uses: aws-actions/configure-aws-credentials@v5
2571
with:
26-
role-to-assume: arn:aws:iam::245040174862:role/GitHubBenchmarkRole
72+
role-to-assume: "arn:aws:iam::245040174862:role/GitHubBenchmarkRole"
2773
aws-region: us-east-1
2874

29-
- name: Generate and upload fixtures
30-
run: >
31-
python3 vortex-test/compat-gen/scripts/upload.py
32-
--version "${{ inputs.version }}"
75+
- name: Upload fixtures for v${{ needs.dry-run.outputs.version }}
76+
run: |
77+
GIT_REF="${{ inputs.git_ref }}"
78+
CMD="python3 vortex-test/compat-gen/scripts/compat.py publish --yes"
79+
if [ -n "$GIT_REF" ]; then
80+
CMD="$CMD --git-ref $GIT_REF"
81+
fi
82+
$CMD

.github/workflows/compat-test-weekly.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Compat Validation
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 * * 1" # Monday 6am UTC
6+
workflow_dispatch:
7+
inputs:
8+
mode:
9+
description: "Validation mode"
10+
required: true
11+
default: "last"
12+
type: choice
13+
options:
14+
- last
15+
- all
16+
17+
env:
18+
FIXTURES_URL: https://vortex-compat-fixtures.s3.amazonaws.com
19+
20+
jobs:
21+
compat-test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: dtolnay/rust-toolchain@stable
27+
28+
- uses: Swatinem/rust-cache@v2
29+
30+
- name: Run compat tests
31+
run: |
32+
MODE="${{ inputs.mode || 'last' }}"
33+
python3 vortex-test/compat-gen/scripts/compat.py check \
34+
--mode "$MODE"

Cargo.lock

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ rustc-hash = "2.1"
216216
serde = "1.0.220"
217217
serde_json = "1.0.138"
218218
serde_test = "1.0.176"
219+
sha2 = "0.10"
219220
simdutf8 = "0.1.5"
220221
similar = "2.7.0"
221222
sketches-ddsketch = "0.3.0"

vortex-test/compat-gen/Cargo.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "vortex-compat"
33
authors = { workspace = true }
4-
description = "Backward-compatibility fixture generation and testing for Vortex"
4+
description = "Backward-compatibility fixture generation and checking for Vortex"
55
edition = { workspace = true }
66
homepage = { workspace = true }
77
include = { workspace = true }
@@ -16,21 +16,16 @@ version = { workspace = true }
1616
workspace = true
1717

1818
[[bin]]
19-
name = "compat-gen"
19+
name = "vortex-compat"
2020
path = "src/main.rs"
2121

22-
[[bin]]
23-
name = "compat-validate"
24-
path = "src/validate_main.rs"
25-
2622
[dependencies]
2723
# Vortex crates
2824
vortex = { workspace = true, features = ["files", "tokio", "zstd"] }
2925
vortex-array = { workspace = true, features = ["_test-harness"] }
3026
vortex-buffer = { workspace = true }
3127
vortex-error = { workspace = true }
3228
vortex-session = { workspace = true }
33-
vortex-utils = { workspace = true }
3429

3530
# TPC-H generation
3631
arrow-array = { workspace = true }
@@ -46,12 +41,12 @@ parquet = { workspace = true }
4641
futures = { workspace = true }
4742
tokio = { workspace = true, features = ["full"] }
4843

49-
# HTTP fetching (for ClickBench fixture + compat-test S3 downloads)
44+
# HTTP fetching (for ClickBench fixture setup)
5045
reqwest = { workspace = true }
5146

5247
# CLI + serialization
53-
chrono = { workspace = true, features = ["serde"] }
5448
clap = { workspace = true, features = ["derive"] }
5549
serde = { workspace = true, features = ["derive"] }
5650
serde_json = { workspace = true }
51+
sha2 = { workspace = true }
5752
tempfile = { workspace = true }

0 commit comments

Comments
 (0)