ci(netlify): build @coasys/ad4m from source (dev branch) - #194
Merged
Conversation
Netlify previews now clone ad4m's dev branch, build the SDK from source, and link it into the WE workspace before the normal build runs. This closes the gap between SDK features landing on dev and a new pre-release tag being published — the deployed preview site always picks up the latest batch RPC endpoints and performance fixes. GitHub Actions CI is unaffected and continues to build against the published SDK version. The branch defaults to dev and can be overridden via the AD4M_BRANCH env var in the Netlify UI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for coasys-we ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- Capture WE_ROOT from PWD instead of NETLIFY_BUILD_BASE (not reliably set, caused immediate failure with set -u). - Use npm instead of pnpm for ad4m core — avoids pnpm 9 vs 10 version conflict and workspace install issues. - npm install --ignore-scripts skips postinstall hooks that assume the full workspace; npx runs patch-package/tsc/rollup directly. - Drop ::group:: markers (GitHub Actions syntax, not Netlify). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
npm walks up from core/ and finds the root package.json with a workspaces field, then tries to resolve all sibling packages — including ones that use pnpm's workspace:* protocol. Remove the root package.json and pnpm-workspace.yaml so npm treats core/ as a standalone package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The preview site had no way to exercise SDK work that has landed on an ad4m branch but not in a published tag, and the gap is real rather than theoretical: ad4m `dev` is 19 commits ahead of 54a3fd956, the commit 0.13.0-test-model-layer was hand-published from, and one of those commits is #979's `subjectClassTargetClasses()` — a bulk presence check that replaces one `queryLinks` per model during a space switch, which is the same ground #190 covered from this side. A pin only moves when somebody publishes a tag by hand, so the lag is structural. Two things follow from closing it in the build command rather than the manifest. The command moves to `[context.deploy-preview]`. `[build]` covers every context, so as written it governed the published site too — and the published site must keep installing what the repo pins, because the pin is a claim about the executor its readers are running: VERIFIED_AGAINST_AD4M names a version and an ad4m commit, and the Rust half is published nowhere at all. A preview is the opposite case, tried against whatever executor is in front of the person testing, which during cross-repo work is a build rather than a release. And which ad4m a preview gets becomes a per-PR answer instead of always `dev`. Hardcoding the branch reproduces, on the preview surface, what 2392771 took out of CI in August: an artefact defined by whatever another repository held at the moment the job ran. Four answers, in order — AD4M_BRANCH in the Netlify UI, a `preview:ad4m@<ref>` label on the pull request, an ad4m branch of the same name as the WE branch, then `dev`. `preview:ad4m@pin` is the way for a branch whose point is the pin to say so. A label rather than a committed marker because a label cannot merge: a file saying "build from dev" would land on `dev` and go on governing every later preview until somebody noticed. Same-name matching is revived from build-with-ad4m-link.sh, and is what ad4m-compat.yaml still does. The branch name is read from the pull request rather than from BRANCH, which is `pull/N/head` on a preview — one request, and the labels come back with it. Last, the build says what it built. A page made from "dev at the time" is unexplainable a week later, and somebody hitting an RPC failure against a released executor has no way to tell that from a WE bug. The resolved ref and SHA are written to /build-info.json and announced in the console. Nothing here reaches the required build, which still installs the lockfile and stops. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ci(netlify): build @coasys/ad4m from source on deploy previews
What
Netlify deploy previews can clone an ad4m branch, build the SDK from source, and link it into
the WE workspace before the normal build. The preview site picks up SDK work — batch RPC endpoints,
performance fixes, new handlers — without waiting for a new pre-release tag. Which ad4m branch is
decided per pull request; left alone it tracks
dev.The published site is unaffected and keeps installing the version
pnpm.overridespins.Why
WE's pnpm override pins a published pre-release tag (
0.13.0-test-model-layer). New SDK featuresland on ad4m's
devbranch well before a tag gets cut, and the tag only moves when somebodyhand-publishes one from an ad4m commit. The gap means the preview site runs stale SDK code even
when the executor already supports the new endpoints.
At time of writing ad4m
devis 19 commits ahead of54a3fd956, the commit the current pin waspublished from, with nothing behind — so this is the ordinary state of things rather than a moment
that happened to be bad.
Concrete example:
PerspectiveProxy.subjectClassTargetClasses()(ad4m#979, merged 8 Sept) is asingle-call presence check for a set of models, replacing one
queryLinksper model — ~4.5s on a16-model space switch against a 300ms-RTT executor. It is in those 19 commits and not in the pin.
That is the same ground #190 covered from this side.
How
scripts/netlify-build.sh— shallow-clones ad4m, builds@coasys/ad4mfrom source (3 deps,fast), rewrites the pnpm override to
link:the local build, then runspnpm build.netlify.toml— points[context.deploy-preview]at the script.[build]keepspnpm build, so production, branch deploys and every other context stay on the pin.AD4M_BRANCHin the Netlify UI — site-wide, overrides everything below.preview:ad4m@<ref>label on the pull request.preview:ad4m@pinmeans "use the pinnedversion", for a branch whose whole point is that pin.
dev./build-info.jsonandannounced in the console, plus a
we:ad4m-buildmeta tag.Why the context scoping
[build]covers every deploy context, so as originally written the change governed the publishedsite too. The pin is a claim about which executor a build requires —
VERIFIED_AGAINST_AD4Min@we/backend-ad4mnames both a version and an ad4m commit, and the Rust half is published nowhereat all — and the published site has to keep making that claim, because the people opening it are
running whatever executor they installed. A preview is the opposite case: it is tried against an
executor somebody has in front of them, which during cross-repo work is a build rather than a
release.
Why per-PR rather than hardcoded
devHardcoding the branch reproduces, on the preview surface, what
23927712took out of CI in August:an artefact defined by whatever another repository held at the moment the job ran. Same-name branch
matching is revived from the old
build-with-ad4m-link.sh, and is whatad4m-compat.yamlstilldoes.
A label rather than a committed marker file because a label cannot merge. A file saying "build
from dev" would land on
devand go on governing every later preview until somebody noticed.The branch name is read from the pull request rather than from
BRANCH, which Netlify sets topull/N/headon a preview — one request, and the labels come back with it.Test plan
/build-info.jsonon the preview reports"ad4mSource": "source","ad4mRef": "dev","ad4mSha": "cf1f69597…"— the#979merge commit.we:ad4m-buildmeta tag and console line are present in the served page.REVIEW_ID=194against the liveGitHub API (resolves
ci/netlify-ad4m-dev, no label, no matching ad4m branch →dev).dist.bash -nclean. Prettier does not parse.tomlor.sh, soformat:checkskips both.preview:ad4m@pin— the path a deploy preview cannot exercise on its own. Tested by labellingthe PR and running the script locally with
REVIEW_ID=194, so the label was read off the liveAPI: resolves to
pin, skips the clone (/tmp/ad4m-sdknever created), builds against@coasys+ad4m@0.13.0-test-model-layer(named in the bundler's own module resolution), reports"ad4mSource": "pin"with a null SHA, and leaves the working tree clean — the pin path doesnot rewrite
package.json, so it cannot trip the build-drift gate. Label since removed.Known follow-ups
link:is kept rather thanfile:. The linked package's deps were installed in place by npm;file:would have pnpm re-resolve them against WE's lockfile.ad4m-compat.yamlcaches onthe ad4m SHA and this could too.
the Rust side, and nothing here builds or checks one.
🤖 Generated with Claude Code