Skip to content

ci: check out percolator-sdk as a sibling so pnpm install can resolve it (#232) - #233

Open
dcccrypto wants to merge 2 commits into
mainfrom
fix/api-232-ci-sdk-sibling-checkout
Open

ci: check out percolator-sdk as a sibling so pnpm install can resolve it (#232)#233
dcccrypto wants to merge 2 commits into
mainfrom
fix/api-232-ci-sdk-sibling-checkout

Conversation

@dcccrypto

@dcccrypto dcccrypto commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Fixes #232.

What

Adds a sibling checkout of dcccrypto/percolator-sdk ahead of pnpm install in the build-and-test job.

Why

package.json and pnpm-lock.yaml on main resolve @percolatorct/sdk as file:../../percolator-sdk. CI checks out only this repo, so that path does not exist and the install aborts before a single test runs:

ENOENT: no such file or directory, scandir '/home/runner/work/percolator-sdk'
exit 254

No api PR has had a green build-and-test since ~2026-06-26, so ~20 open PRs are currently unverified.

Same root cause and same remedy as dcccrypto/percolator-indexer#172, which is merged and has main green. One difference: the api path is two levels up (../../percolator-sdk), not one — from work/percolator-api/percolator-api that resolves to work/percolator-sdk, which matches the ENOENT exactly. actions/checkout cannot write outside GITHUB_WORKSPACE, so the SDK is checked out into the workspace and then moved up.

This needs no SDK publish and no lockfile regeneration — SDK origin/main (v3.0.0, 673bc47) ships a committed dist/.

How to test

Verified locally against origin/main (b2751f4) in a scratch tree shaped like the runner (work/percolator-api/percolator-api + work/percolator-sdk):

step before after
pnpm install --frozen-lockfile ENOENT, exit 254 exit 0
pnpm build never ran exit 0
pnpm test never ran 293 passed, 2 failed

Known: this does not get CI fully green

Two tests/sdk-smoke.test.ts failures remain. They are pre-existing and unrelated to this change — this PR is what makes them run at all.

The SDK ships a committed dist/ that is stale against its own src/. Commit 673bc47 is titled "flip V17_PROGRAMS_DEPLOYED to true", and it does so in source, but the shipped bundle was never rebuilt:

  • src/config/program-ids.ts:65export const V17_PROGRAMS_DEPLOYED = true;
  • dist/index.js:2186var V17_PROGRAMS_DEPLOYED = false;

Consumers resolve dist/, so getMatcherProgramId("devnet") throws "v17 matcher program is not deployed for devnet". That is an SDK-repo fix (rebuild and commit dist/), reported separately to the sdk owner.

Merging this is still a strict improvement: it converts CI from permanently red at install with zero signal into 293 tests of real signal plus 2 correctly-reported defects.

Follow-up (not in this PR)

The docker job has the same latent bug — the Dockerfile runs pnpm install --frozen-lockfile with only package.json/pnpm-lock.yaml in the build context, so it will hit the same ENOENT. It is currently unreachable (needs: build-and-test, if: main), so this PR makes it reachable and it is expected to fail on main until fixed. I did not include a fix here because the Docker daemon was unavailable locally and I will not ship an unverified build change. Filed as a follow-up.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated continuous integration to fetch and stage the required SDK so local dependency resolution works during builds.
    • Added a safeguard to fail the workflow early if the SDK’s compiled output is missing.
  • Tests
    • Improved SDK smoke tests for v17 behavior by adding conditional devnet assertions when v17 programs are not deployed.

… it (#232)

package.json/pnpm-lock.yaml resolve @percolatorct/sdk as
`file:../../percolator-sdk`. CI checks out only this repo, so the path does
not exist and `pnpm install --frozen-lockfile` aborts with

    ENOENT: no such file or directory, scandir '/home/runner/work/percolator-sdk'
    exit 254

No api PR has had a green build-and-test since ~2026-06-26, so ~20 open PRs
are unverified. Same root cause and same remedy as percolator-indexer#172,
except the path is two levels up rather than one.

Checks the SDK out into the workspace and moves it to ../../percolator-sdk,
since actions/checkout cannot write outside GITHUB_WORKSPACE.

Verified locally against origin/main (b2751f4) in a scratch tree shaped like
the runner (work/percolator-api/percolator-api + work/percolator-sdk):

  before:  pnpm install --frozen-lockfile -> ENOENT, exit 254
  after:   pnpm install --frozen-lockfile -> exit 0
           pnpm build                     -> exit 0
           pnpm test                      -> 293 passed, 2 failed

The 2 remaining failures are pre-existing and unrelated to this change: the
SDK ships a committed dist/ that is stale against its own src/ (src sets
V17_PROGRAMS_DEPLOYED = true, dist/index.js still has false), so
getMatcherProgramId("devnet") throws in tests/sdk-smoke.test.ts. Tracked
separately for the SDK repo. This change is what makes those tests run at all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
percolator-api Error Error Jul 20, 2026 8:58pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7b054c38-e068-465c-9099-8f59bd38981c

📥 Commits

Reviewing files that changed from the base of the PR and between 4e08f20 and 7c320c5.

📒 Files selected for processing (1)
  • tests/sdk-smoke.test.ts

📝 Walkthrough

Walkthrough

The CI workflow checks out the sibling SDK required by the lockfile and verifies its build output. SDK smoke tests conditionally validate v17 program ID behavior based on deployment status.

Changes

SDK CI compatibility

Layer / File(s) Summary
Checkout and validate the local SDK
.github/workflows/ci.yml
The build-and-test job checks out the SDK, moves it to ../../percolator-sdk, and verifies that dist/index.js exists before dependency installation.
Gate program ID smoke tests by deployment state
tests/sdk-smoke.test.ts
Program ID assertions use V17_PROGRAMS_DEPLOYED to expect either deployment errors or valid PublicKey results for v17 programs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • dcccrypto/percolator-api issue 198 — Directly concerns checking out the missing SDK dependency in the CI workflow.
  • dcccrypto/percolator-api issue 234 — Related to the CI SDK checkout exposing a separate Docker build-context failure.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the CI sibling-checkout fix and matches the main change.
Linked Issues check ✅ Passed The sibling checkout provides the missing ../../percolator-sdk path and addresses the lockfile ENOENT blocker in #232.
Out of Scope Changes check ✅ Passed The test update is tied to CI validation and the SDK smoke-test failures discovered by the PR, so it is in scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/api-232-ci-sdk-sibling-checkout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dcccrypto

Copy link
Copy Markdown
Owner Author

CI confirms the unblock

The first run on this branch reproduced the local verification exactly:

step result
pnpm install --frozen-lockfile ✅ pass (previously ENOENT, exit 254)
pnpm build ✅ pass
pnpm test 293 passed, 2 failed

Run 29763307775

This is the first time build-and-test has gotten past install since ~2026-06-26. The job now executes and reports real results instead of dying during dependency resolution.

The 2 failures are the pre-existing stale-SDK-dist/ bug described above, now filed as dcccrypto/percolator-sdk#355:

Error: Percolator v17 program is not deployed for devnet ...
  ❯ getProgramId .../@percolatorct/sdk/dist/index.js:2216:11
  ❯ tests/sdk-smoke.test.ts:266:16

Error: Percolator v17 matcher program is not deployed for devnet ...
  ❯ getMatcherProgramId .../@percolatorct/sdk/dist/index.js:2239:11
  ❯ tests/sdk-smoke.test.ts:272:16

Both resolve through dist/index.js, where V17_PROGRAMS_DEPLOYED is still false even though src/config/program-ids.ts:65 sets it to true. Nothing in this repo can fix that — it needs the SDK's dist/ rebuilt.

So this PR will stay red until sdk#355 lands. It is still worth merging: the alternative is zero CI signal on ~20 PRs, versus 293 passing tests plus 2 accurately-reported real defects.

The docker job correctly shows skipping here (it is main-only); see #234 for why it is expected to fail once it becomes reachable.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

34-38: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add persist-credentials: false to the secondary checkout.

Since this checkout is only used to retrieve the SDK for local dependency installation and does not require pushing changes, you should disable credential persistence to improve the security posture and prevent the GitHub token from remaining in the local .git/config of the cloned repository.

🛡️ Proposed fix to disable credential persistence
       - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
         with:
           repository: dcccrypto/percolator-sdk
           ref: main
           path: _percolator-sdk
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 34 - 38, Update the secondary checkout
step using actions/checkout in the workflow to set persist-credentials to false
alongside its existing repository, ref, and path options; leave the primary
checkout and other workflow behavior unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 34-38: Update the secondary checkout step using actions/checkout
in the workflow to set persist-credentials to false alongside its existing
repository, ref, and path options; leave the primary checkout and other workflow
behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 65357645-1f1d-4d12-b7b2-9e39b2508ad4

📥 Commits

Reviewing files that changed from the base of the PR and between b2751f4 and 4e08f20.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

…gram IDs

The sibling-checkout fix unblocks `pnpm install`, but `pnpm test` still failed
2/295: tests/sdk-smoke.test.ts asserted that getProgramId("devnet") and
getMatcherProgramId("devnet") return a PublicKey. The v17 SDK deliberately
removed that behaviour — both fail closed while V17_PROGRAMS_DEPLOYED === false
so a v17 encoder can never be pointed at a legacy program that cannot decode
v17 instruction payloads (Phase 7 cutover gate).

Assert whichever half of the documented contract is live, keyed on the SDK's
exported V17_PROGRAMS_DEPLOYED flag, so the test stays honest after cutover
rather than needing another edit.

Verified in a CI-identical layout (sdk checked out as a sibling two levels up):
pnpm install --frozen-lockfile / pnpm build / pnpm test -> 25 files, 295 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dcccrypto

dcccrypto commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

Heads-up from infra: I opened #238, which fixes #232 at the dependency level instead of the workflow level. The two are complementary and touch disjoint files, so they will not conflict.

Your diagnosis in #232 was right, but the file:../../percolator-sdk path breaks three surfaces, and a sibling checkout can only fix one of them:

Surface #233 (sibling checkout) #238 (git tarball dep)
Actions build-and-test fixed fixed
Vercel (red on every api PR) still ENOENT now passes
Docker (#234) still broken fixed by construction

#238 pins @percolatorct/sdk to github:dcccrypto/percolator-sdk#673bc47 — the same revision your ref: main checkout resolves to — using the tarball form already used for @percolator/shared. The repo is public and commits dist/, so no publish is needed. Verified on #238's CI: Vercel green for the first time in ~33 days.

What I'd suggest:

Merging this first, then #238, should get build-and-test + Vercel + docker green together for the first time since ~2026-06-26.

@dcccrypto

Copy link
Copy Markdown
Owner Author

Note for reviewers: this PR is green for a reason worth knowing

build-and-test passes 295/295 here. The competing fix #238 pins the identical SDK SHA and
fails 2 tests. The entire delta is how the SDK resolves:

resolves to result
this PR (sibling checkout) src/ 295/295 pass
#238 (pinned git tarball) dist/ 2 fail

percolator-sdk's committed dist/ is stale at main — V17_PROGRAMS_DEPLOYED is true in
src/config/program-ids.ts:65 but false in dist/index.js:2186 (SDK commit #326 flipped the
flag without rebuilding). Filed as dcccrypto/percolator-sdk#356.

So this approach passes because it builds the SDK from source, which is not what
percolator-launch or percolator-keeper install — both pin git deps and receive dist/.
That gap is precisely what let the drift ship unnoticed.

Not arguing against merging this — it unblocks ~20 stacked api PRs and the CI change is sound.
Flagging that it should not be read as evidence the SDK dep is healthy, and that #238's approach
has real value as a consumer-faithful check once sdk#356 is fixed.

dcccrypto added a commit that referenced this pull request Jul 21, 2026
…gram ID

Pinning @percolatorct/sdk to a git tarball (this PR) fixed `pnpm install`,
but surfaced two real test failures: the v17 SDK fails closed and *throws*
from getProgramId()/getMatcherProgramId() while V17_PROGRAMS_DEPLOYED ===
false, rather than handing back a legacy address that cannot decode v17
instruction payloads.

Assert whichever half of that contract is live so the smoke test stays
honest across the Phase 7 cutover. Ported from #233, which fixed the same
two tests behind a CI sibling-checkout workaround that the tarball pin
makes unnecessary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dcccrypto

Copy link
Copy Markdown
Owner Author

Heads-up: I believe this is superseded by #238, which is now fully green.

#238 fixes the root cause in package.json — resolving @percolatorct/sdk from a pinned git tarball instead of file:../../percolator-sdk. That removes the need for the CI sibling-checkout step here, which has to rm -rf ../../percolator-sdk and mv outside GITHUB_WORKSPACE to work around the path dep, and which pins the SDK to a floating main rather than a reviewable SHA.

Your tests/sdk-smoke.test.ts fix was correct and necessary though — the v17 deployment-gate assertion is ported verbatim into #238 (credited in the commit message), since pinning the tarball surfaced those same two failures.

Leaving this open for you to confirm rather than closing it myself. If you agree, closing in favour of #238 is the cleaner path.

@dcccrypto

Copy link
Copy Markdown
Owner Author

Some evidence for whoever picks this up, because the api PR queue currently looks
far more broken than it is. The two red checks on it have different causes, and
only one is real.

I checked every open PR in this repo (27) rather than just mine:

Vercel — stale, not real. Red on 26 of 27 PRs, across all authors. Every
one of those failures ran on 2026-07-20/21 or earlier. The single green is
#240, whose check ran today at 08:57:

#240  Vercel=SUCCESS  2026-08-06T08:57   ← only recent run
#239  Vercel=FAILURE  2026-07-21T08:55
#237  Vercel=FAILURE  2026-07-20T20:04
#236  Vercel=FAILURE  2026-07-20T19:10
#235  Vercel=FAILURE  2026-07-20T18:12
#233  Vercel=FAILURE  2026-07-20T20:58
#231  Vercel=FAILURE  2026-06-27T04:39   (different author)

Whatever was wrong with the Vercel project was fixed between 21 July and today.
Those 26 reds are stale artifacts that would clear on any re-trigger — nobody
has touched those PRs, so nothing re-ran.

build-and-test — real, and this PR is the fix. Same check on #240 ran today
and still failed, at pnpm install --frozen-lockfile:

ENOENT: no such file or directory, scandir '/home/runner/work/percolator-sdk'
exit code 254

So that one is not stale — ci.yml on main genuinely still lacks the sibling
checkout. This PR is green on build-and-test precisely because it adds it.

Net: merging this turns build-and-test green across the queue, and a
re-trigger clears the Vercel reds independently. Between them, most of those 27
PRs are probably fine on their merits and have simply been unreadable behind two
red checks, one of which stopped being true two weeks ago.

I have not pushed empty commits to force re-runs — that is churn on other
people's branches, and #240 already demonstrates the outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BLOCKER] CI cannot install dependencies: lockfile references an unpublished file:../../percolator-sdk

1 participant