Skip to content

Support cross-account service bindings - #542

Draft
irvinebroque wants to merge 3 commits into
mainfrom
codex/cross-account-service-bindings
Draft

irvinebroque wants to merge 3 commits into
mainfrom
codex/cross-account-service-bindings

Conversation

@irvinebroque

Copy link
Copy Markdown
Contributor

Support cross-account service bindings in cloudflare.config.ts and Build Output by consuming the shared SDK changes in cloudflare/workers-sdk#16764. Preserve account selection through upload, migration, and remote development.

Pin one SDK commit for premerge testing, keep the existing container patches, and restrict prerelease resolution to those exact packages and commit. Replace the pins with SDK releases before the stable release.

Validation: frozen install, pnpm check, and 35 focused tests pass.

@pkg-pr-new

pkg-pr-new Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/cf@542

commit: 85f62c7

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 264.0 ms 4.9 ms 255.8 ms 274.1 ms
base 265.6 ms 4.8 ms 255.5 ms 276.1 ms

Δ (PR vs base): ↓ -1.6 ms (-0.6%)

Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.

Comment on lines +28 to +57
await test("leaves other exotic dependencies blocked by the existing policy", () => {
for (const wanted of [
{
alias: "@cloudflare/config",
bareSpecifier: "https://pkg.pr.new/@cloudflare/config@main",
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://example.com/@cloudflare/config@${commit}`,
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://pkg.pr.new/other/repo/@cloudflare/config@${commit.slice(0, 7)}`,
},
{
alias: "unrelated",
bareSpecifier: `https://pkg.pr.new/unrelated@${commit}`,
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://pkg.pr.new/@cloudflare/config@${commit}?other=true`,
},
]) {
assert.equal(resolver.canResolve(wanted), false);
assert.throws(
() => resolver.resolve(wanted),
/Unapproved Workers SDK prerelease/
);
}
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pnpm invokes resolve() only after canResolve() succeeds, so the current assert.throws() branch is unreachable during an install. The test therefore does not prove that the existing exotic-subdependency policy blocks these sources and would still pass if that policy were removed. Limit this unit test to the resolver's actual rejection path; cover the pnpm policy with an install-level fixture if it needs regression coverage:

Suggested change
await test("leaves other exotic dependencies blocked by the existing policy", () => {
for (const wanted of [
{
alias: "@cloudflare/config",
bareSpecifier: "https://pkg.pr.new/@cloudflare/config@main",
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://example.com/@cloudflare/config@${commit}`,
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://pkg.pr.new/other/repo/@cloudflare/config@${commit.slice(0, 7)}`,
},
{
alias: "unrelated",
bareSpecifier: `https://pkg.pr.new/unrelated@${commit}`,
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://pkg.pr.new/@cloudflare/config@${commit}?other=true`,
},
]) {
assert.equal(resolver.canResolve(wanted), false);
assert.throws(
() => resolver.resolve(wanted),
/Unapproved Workers SDK prerelease/
);
}
});
await test("rejects unapproved Workers SDK prerelease sources", () => {
for (const wanted of [
{
alias: "@cloudflare/config",
bareSpecifier: "https://pkg.pr.new/@cloudflare/config@main",
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://example.com/@cloudflare/config@${commit}`,
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://pkg.pr.new/other/repo/@cloudflare/config@${commit.slice(0, 7)}`,
},
{
alias: "unrelated",
bareSpecifier: `https://pkg.pr.new/unrelated@${commit}`,
},
{
alias: "@cloudflare/config",
bareSpecifier: `https://pkg.pr.new/@cloudflare/config@${commit}?other=true`,
},
]) {
assert.equal(resolver.canResolve(wanted), false);
}
});

@ask-bonk

ask-bonk Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🤖 I've done a thorough review of your PR.

Pins Workers SDK prereleases to preserve cross-account service bindings.

  1. Warning: resolver policy test can pass without exercising pnpm’s block behavior. Posted an inline suggestion on scripts/pinned-workers-sdk-resolver.test.mjs.

github run

@ask-bonk

ask-bonk Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@ask-bonk

ask-bonk Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

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.

1 participant