Skip to main content
Version: Alpha

Protected static and Worker previews

This page explains how Cloudflare-native Golf serves private previews of a change, which rules limit them and what a preview does not authorize. It is for reviewers who open previews and administrators who set preview rules.

A preview is a temporary running version of a change. It lets authorized reviewers try the result without publishing it to production.

Protected static and isolated Worker application previews

Editable Mermaid source · All architecture diagrams.

Static sites​

After approved tests pass, Golf can copy a selected directory into private R2 storage. A Preview Worker serves those files through a restricted internal service connection. Access verifies sign-in, then Golf checks repository permission and preview expiry.

Worker apps​

Workers for Platforms can run an approved, prebuilt Worker app. Each preview gets separate D1, R2 and signing resources. An Outbound Worker blocks unapproved Internet requests. Its domain and HTTPS configuration must preserve the same access checks.

Not yet supported

Arbitrary dependencies, service connections, cookies and WebSockets are not yet supported by this preview path. Optional Browser Run can capture static HTML without scripts; it does not provide full interactive app testing.

Preview rules and cleanup​

The environment named preview limits allowed branches, lifetime and the number of active previews when they are created or renewed. Hosted tests covered branch rejection, outdated settings and count limits. Renewal, automatic creation and app previews under these rules need more testing.

warning

Changing a policy does not yet revoke every existing preview that no longer meets it.

Maintenance removes expired previews. Cron events were missing in the reviewed account; Durable Object timers provided a fallback. Check Operations and the preview’s current state before relying on an old ready status.

Merging and production​

Native merging supports branches in the same repository. A merge whose target has not diverged is proven on hosted. Merges of diverged branches and squash are built, with conflicting paths listed, and await a hosted merge on Artifacts. Fork merges, drafts and locked targets are refused.

A working preview grants no permission to merge. Complete protected merging, general production deployment and rollback remain unfinished.