Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .ai/wheels/testing/adobe-engine-pins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Adobe engine pins and current-patch observation

The compatibility matrix does **not** track Adobe's latest patch by itself. Each
Adobe image is built from a pinned `cfengine` in two places:

| image | `ARG CFENGINE` default (Dockerfile) | `server.json` `app.cfengine` | last reviewed |
|---|---|---|---|
| `tools/docker/adobe2023` | `adobe@2023.0.11+330706` | same | 2026-11-30 (unchanged; coverage PR only) |
| `tools/docker/adobe2025` | `adobe@2025.0.06+331564` | same | 2026-11-30 (unchanged; coverage PR only) |

Both are wired to the same value; changing one without the other is a bug.
`tools/docker/adobe-patch-known-bad.json` records patches that the observational
watch has proven incompatible with Wheels, with evidence and a recheck date.

## Why "green" must name the build

An old pin means the matrix can be green while the patch users actually run is
broken — that is how the CF-4234761 replacement-escape change reached users
(#4649, #4715). Two mechanisms fix that:

1. **Every gating leg reports its build.** A `Record engine build` step runs
`box server info --json` in the container and writes `engineVersion` to the
job summary, the per-leg summary, and the matrix summary's
**Engine builds observed** table. A green cell therefore means "green on this
build", not "green on some pin".
2. **A non-blocking current-patch watch.** `.github/workflows/adobe-patch-watch.yml`
(weekly, Mondays 09:00 UTC, also `workflow_dispatch`) resolves the newest
`2023.x.y+<build>` and `2025.x.y+<build>` from ForgeBox, builds each image at
that patch with `--build-arg CFENGINE=...`, runs the core SQLite suite, and
reports the build it actually started. The observation jobs are `continue-on-error`; the resolve job is not.
It is a separate workflow, so a red result cannot fail a PR or the
release gate.
Every matrix summary links to it. It runs on its schedule, on
`workflow_dispatch`, and on a paths-limited `pull_request` when the observer
or its known-bad list changes (so an edit validates itself; ordinary PRs
never run it). Use
`-f engine=adobe2023 -f version=2023.0.26+331018` to recheck one known-bad
entry against the real registry version. A red *unknown* patch is labelled
"not a known-bad patch; treat as Adobe-changed-or-Wheels-broke"; a patch in
`adobe-patch-known-bad.json` reports `KNOWN-BAD (recheck <date>)` and stays
non-blocking.

## Refresh policy (do not let a pin age again)

**Owner:** the release manager (currently `@bpamiri`) runs this on the **first
business day of each month**, and whenever Adobe ships a security update. If a
month is missed, the weekly observer's expired-known-bad path fails and
opens/updates an `adobe-patch-watch` issue — a missed rotation is visible, not
silent.

1. Resolve the newest patch for each major:
```bash
curl -s "https://forgebox.io/api/v1/entry/adobe/versions?maxRows=200" \
| jq -r '.data[].version' \
| grep -E '^202[35]\.' | sort -V | tail -20
```
2. In `tools/docker/adobe2023` and `tools/docker/adobe2025`, update **both**
`ARG CFENGINE=adobe@<version>` and `"cfengine":"adobe@<version>"`.
3. Rebuild and run the SQLite leg for each bumped engine:
```bash
bash tools/test-matrix.sh --rebuild adobe2023 sqlite
bash tools/test-matrix.sh --rebuild adobe2025 sqlite
```
(Cold Adobe starts take several minutes; `tools/test-matrix.sh`'s local
readiness budget can expire while the engine installs its CFPM packages —
re-run once the container answers 200.)
4. Green: update the table above and remove any `adobe-patch-known-bad.json`
entry for that engine. Red: do **not** re-pin away the failure — record it in
`adobe-patch-known-bad.json` with the failing spec/line, the build, and a
recheck date (max 30 days), and open an issue if it is a Wheels-side break.
5. Dispatch `adobe-patch-watch.yml` for the engine you bumped and confirm the
summary names the new build.

### Current known-bad (2026-11-30)

| engine | patch | evidence | recheck |
|---|---|---|---|
| adobe2023 | `2023.0.26+331018` | `GET /wheels/core/tests?db=sqlite&format=json` → HTTP 500 at `vendor/wheels/model/sql.cfm` (`Wheels.UnbindableWhereValue` path). Instrumented stage-1 log on an image rebuilt at this patch: input `username='<masked literal>'` → `stage1=[username1?8]` instead of `username=?`. The same instrumentation on the pinned u11 build returns `username=?`. | 2026-12-15 |
| adobe2025 | `2025.0.14+332029` | Same suite failure at the same `sql.cfm` path on an image rebuilt at this patch. | 2026-12-15 |

A `recheck` date is a deadline, not a note: once it passes, the observer stops
treating the entry as known-bad (the job goes red and files/updates an issue)
instead of suppressing the failure forever. A green run that still has a
known-bad entry logs a warning to remove the stale entry.

This is a **Wheels/Adobe-patch incompatibility, not an Adobe outage**: the
masked-where `ReReplace(..., "\1?\8", "all")` path in
`vendor/wheels/model/sql.cfm` produces a corrupted element on these patches, so
the where parser rejects it. Users on those patches hit it; the gating matrix
cannot see it because its images predate the change.
291 changes: 291 additions & 0 deletions .github/workflows/adobe-patch-watch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
name: Adobe current-patch watch

# Observational, NOT a gate (#4715). The compat matrix pins the Adobe builds
# baked into the images; those pins age, and an Adobe patch can change engine
# behaviour (e.g. the CF-4234761 replacement-escape change) while the gating
# legs stay green. This workflow builds each Adobe image at the CURRENT
# ForgeBox patch, runs the core SQLite suite, and reports the build it ran.
# It runs on its own schedule and is a separate workflow, so a red result is
# visible without blocking any PR or the release gate. The OBSERVATION jobs are
# continue-on-error (their red does not fail the workflow); the resolve job is
# not, so an upstream registry outage shows up as one red run that observed
# nothing instead of a silent skip.
#
# Known-bad patches are listed with their evidence and a RECHECK date in
# tools/docker/adobe-patch-known-bad.json. A listed patch reports KNOWN-BAD and
# does not fail the observation; an entry whose recheck date has passed stops
# suppressing the failure (the observation goes red and opens/updates an issue),
# so an old pin cannot stay explained forever.
#
# It also runs on pull_request, but only when THIS workflow or the known-bad
# list changes: an observer edit must be validated by its own run, and a brand
# new workflow cannot be dispatched before it exists on the default branch. The
# paths filter keeps ordinary PRs (and their cost) untouched.

on:
schedule:
- cron: '0 9 * * 1' # Mondays 09:00 UTC
pull_request:
paths:
- .github/workflows/adobe-patch-watch.yml
- tools/docker/adobe-patch-known-bad.json
workflow_dispatch:
inputs:
engine:
description: 'adobe2023, adobe2025, or blank for both'
type: string
default: ''
version:
description: 'Optional exact patch for --engine, e.g. 2023.0.26+331018 (blank = newest); use to recheck a known-bad entry'
type: string
default: ''

permissions:
contents: read
issues: write

jobs:
resolve:
name: Resolve current Adobe patches
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.resolve.outputs.matrix }}
steps:
- name: Resolve the newest patch from ForgeBox
id: resolve
env:
WANT: ${{ inputs.engine }}
EXACT: ${{ inputs.version }}
run: |
python3 - <<'PY' >> "$GITHUB_OUTPUT"
import json, os, re, sys, urllib.request
want = os.environ.get("WANT", "").strip()
exact = os.environ.get("EXACT", "").strip()
if want and want not in ("adobe2023", "adobe2025"):
sys.exit(f"::error::engine must be adobe2023, adobe2025, or blank; got '{want}'")
if exact and not re.fullmatch(r"\d{4}\.\d+\.\d+\+\d+", exact):
sys.exit(f"::error::version '{exact}' is not a vX.Y.Z+build patch id")
if exact and not want:
sys.exit("::error::version requires engine (adobe2023 or adobe2025)")
if exact and want not in ("adobe2023", "adobe2025"):
sys.exit("::error::version requires engine (adobe2023 or adobe2025)")
with urllib.request.urlopen("https://forgebox.io/api/v1/entry/adobe/versions?maxRows=200") as r:
versions = [v["version"] for v in json.load(r)["data"]]
def key(v):
return tuple(int(x) for x in v.split("+")[0].split("."))
include = []
for engine, major in (("adobe2023", "2023"), ("adobe2025", "2025")):
if want and engine != want:
continue
if exact:
include.append({"engine": engine, "version": exact})
continue
cand = [v for v in versions if re.fullmatch(major + r"\.\d+\.\d+\+\d+", v)]
if cand:
include.append({"engine": engine, "version": max(cand, key=key)})
# A typo or an upstream listing with no usable candidate must be a red
# run, not a green job that observed nothing.
if not include:
sys.exit("::error::resolved no Adobe patch candidates; refusing to run an empty matrix")
print("matrix=" + json.dumps({"include": include}))
PY

