Skip to content

Test the pgstencil provenance gate before a Hosted production deploy - #1489

Merged
nedtwigg merged 1 commit into
mainfrom
test/verify-packages-provenance
Nov 1, 2026
Merged

nedtwigg merged 1 commit into
mainfrom
test/verify-packages-provenance

Conversation

@dormouse-bot

Copy link
Copy Markdown
Collaborator

docs/specs/security-hosted.md → "Deployment boundary" names hosted/scripts/production.test.mjs as pinning the check that a production deploy runs only clean pgstencil builds, but no test called verifyPackages. Removing any of its three assertions (40-hex commit, not dirty, one commit across all three packages) left CI green. That function gates the verify job in .github/workflows/hosted-production.yml, which deploy needs.

verifyPackages now takes an optional provenance reader. The default is the old behaviour: read provenance.json beside each package's resolved entrypoint. The new test covers the accepted case and each refusal: a short commit, an uppercase commit, a missing commit, a dirty build, and packages built from different commits. The format cases apply to all three packages so the same-commit check can't mask them.

Verification: with each assertion removed in turn, and with the hex check widened to uppercase, the new test fails; with the code as it is, it passes. The rest of production.test.mjs passes on Node 24. The default verifyPackages() passes against the locally installed packages.

security-hosted.md names production.test.mjs as pinning the provenance
check before a production deploy, but no test called verifyPackages.
Inject the provenance reader and cover each refusal: a malformed or
uppercase commit, a missing commit, a dirty build, and packages built
from different commits.

Co-Authored-By: Claude <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 309d134
Status: ✅  Deploy successful!
Preview URL: https://76fb5cc7.mouseterm.pages.dev
Branch Preview URL: https://test-verify-packages-provena.mouseterm.pages.dev

View logs

@nedtwigg
nedtwigg merged commit d9beaea into main Nov 1, 2026
12 checks passed
@nedtwigg
nedtwigg deleted the test/verify-packages-provenance branch November 1, 2026 21:05
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.

2 participants