Skip to content

feat: add --force to cf deploy for CI conflict overrides - #163

Merged
petebacondarwin merged 7 commits into
mainfrom
investigate/issue-69
Nov 5, 2026
Merged

petebacondarwin merged 7 commits into
mainfrom
investigate/issue-69

Conversation

@penalosa

@penalosa penalosa commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add --force (-f) to cf deploy so CI deployments can proceed despite conflicting remote Worker changes. Deployments stay strict by default, and aborted uploads recommend cf deploy --force without printing a success message.

Forced real uploads warn on stderr, including with --quiet; dry runs omit the warning. Successful uploads without a version ID remain successful, and abort detection isolates pre-existing process exit codes. Version creation remains strict. Typed metadata, generated command catalogs, regression tests, and a minor changeset are included.

Addresses #69.

Dependencies

Updated onto current main and replaced the deploy-helpers preview with the released @cloudflare/deploy-helpers@0.26.0, which includes strictModeAbortMessage from cloudflare/workers-sdk#16020. Removed the temporary sibling overrides and preview documentation. All dependency manifests, the lockfile, and cleanup patches now match main.

Validation

  • Exact root pnpm check passes: generation, builds, workspace type checks, lint, and formatting.
  • 180 focused tests pass across deployment, version upload, deploy-input conversion, command metadata, previews, and triggers.
  • Regenerated metadata reviewed; only the two expected command catalogs differ from main. git diff --check passes.
  • GitHub CI runs on the updated head before merge.

@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/cf@163

commit: 5141199

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 174.8 ms 3.1 ms 169.5 ms 180.7 ms
base 180.0 ms 8.7 ms 171.2 ms 211.4 ms

Δ (PR vs base): ↓ -5.2 ms (-2.9%)

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.

@ask-bonk

ask-bonk Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🤖 I've done a thorough review of your PR.

Adds --force support for deploy conflict overrides and updates metadata/tests.

  1. Blocking: Posted one inline suggestion: successful deploys may legitimately return versionId: null, so the new null check can report failure after an upload completes.

github run

@ask-bonk

ask-bonk Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🤖 I've done a thorough review of your PR.

Adds --force to cf deploy with metadata and CI conflict coverage.

  1. Clarity: Posted a suggestion to avoid an overwrite warning during --dry-run, which cannot upload.

github run

Comment thread .changeset/force-deploy-conflicts.md Resolved
@ask-bonk

ask-bonk Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🤖 I've done a thorough review of your PR.

Adds cf deploy --force conflict overrides with metadata and coverage.

  1. Warning: Posted one inline suggestion to correct the changeset’s unsupported strict-abort guidance claim.

github run

@ask-bonk

ask-bonk Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

No new concerns since the last review

github run

@ask-bonk

ask-bonk Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

No new concerns since the last review

github run

@ask-bonk

ask-bonk Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

No new concerns since the last review

github run

@petebacondarwin
petebacondarwin requested review from a team and edmundhung and removed request for a team October 23, 2026 13:00
@ask-bonk

ask-bonk Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@ask-bonk

ask-bonk Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@clanky-the-clanker clanky-the-clanker 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.

Superseded by the review of 1d1c4ca5.

This review, of b3ea6520

💬 Approved with comments — The --force flag is wired in correctly and covered by tests. There are only two INFO notes: abort detection reads process.exitCode, and deploy-helpers comes from a commit-pinned preview build.

Findings: 2 info (2 are inline comments on the diff)

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


🔒 Security: 💬 1 info

Low risk. --force is an explicit opt-in that prints a warning. A production dependency now comes from a preview build.

Recommendation: 💬 Optional Nits

  • [INFO] The production dependency @cloudflare/deploy-helpers now comes from a commit-pinned pkg.pr.new preview build instead of the npm registry. (packages/cli/package.json:87)
View full review
  • strict: !argv.force keeps deploys strict by default, and a forced real upload warns on stderr. I found no auth bypass or injection.
  • @cloudflare/deploy-helpers moves from an npm release to a pkg.pr.new tarball. The tarball is pinned to a commit and the lockfile carries its integrity hash, the same approach the repository already uses for Forge. Overrides in pnpm-workspace.yaml keep the sibling packages on their registry releases.

📋 Code Quality: 💬 1 info

The flag is wired in consistently. Strict-abort detection reads process.exitCode, a process-global value, instead of a return value.

Recommendation: 💬 Optional Nits

  • [INFO] Strict-abort detection depends on deploy-helpers setting process.exitCode = 1 as a side effect. (packages/cli/src/commands/deploy/shared.ts:233)