observe:
name: "Adobe current patch (observational): ${{ matrix.engine }}"
needs: resolve
if: needs.resolve.outputs.matrix != ''
continue-on-error: true
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.matrix) }}
runs-on: ubuntu-24.04
env:
ENGINE: ${{ matrix.engine }}
VERSION: ${{ matrix.version }}
steps:
- uses: actions/checkout@v5

- name: Point this throwaway checkout at the current patch
run: |
python3 - <<'PY'
import json, os
engine, version = os.environ["ENGINE"], os.environ["VERSION"]
path = f"tools/docker/{engine}/server.json"
with open(path) as f:
data = json.load(f)
data["app"]["cfengine"] = f"adobe@{version}"
with open(path, "w") as f:
json.dump(data, f, indent="\t")
PY
git diff --stat

- name: Build and start at ${{ matrix.version }}
run: |
docker compose build --build-arg "CFENGINE=adobe@${VERSION}" "$ENGINE"
docker compose up -d "$ENGINE"

- name: Run the suite and report the build
id: suite
run: |
case "$ENGINE" in
adobe2023) PORT=62023 ;;
adobe2025) PORT=62025 ;;
*) echo "::error::unknown engine $ENGINE"; exit 2 ;;
esac
CONTAINER="wheels-${ENGINE}-1"
READY=false
for i in $(seq 1 120); do
CODE=$(curl -s -o /dev/null --max-time 8 -w '%{http_code}' "http://localhost:${PORT}/" 2>/dev/null || true)
if [ "$CODE" = "200" ]; then READY=true; break; fi
sleep 10
done
BUILD="unknown"
if docker inspect "$CONTAINER" >/dev/null 2>&1; then
BUILD=$(docker exec "$CONTAINER" box server info --json 2>/dev/null \
| python3 -c 'import json,sys; print(json.load(sys.stdin).get("engineVersion","unknown"))' 2>/dev/null || echo unknown)
fi
echo "build=${BUILD}" >> "$GITHUB_OUTPUT"
{
echo "### Adobe current-patch watch: ${ENGINE}"
echo ""
echo "| Field | Value |"
echo "|-------|-------|"
echo "| Requested patch | \`adobe@${VERSION}\` |"
echo "| Engine build actually started | \`${BUILD}\` |"
} >> "$GITHUB_STEP_SUMMARY"

