Skip to content

Commit 67fd110

Browse files
author
Mark Pollack
committed
Cross-SDK suite: weekly peer drift report
peer-drift.yml runs cross-sdk.yml and framework-smoke.yml (now also reusable workflows) with every peer at its latest commit, and writes the pinned and latest commits and every leg's result to the run summary. It runs weekly and on dispatch, never on push or pull request, and nothing depends on it. The README documents the pins, the locks and how to move a pin.
1 parent c78c45b commit 67fd110

4 files changed

Lines changed: 139 additions & 20 deletions

File tree

‎.github/workflows/cross-sdk.yml‎

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,27 @@ on:
2525
options: [all, java, typescript, rust, python, kotlin]
2626
schedule:
2727
- cron: '17 4 * * *'
28+
# peer-drift.yml calls this workflow with every peer at its latest commit.
29+
workflow_call:
30+
inputs:
31+
peers-ref:
32+
type: string
33+
required: false
34+
default: ''
35+
peer-overrides:
36+
type: string
37+
required: false
38+
default: ''
39+
peer:
40+
type: string
41+
required: false
42+
default: 'all'
2843

2944
permissions:
3045
contents: read
3146

3247
concurrency:
33-
group: cross-sdk-${{ github.ref }}
48+
group: cross-sdk-${{ github.workflow }}-${{ github.ref }}
3449
cancel-in-progress: false
3550

3651
jobs:
@@ -46,7 +61,7 @@ jobs:
4661
steps:
4762
- id: pick
4863
env:
49-
PEER: ${{ github.event.inputs.peer || 'all' }}
64+
PEER: ${{ inputs.peer || 'all' }}
5065
run: |
5166
# Per peer: its toolchain, its transports (cells x-java-<peer>-<t> and x-<peer>-java-<t>),
5267
# and the cache paths of its build. A peer's legs also run its quarkus-<peer>-<t> scenarios
@@ -155,8 +170,8 @@ jobs:
155170
id: peer
156171
env:
157172
SDK: ${{ matrix.sdk }}
158-
PEERS_REF: ${{ github.event.inputs.peers-ref || '' }}
159-
PEER_OVERRIDES: ${{ github.event.inputs.peer-overrides || '' }}
173+
PEERS_REF: ${{ inputs.peers-ref || '' }}
174+
PEER_OVERRIDES: ${{ inputs.peer-overrides || '' }}
160175
run: integration-testing/scripts/peer-sha.sh "$SDK" "$PEERS_REF" "$PEER_OVERRIDES" >> "$GITHUB_OUTPUT"
161176

162177
# The key carries the toolchain version the build depends on (the Python venv, Node's
@@ -171,8 +186,8 @@ jobs:
171186
172187
- name: Fetch and build the ${{ matrix.peer }} peer and programs
173188
env:
174-
PEERS_REF: ${{ github.event.inputs.peers-ref || '' }}
175-
PEER_OVERRIDES: ${{ github.event.inputs.peer-overrides || '' }}
189+
PEERS_REF: ${{ inputs.peers-ref || '' }}
190+
PEER_OVERRIDES: ${{ inputs.peer-overrides || '' }}
176191
ONLY: ${{ matrix.only }}
177192
run: |
178193
args=(--only "$ONLY" --prepare-only)
@@ -264,8 +279,8 @@ jobs:
264279
id: peer
265280
env:
266281
SDK: ${{ matrix.sdk }}
267-
PEERS_REF: ${{ github.event.inputs.peers-ref || '' }}
268-
PEER_OVERRIDES: ${{ github.event.inputs.peer-overrides || '' }}
282+
PEERS_REF: ${{ inputs.peers-ref || '' }}
283+
PEER_OVERRIDES: ${{ inputs.peer-overrides || '' }}
269284
run: integration-testing/scripts/peer-sha.sh "$SDK" "$PEERS_REF" "$PEER_OVERRIDES" >> "$GITHUB_OUTPUT"
270285

271286
# Restore only: the prepare job saved this key. On a miss the leg builds for itself.
@@ -280,8 +295,8 @@ jobs:
280295
281296
- name: Run the ${{ matrix.leg }} scenarios
282297
env:
283-
PEERS_REF: ${{ github.event.inputs.peers-ref || '' }}
284-
PEER_OVERRIDES: ${{ github.event.inputs.peer-overrides || '' }}
298+
PEERS_REF: ${{ inputs.peers-ref || '' }}
299+
PEER_OVERRIDES: ${{ inputs.peer-overrides || '' }}
285300
ONLY: ${{ matrix.only }}
286301
RUN_LABEL: ${{ matrix.leg }}
287302
run: |