View full review
  • Abort detection uses a global (packages/cli/src/commands/deploy/shared.ts:233): the code treats versionId === null && process.exitCode === 1 as a strict-mode abort. If exitCode is already 1 before the upload, a successful upload that returns no version ID would be reported as a failure, and Deploy complete would not be printed.

Checked and found fine:

  • -f does not clash with any reserved global alias.
  • force exists only on cf deploy.
  • The warning is skipped for --dry-run and still printed with --quiet.
  • The metadata sidecar and the generated catalogs match.

✅ All other checks passed

🚀 Release: ✅ LGTM

Risk: Low. The minor changeset fits a new flag.


📖 AGENTS.md: ✅ LGTM

No issues found.


⚡ Performance: ✅ LGTM

No performance concerns.


📝 Documentation: ✅ LGTM

No documentation issues.


Reviewed commit: b3ea6520

Comment thread packages/cli/package.json Resolved
@ask-bonk

ask-bonk Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@clanky-the-clanker clanky-the-clanker 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.

Superseded by the review of a722ab54.

This review, of 1d1c4ca5

✅ Approved — No findings. The --force flag is wired in correctly, and both earlier notes are settled: the exit-code fix in 1d1c4ca resolves the first, and the commit-pinned preview dependency is intentional and documented.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🚀 Release: ✅ LGTM

Risk: Low. The minor changeset fits a new flag.


🔒 Security: ✅ LGTM

Deploys stay strict by default, and turning strict mode off requires an explicit --force. The commit-pinned preview dependency is pinned by commit SHA and lockfile integrity, and its removal is documented.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

Strict-abort detection now uses only the exit code set during the helper call. The earlier exit code is saved and cleared before the call and restored in finally, and CliExit(1) is thrown after the finally block, so Deploy complete is not printed on an abort.


⚡ Performance: ✅ LGTM

No performance concerns.


📝 Documentation: ✅ LGTM

No documentation issues.


Reviewed commit: 1d1c4ca5

@clanky-the-clanker clanky-the-clanker 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.

Superseded by the review of 5141199a.

This review, of a722ab54

✅ Approved — No findings. Since the last approval only the dependency pin changed, and it is pinned by commit SHA and lockfile integrity. The --force behaviour, abort handling and exit-code handling are still correct.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🚀 Release: ✅ LGTM

Risk: Low. A minor changeset is the right level for a new flag.


🔒 Security: ✅ LGTM

--force is opt-in and only applies to cf deploy, and a forced upload prints a warning to stderr. The preview dependency is pinned by commit SHA and lockfile integrity, and the scoped overrides keep the sibling packages on their released npm versions.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

The deploy-helpers preview is pinned by full commit SHA and lockfile integrity, and the existing patch is still applied to it. Strict-abort detection uses only the exit code set during the helper call, restores any earlier exit code, and throws CliExit(1) without printing Deploy complete. --force is wired through the builder, the metadata, the generated catalogs and deploy-input.ts.


⚡ Performance: ✅ LGTM

No performance concerns.


📝 Documentation: ✅ LGTM

No documentation issues in the changed files. The flag is published in the command metadata and the generated catalogs, and docs/architecture.md records when the temporary overrides will be removed.


Reviewed commit: a722ab54

@ask-bonk

ask-bonk Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@clanky-the-clanker clanky-the-clanker 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.

✅ Approved — No findings. Since the last approval, the only change is the switch from the preview build to the released deploy-helpers 0.26.0, and the forced-deploy, abort and exit-code handling are still correct.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🚀 Release: ✅ LGTM

Risk: Low. A minor changeset is the right level for a new flag.


🔒 Security: ✅ LGTM

--force is opt-in, applies only to cf deploy, and a forced upload prints a warning to stderr. The runtime dependency now comes from a released npm version.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

--force/-f is wired through the builder, the metadata, the generated catalogs and deploy-input.ts. Abort detection clears and then restores the earlier exit code, so an upload that succeeds without a version ID is still a success, and a real abort is still caught when the exit code was already 1. Tests cover these cases.


⚡ Performance: ✅ LGTM

No performance concerns.


📝 Documentation: ✅ LGTM

The flag appears in the command metadata and in the generated catalogs.


Reviewed commit: 5141199a

@ask-bonk

ask-bonk Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@petebacondarwin
petebacondarwin added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 4fc2294 Nov 5, 2026
12 checks passed
@petebacondarwin
petebacondarwin deleted the investigate/issue-69 branch November 5, 2026 18:11
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