if [ "$READY" != "true" ]; then
echo "| Suite | :x: engine never became ready (last HTTP ${CODE:-000}) |" >> "$GITHUB_STEP_SUMMARY"
docker logs "$CONTAINER" 2>&1 | tail -50 || true
exit 1
fi

HTTP_CODE=$(curl -s --max-time 900 -o /tmp/result.json -w '%{http_code}' "http://localhost:${PORT}/wheels/core/tests?db=sqlite&format=json" || true)
echo "Engine build: ${BUILD}"
echo "Suite HTTP status: ${HTTP_CODE}"
RESULT=$(python3 - <<'PY'
import json
try:
d = json.load(open("/tmp/result.json"))
except Exception:
print("UNPARSEABLE")
raise SystemExit(0)
print(f"{d.get('totalPass', 0)} {d.get('totalFail', 0)} {d.get('totalError', 0)} {d.get('location', {}).get('template', '')}")
PY
)
PASS=$(echo "$RESULT" | awk '{print $1}')
FAIL=$(echo "$RESULT" | awk '{print $2}')
ERROR=$(echo "$RESULT" | awk '{print $3}')
WHERE=$(echo "$RESULT" | cut -d' ' -f4-)
echo "Result: pass=${PASS} fail=${FAIL} error=${ERROR} where=${WHERE}"
echo "| Suite | pass=${PASS}, fail=${FAIL}, error=${ERROR} |" >> "$GITHUB_STEP_SUMMARY"

KNOWN=$(python3 - "$ENGINE" "$VERSION" <<'PY'
import json, sys
engine, version = sys.argv[1], sys.argv[2]
try:
data = json.load(open("tools/docker/adobe-patch-known-bad.json"))
except Exception:
print("")
raise SystemExit(0)
entry = data.get(engine, {}).get(version)
if entry:
print(f"{entry.get('recheck', '')}|{entry.get('reason', '')}")
PY
)
RECHECK=""
if [ -n "$KNOWN" ]; then
RECHECK=${KNOWN%%|*}
fi
RECHECK_STATE="none"
if [ -n "$RECHECK" ]; then
# A recheck date is a deadline, not a note: once it has passed the
# entry stops suppressing the failure, otherwise a stale known-bad
# would turn this red suite green forever and the pin would age in
# the dark again (the exact failure mode this workflow exists for).
RECHECK_STATE=$(python3 - "$RECHECK" <<'PY'
import datetime, sys
try:
due = datetime.date.fromisoformat(sys.argv[1])
except Exception:
print("invalid")
raise SystemExit(0)
print("expired" if datetime.date.today() > due else "ok")
PY
) || RECHECK_STATE="invalid"
echo "Known-bad recheck date: ${RECHECK} (${RECHECK_STATE})"
fi