‎.github/workflows/framework-smoke.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ on:
2222
description: 'Branch, tag or SHA of the TypeScript SDK (empty: its ref in peers.json)'
2323
required: false
2424
default: ''
25+
# peer-drift.yml calls this workflow with the TypeScript SDK at its latest commit.
26+
workflow_call:
27+
inputs:
28+
peers-ref:
29+
type: string
30+
required: false
31+
default: ''
2532

2633
permissions:
2734
contents: read
2835

2936
concurrency:
30-
group: framework-smoke-${{ github.ref }}
37+
group: framework-smoke-${{ github.workflow }}-${{ github.ref }}
3138
cancel-in-progress: false
3239

3340
jobs:
@@ -72,7 +79,7 @@ jobs:
7279
- name: Resolve the TypeScript SDK commit
7380
id: peer
7481
env:
75-
PEERS_REF: ${{ github.event.inputs.peers-ref || '' }}
82+
PEERS_REF: ${{ inputs.peers-ref || '' }}
7683
run: integration-testing/scripts/peer-sha.sh typescript-sdk "$PEERS_REF" "" >> "$GITHUB_OUTPUT"
7784

7885
# The same key as cross-sdk.yml's typescript legs, so either workflow's build is reused.
@@ -88,7 +95,7 @@ jobs:
8895
8996
- name: Run the framework smoke matrix
9097
env:
91-
PEERS_REF: ${{ github.event.inputs.peers-ref || '' }}
98+
PEERS_REF: ${{ inputs.peers-ref || '' }}
9299
RUN_LABEL: framework-smoke
93100
run: |
94101
args=(--tag fw)

‎.github/workflows/peer-drift.yml‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Peer drift report
2+
3+
# Weekly: the cross-SDK suite (cross-sdk.yml) and the framework smoke matrix (framework-smoke.yml)
4+
# against the latest commit of every peer SDK, instead of the commits peers.json pins. A red run
5+
# here means a peer moved in a way the pinned suite has not caught up with: adapt the programs or
6+
# expectations, then move the pin (integration-testing/README.md, "Peer pins and drift").
7+
#
8+
# Informational only. It runs on a schedule and on manual dispatch, never on push or pull request,
9+
# and no other workflow, branch rule or release step depends on it. The release gates are
10+
# cross-sdk.yml and framework-smoke.yml at the pinned peers.
11+
on:
12+
schedule:
13+
- cron: '29 6 * * 1'
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: peer-drift-${{ github.ref }}
21+
cancel-in-progress: false
22+
23+
jobs:
24+
cross-sdk:
25+
uses: ./.github/workflows/cross-sdk.yml
26+
with:
27+
peer-overrides: 'typescript-sdk=main rust-sdk=main python-sdk=main kotlin-sdk=master'
28+
29+
framework-smoke:
30+
uses: ./.github/workflows/framework-smoke.yml
31+
with:
32+
peers-ref: 'main'
33+
34+
report:
35+
name: drift report
36+
needs: [cross-sdk, framework-smoke]
37+
if: ${{ always() }}
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 5
40+
permissions:
41+
contents: read
42+
actions: read
43+
steps:
44+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
45+
46+
- name: Summarize the pinned and latest peer commits and the result of every leg
47+
env:
48+
GH_TOKEN: ${{ github.token }}
49+
run: |
50+
{
51+
echo "## Peer drift"
52+
echo
53+
echo "| Peer | Pinned (peers.json) | Latest | Moved |"
54+
echo "|---|---|---|---|"
55+
for p in $(jq -r 'keys[]' integration-testing/peers.json); do
56+
url="$(jq -r --arg n "$p" '.[$n].url' integration-testing/peers.json)"
57+
pin="$(jq -r --arg n "$p" '.[$n].ref' integration-testing/peers.json)"
58+
branch=main; [ "$p" = kotlin-sdk ] && branch=master
59+
latest="$(git ls-remote "$url" "refs/heads/$branch" | cut -f1)"
60+
moved=no; [ "${latest}" != "${pin}" ] && moved=yes
61+
echo "| $p | \`${pin:0:12}\` | \`${latest:0:12}\` ($branch) | $moved |"
62+
done
63+
echo
64+
echo "| Leg | Result |"
65+
echo "|---|---|"
66+
gh api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}/jobs" \
67+
--jq '.jobs[] | select(.name != "drift report") | "| \(.name) | \(.conclusion // .status) |"'
68+
echo
69+
echo "A failed leg is drift against that peer's latest commit; the pinned suite is unaffected."
70+
} >> "$GITHUB_STEP_SUMMARY"

‎integration-testing/README.md‎

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ integration-testing/scripts/run-all.sh --tag stdio --exclude 'x-java-*' --list
8282
`logs/run-all/<scenario>.console.log` and a line is printed as each finishes; the table at the end
8383
is the same. `--prepare-only` stops after the preparation (CI warms its caches with it).
8484

