Search Blog

Knowledge · Codex

Codex Created a Draft PR — So Where Is the Preview?

Understanding GitHub pull requests, Cloudflare Previews, and production deployment

A practical follow-up on why a Draft PR is not a website preview, and how to verify each step from code review to production.

When I first started building websites with Codex, GitHub terminology was unfamiliar.

Codex sometimes reported that it had created a pull request. At other times, it left a Draft PR, or suggested checking a Preview. All three sounded like ways to inspect unfinished work. It took actual projects to understand that they served different purposes.

A Draft PR is not a preview website

A GitHub pull request (PR) proposes changes from one branch to another and provides a place to review them. A Draft PR signals that those changes are not yet ready for formal review.

Creating a Draft PR does not automatically create a rendered website.

TermWhat it represents
Feature branchAn isolated line of work
Draft PRA pull request not ready for formal review
Ready for reviewA pull request prepared for review
PreviewA separate deployment to inspect the changed website
MergeIntegration into the target branch
ProductionThe live service environment

GitHub does not allow a Draft PR to be merged until it is marked ready for review. Even switching to Ready for review does not publish a website.

I previously explained main, branch, commit, push, and merge. This article picks up where that introduction ends: how do those Git states differ from a preview or a production deployment?

Related readingGitHub Main and Branches — What Is the Difference?

Learn how Git and GitHub differ, and how main, branches, commits, pushes, Pull Requests, merges, and production deployments fit into a website workflow.

Review code in the PR; inspect the interface in Preview

Imagine asking Codex to change the homepage design. A PR helps review the modified HTML and CSS, compare them with the previous version, and see automated checks.

A Cloudflare Preview instead shows how the changes render in a browser. Something that looks correct in a diff may still have overlapping text on mobile or an inconsistent clickable card area.

Code review and visual review are not the same step.

Does a Draft PR automatically create a Preview?

No. If Cloudflare Workers Builds has Preview Builds enabled, a push to a non-production branch can trigger a Preview build. What happens depends on the project's Git connection and build settings; it does not depend on whether the associated PR is marked Draft.

Worker Previews can provide a Preview URL pointing to the branch's latest deployment and a separate Deployment URL fixed to one particular build.

When Codex reports that it created a Draft PR, ask two separate questions:

  1. Are there changes ready to inspect on GitHub?
  2. Was an accessible Preview URL actually generated?

If no Preview exists, inspect the Git integration, branch build settings, and logs rather than recreating the PR.

The workflow I use

ONSEMO websites are connected to GitHub and Cloudflare. A typical change follows these steps:

  1. Codex edits files on a working branch.
  2. I review the changes and run relevant checks.
  3. I inspect the PR diff and CI results.
  4. If the change needs visual review, I inspect the Cloudflare Preview.
  5. I merge the reviewed PR into main.
  6. I check the Production build and deployment.
  7. I verify the result at the public site URL.

A Draft PR can be useful while the work is in progress. A regular PR is fine when the changes are already ready for review. Draft is not a compulsory stage.

I merged into main. Why hasn't the site changed?

A successful merge is not the same as a successful deployment. The Cloudflare build may still be running or may have failed. I compare the merge commit in GitHub with the commit deployed to Production before assuming the browser cache is responsible.

A Preview is also independent from Production and may remain after a merge. I discussed the visibility and access implications of such Previews in an earlier article.

Related readingCan I Privately Preview Blog Posts from a GitHub Branch?

Why I chose to review Markdown drafts with ChatGPT and reserve Cloudflare Workers Preview for visual checks, instead of treating private GitHub branches as private preview websites.

A separate guide covers the cleanup of branch Previews with GitHub Actions.

Related readingCleaning Up Cloudflare Previews Automatically with GitHub Actions

How to connect GitHub Actions to Cloudflare Workers Builds and Preview APIs, verify the successful production deployment, and delete only the intended Preview.

What does 'finished' actually mean?

Codex saying the code change is complete, GitHub showing a PR, a Preview opening correctly, and a production website updating are four distinct events.

Separating creation, review, and live deployment helps me know what was verified and where to investigate a failure.

References

CodexDeveloper toolsCodexDraft PRGitHubPull RequestPreviewCloudflaredeployment
Connected projectsBLOG