Skip to content

fix: identify production preflight stage - #5

Merged
lagrangee merged 1 commit into
mainfrom
codex/deploy-preflight-diagnostics
Aug 29, 2026
Merged

lagrangee merged 1 commit into
mainfrom
codex/deploy-preflight-diagnostics

Conversation

@lagrangee

Copy link
Copy Markdown
Owner

Problem

The first automatic main deployment correctly failed closed, but the production preflight collapsed four safe checks into one generic error. After the missing D1 migrations were applied and verified, the rerun still could not distinguish a Cloudflare API-token permission failure from custom-domain drift.

Change

  • preserve redaction of Cloudflare command output and private identifiers
  • report fixed, non-sensitive stage labels for Worker secret inventory, D1 identity, D1 schema/ledger, and custom-domain inventory
  • cover all four failure stages and redaction behavior

Verification

  • fnm exec --using=22 node --test tests/production-deploy.test.js
  • fnm exec --using=22 npm run typecheck
  • git diff --check

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T16:37:14.608196Z c7f7b79 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7f7b7979c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

]);
migrations = verifyD1SchemaAndMigrations(schemaOutput, localMigrationNames);
} catch {
throw fixedError("Cloudflare D1 schema preflight failed");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Name migration-ledger failures in the D1 stage

When the remote command succeeds but verifyD1SchemaAndMigrations rejects the migration ledger or foreign-key results, this catch rewrites the failure as Cloudflare D1 schema preflight failed. That incorrectly directs operators toward schema drift even when the schema signature passed and the applied migration filenames are the only problem; keep the message redacted, but name the combined schema/migration-ledger/integrity stage.

Useful? React with 👍 / 👎.

@lagrangee
lagrangee merged commit ea2b1cf into main Aug 29, 2026
1 check passed
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