85-
Against a tag or other ref of the peer SDKs. The default is each peer's ref in `peers.json`: the
86-
TypeScript, Rust and Python peers are pinned to the last commits this suite passed against, because
87-
their `main` branches moved on (TypeScript no longer builds `dist/acp.js`, Rust no longer exports what
88-
the interop program uses, and the Python cells time out); Kotlin follows `master`. `--peer` and
89-
`--peers-ref` override the pins, for example `--peer typescript-sdk=main` to see the drift.
85+
Against a tag or other ref of the peer SDKs. The default is each peer's ref in `peers.json`
86+
([Peer pins and drift](#peer-pins-and-drift)). `--peer` and `--peers-ref` override the pins, for
87+
example `--peer typescript-sdk=main` to see the drift.
9088

9189
```bash
9290
# every peer at the same ref
@@ -99,6 +97,31 @@ jbang RunScenario.java x-java-python-http --peer python-sdk=1.0.0rc2
9997
A ref can be a branch, a tag or a commit SHA. Each ref gets its own checkout,
10098
`.cache/peers/<name>@<ref>`, so switching refs does not throw away a build.
10199

100+
### Peer pins and drift
101+
102+
Every peer in `peers.json` is pinned to a commit SHA, and so are the third-party packages its build
103+
resolves, so a nightly run changes only when this repository does:
104+
105+
| Peer | Pinned | Third-party packages locked by |
106+
|---|---|---|
107+
| TypeScript | commit | the peer's own `package-lock.json` (`npm ci`) |
108+
| Rust | commit | `programs/rust/Cargo.lock` (the interop programs are their own Cargo workspace) |
109+
| Python | commit | `programs/python/constraints.txt` (`pip install -c`) |
110+
| Kotlin | commit | exact versions in the peer's `gradle/libs.versions.toml` and `programs/kotlin/build.gradle.kts` |
111+
112+
`.github/workflows/peer-drift.yml` runs `cross-sdk.yml` and `framework-smoke.yml` weekly with every
113+
peer at its latest commit (`main`; Kotlin `master`) and writes a table of the pinned and latest
114+
commits and the result of every leg to the run summary. It is informational: no other workflow,
115+
branch rule or release step depends on it. A red leg there is drift. To move a pin:
116+
117+
1. run the peer's cells at its latest commit (`run-all.sh --tag <peer> --peer <peer>-sdk=main`),
118+
and adapt its programs or `expectations/<peer>.json` until they pass;
119+
2. set `ref` in `peers.json` to that commit's full SHA;
120+
3. regenerate that peer's lock: for Rust, `cargo update -p agent-client-protocol` in
121+
`programs/rust` (or delete `Cargo.lock` and build); for Python, rebuild the venv without `-c`
122+
and `pip freeze --exclude-editable` into `constraints.txt` (its header has the command);
123+
4. run `run-all.sh` with no overrides.
124+
102125
Logs for each run go to `logs/<scenario>/`: one file per process (`agent.log`, `server.log`,
103126
`client.log`, `clients.log`), per build (`build-*.log`, `peer-*.log`) and `result.txt`.
104127
`run-all.sh` also writes `logs/run-all/summary.txt`. CI uploads the whole `logs/` directory as an
@@ -452,7 +475,11 @@ language too, run on the same host at the same time.
452475
release gate ([Framework smoke matrix](#framework-smoke-matrix)); `release.yml` does not check it
453476
itself, so the maintainer confirms it is green on the release commit before dispatching a
454477
release.
455-
- Neither `interop-java.yml` nor `cross-sdk.yml` gates a release.
478+
- `.github/workflows/peer-drift.yml`, weekly and on manual dispatch: `cross-sdk.yml` and
479+
`framework-smoke.yml` (as reusable workflows) with every peer at its latest commit, plus a
480+
summary of pinned against latest commits and every leg's result
481+
([Peer pins and drift](#peer-pins-and-drift)). Informational.
482+
- Neither `interop-java.yml`, `cross-sdk.yml` nor `peer-drift.yml` gates a release.
456483

457484
## How a scenario is described
458485

@@ -519,7 +546,7 @@ matrix.json languages, pairs, transports, profiles, transport fact
519546
smoke.json the framework smoke matrix: step subsets, frameworks and transports, load
520547
expectations/ <lang>.json expected failures, one file per language package
521548
jbang-lib/ config model, peer checkouts, processes, jcmd sampler, assertions
522-
peers.json peer SDK git URLs, default refs and build commands
549+
peers.json peer SDK git URLs, pinned commits and build commands
523550
configs/ one JSON file per scenario (x-*, fw-*, load-10-fw-* generated, the rest hand-written)
524551
programs/<lang>/ each language's programs; launch/{build,agent,client}.sh for the cells
525552
programs/<framework>/ spring, micronaut, quarkus: the smoke programs, built on programs/framework

0 commit comments

Comments
 (0)