Repository navigation
Support cross-account service bindings - #542
irvinebroque wants to merge 3 commits into
Conversation
commit: |
|
| 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.
| 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/ | ||
| ); | ||
| } | ||
| }); |
There was a problem hiding this comment.
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:
| 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); | |
| } | |
| }); |
|
🤖 I've done a thorough review of your PR. Pins Workers SDK prereleases to preserve cross-account service bindings.
|
|
LGTM! |
|
LGTM! |
Support cross-account service bindings in
cloudflare.config.tsand 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.