# A 500 error envelope has no totals at all (pass=0 fail=0 error=0),
# so "no failures" alone is not a green result: require HTTP 200 and at
# least one passing spec.
FAILED=0
if [ "$HTTP_CODE" != "200" ] || [ -n "$WHERE" ] || [ "$PASS" -lt 1 ] || [ "$FAIL" != "0" ] || [ "$ERROR" != "0" ] || [ "$RESULT" = "UNPARSEABLE" ]; then
FAILED=1
fi

if [ "$FAILED" = "1" ]; then
if [ -n "$KNOWN" ]; then
REASON=${KNOWN#*|}
if [ "$RECHECK_STATE" != "ok" ]; then
echo "::error::known-bad entry for ${ENGINE} ${VERSION} is ${RECHECK_STATE} (recheck ${RECHECK:-missing}); it no longer suppresses this failure"
echo "| Verdict | :x: KNOWN-BAD EXPIRED (${RECHECK_STATE}, recheck ${RECHECK:-missing}) — suppression removed |" >> "$GITHUB_STEP_SUMMARY"
echo "| Reason | ${REASON} |" >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
echo "KNOWN-BAD (recheck ${RECHECK}): ${REASON}"
echo "::warning::${ENGINE} ${BUILD}: suite failed but this patch is listed known-bad (recheck ${RECHECK}): ${REASON}"
echo "| Verdict | :warning: KNOWN-BAD (recheck ${RECHECK}) |" >> "$GITHUB_STEP_SUMMARY"
echo "| Reason | ${REASON} |" >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
echo "::error::${ENGINE} ${BUILD}: suite failed on the current patch (pass=${PASS} fail=${FAIL} error=${ERROR} where=${WHERE}) — not listed known-bad"
echo "| Verdict | :x: FAILED — not a known-bad patch; treat as Adobe-changed-or-Wheels-broke and investigate |" >> "$GITHUB_STEP_SUMMARY"
exit 1
fi

if [ -n "$KNOWN" ]; then
echo "::warning::${ENGINE} ${VERSION} is listed known-bad (recheck ${RECHECK}) but the suite is green; remove the stale entry"
echo "| Verdict | :white_check_mark: green, but the known-bad entry is stale — remove it |" >> "$GITHUB_STEP_SUMMARY"
else
echo "| Verdict | :white_check_mark: green on the current patch |" >> "$GITHUB_STEP_SUMMARY"
fi

# A red observer nobody reads is the failure mode this workflow exists to
# prevent. On an unknown red (or an expired known-bad, which also exits 1)
# open/update a tracking issue so a maintainer is actually told.
- name: Surface the failure as an issue
if: failure()
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
LABEL="adobe-patch-watch"
gh label create "$LABEL" --color B60205 \
--description "Adobe current-patch watch needs attention" --force >/dev/null
TITLE="Adobe patch watch: ${ENGINE} ${VERSION} failing"
BODY="The Adobe current-patch observation failed on \`${ENGINE}\` \`${VERSION}\` (build \`${{ steps.suite.outputs.build }}\`).

Run: ${RUN_URL}

This is either an Adobe patch change or a Wheels break — it is not a current known-bad entry (or that entry's recheck date expired). See \`.ai/wheels/testing/adobe-engine-pins.md\` for the refresh/known-bad process."
EXISTING=$(gh issue list --label "$LABEL" --state open --limit 100 \
--json number,title \
| jq -r --arg t "$TITLE" '.[] | select(.title == $t) | .number' | head -1)
if [ -n "$EXISTING" ]; then
gh issue comment "$EXISTING" --body "$BODY"
echo "Commented on existing issue #${EXISTING}"
else
gh issue create --title "$TITLE" --body "$BODY" --label "$LABEL"
fi

- name: Upload result
if: always()
uses: actions/upload-artifact@v6
with:
name: adobe-patch-watch-${{ matrix.engine }}-${{ matrix.version }}
path: |
/tmp/result.json
tools/docker/adobe-patch-known-bad.json
if-no-files-found: ignore
Loading
Loading