Skip to content

Commit 0cda251

Browse files
Julianclaude
andcommitted
Support rebuilding historical versions via IMPLEMENTATION_VERSION
Pin the installed version from an optional build arg so build-all can (re)build and publish images for past versions, giving the UI a per-version compliance trend. An empty value (the normal build) installs the latest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a7fdb4c commit 0cda251

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/build-all.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Rebuild and publish every historical version of this harness.
22
#
33
# Versions are git tags (`harness-release-*`, created automatically by build.yml) plus the current `main`.
4-
# Each is (re)built and published through Bowtie's reusable `harness-ci.yml` workflow.
5-
# Run this manually to backfill images, e.g. right after extracting a harness that had a `matrix-versions.json`.
4+
# Each is (re)built and published through Bowtie's reusable `harness-ci.yml` workflow, pinning the
5+
# implementation version via the `IMPLEMENTATION_VERSION` build arg.
6+
# Run this manually to backfill images.
67
name: Build All Versions
78

89
on:
@@ -26,12 +27,16 @@ jobs:
2627
- name: Collect available versions
2728
id: revisions
2829
run: |
29-
# Only the auto-created per-version release tags, plus current `main`.
30-
tags=$(jq -c -n '$ARGS.positional + ["main"]' --args $(git tag --list 'harness-release-*'))
31-
echo "value=${tags}" >> "$GITHUB_OUTPUT"
30+
# Each historical version is a {ref, version} pair: the tag to check out and the
31+
# version to pin via the `IMPLEMENTATION_VERSION` build arg.
32+
# `main` builds the current default (unpinned) and is additionally tagged `latest`.
33+
revisions=$(git tag --list 'harness-release-*' \
34+
| jq -R -c '{ref: ., version: ltrimstr("harness-release-")}' \
35+
| jq -s -c '. + [{ref: "main", version: ""}]')
36+
echo "value=${revisions}" >> "$GITHUB_OUTPUT"
3237
3338
build:
34-
name: Build
39+
name: Build (${{ matrix.revision.ref }})
3540
needs: versions
3641
strategy:
3742
# Backfill as many versions as possible; don't abort the rest on one failure.
@@ -46,6 +51,8 @@ jobs:
4651
artifact-metadata: write # needed for build provenance attestation
4752
uses: bowtie-json-schema/bowtie/.github/workflows/harness-ci.yml@a0ae283dca0a0d0eb2381a886d5499162f33c82a # main
4853
with:
49-
ref: ${{ matrix.revision }}
54+
ref: ${{ matrix.revision.ref }}
55+
build-args: ${{ matrix.revision.version != '' && format('IMPLEMENTATION_VERSION={0}', matrix.revision.version) || '' }}
5056
publish: true
51-
is-latest: ${{ matrix.revision == 'main' }}
57+
is-latest: ${{ matrix.revision.ref == 'main' }}
58+
smoke-continue-on-error: true

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM python:3.15.0b4-alpine
22
WORKDIR /usr/src/myapp
3-
RUN python3 -m pip install fastjsonschema
3+
ARG IMPLEMENTATION_VERSION
4+
RUN python3 -m pip install "fastjsonschema${IMPLEMENTATION_VERSION:+==$IMPLEMENTATION_VERSION}"
45
COPY bowtie_fastjsonschema.py .
56
CMD ["python3", "bowtie_fastjsonschema.py"]

0 commit comments

Comments
 (0)