feat(#5631)!: make --preview accept alias for real Wrangler preview upload - #5639
Conversation
…load The --preview flag for `mint deploy --platform=cloudflare` was a bare boolean that did not change the underlying deploy behavior — it still ran `wrangler deploy` (production) and teardown deleted the entire Worker script. This change makes --preview accept a string alias value (e.g. --preview=bt-run-42) and passes it through to Wrangler as --preview-alias. When set: - Deploy uses `wrangler versions upload --preview-alias=<alias>` instead of `wrangler deploy`, so the durable Worker script is not affected by preview deploys. - The preview mint URL is deterministic from the alias and worker name: https://<alias>-<worker-name>.workers.dev — callers (BT) can compute this and pass it to github setup / enroll. - Teardown abandons the preview alias (no-op) rather than deleting the durable Worker script via `wrangler delete`. The WranglerRunner.Deploy interface changes from `preview bool` to `previewAlias string` (empty = durable, non-empty = preview). Legacy bare-preview teardown (DeployPreview without alias) still falls back to `wrangler delete` for backward compatibility. Closes #5631
|
🤖 Finished Review · ✅ Success · Started 11:37 AM UTC · Completed 11:52 AM UTC |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ReviewAll prior findings from the previous review have been addressed:
FindingsLow
Previous runReviewAll prior findings from the previous review have been addressed:
FindingsMedium
Low
Previous run (2)ReviewFindingsCritical
High
Medium
Low
Labels: PR modifies mint deploy CLI and Cloudflare dispatch provisioner (Go code) |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 12:01 PM UTC · Completed 12:11 PM UTC |
- Update docs/cli/mint.md: document --preview=<alias> syntax, change default from false to "" in flags table - Add --keep-vars to deployPreview() for parity with deployDurable(), preventing PEM secret wipe on preview deploys - Add defensive validation: DeployPreview requires non-empty PreviewAlias to prevent durable deploy + destructive teardown mismatch - Capture previewAlias in CLI fake and assert it in preview deploy test BREAKING CHANGE: Replace bare --preview with --preview=<alias> where <alias> is a 2-63 char lowercase alphanumeric/hyphen string. Previously accepted input (--preview without a value) is now rejected. Addresses review feedback on #5639
🔧 Fix agent — iteration 1 (human-triggered)Addressed all 5 review findings: updated docs for new --preview= syntax, added --keep-vars to preview deploys for secret safety, added defensive validation against DeployPreview without alias, and captured previewAlias in CLI test fake with assertion. PR title ! suffix requires manual update (sandbox limitation). Fixed (5):
Tests: passed Decision points
Updated by fullsend fix agent |
Site previewPreview: https://f623cff2-site.fullsend-ai.workers.dev Commit: |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 7:58 PM UTC · Completed 8:14 PM UTC |
Superseded by updated review
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 8:53 AM UTC · Completed 9:03 AM UTC |
- Remove .<subdomain> from preview URL pattern in CLI help text and Config.PreviewAlias doc comment to match the actual URL constructed by the code (https://<alias>-<worker-name>.workers.dev) - Remove unreachable legacy Teardown path (DeployPreview with empty PreviewAlias) since validate() now enforces non-empty PreviewAlias; remove corresponding tests that bypassed validate() - Use deterministic preview URL directly in deployPreview() instead of calling parseWorkerURL, which could match the production Worker URL as a false positive Addresses review feedback on #5639
🔧 Fix agent — iteration 2 (human-triggered)Addressed all 3 review findings: fixed URL pattern mismatch by removing . from help text and doc comment, removed unreachable legacy Teardown path and its tests, and eliminated parseWorkerURL false-positive risk in deployPreview by using deterministic URL directly. Fixed (3):
Tests: passed Decision points
Updated by fullsend fix agent |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 9:51 AM UTC · Completed 10:12 AM UTC |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 10:41 AM UTC · Completed 10:49 AM UTC |
Add symmetric validation guard: reject Config where DeployMode is not DeployPreview but PreviewAlias is non-empty. Without this, Provision routes on PreviewAlias (→ preview deploy) while Teardown routes on DeployMode (→ rejected), creating an unteardownable preview config. Addresses review feedback on #5639
🔧 Fix agent — iteration 3 (human-triggered)Fixed 1 of 2 review findings. Added symmetric validate() guard for DeployDurable with non-empty PreviewAlias (prevents unteardownable preview configs). Disagreed with 1 finding (deterministic URL pattern is a documented design choice acknowledged by the reviewer). Fixed (1):
Disagreed (1):
Tests: passed Updated by fullsend fix agent |
rh-hemartin
left a comment
There was a problem hiding this comment.
Makes sense to me so we can kind of control where it goes and decide some prefixes for the environments.
|
🤖 Finished Retro · ✅ Success · Started 6:07 AM UTC · Completed 7:04 AM UTC |
Retro: PR #5639 —
|
| Time (UTC) | Event |
|---|---|
| Jul 27, 10:09 | Issue #5631 created by ifireball |
| Jul 27, 10:10–10:15 | Triage agent ran successfully |
| Jul 27, 11:19–11:35 | Code agent created PR #5639 (16 min) |
| Jul 27, 11:36–11:52 | Review agent iteration 1: 5 findings (1 critical, 1 high, 1 medium, 2 low). Submitted DISMISSED review |
| Jul 27, 11:52 | Auto-fix run 30263592039 failed — misidentified bot-authored PR as human-authored |
| Jul 27, 11:59 | ifireball manually triggered /fs-fix |
| Jul 27, 11:59–12:12 | Fix agent iteration 1: addressed all 5 findings |
| Jul 27, 19:57 | ifireball manually triggered /fs-review (7.75-hour gap) |
| Jul 27, 19:57–20:14 | Review agent iteration 2: confirmed 5 prior findings addressed, raised 3 new (1 medium, 2 low). Submitted COMMENTED review |
| Jul 28, 08:51 | ifireball manually triggered /fs-fix |
| Jul 28, 08:51–09:03 | Fix agent iteration 2: addressed 3 findings |
| Jul 28, 08:53 | ifireball APPROVED |
| Jul 28, 09:49 | ifireball manually triggered /fs-review |
| Jul 28, 09:49–10:12 | Review agent iteration 3: confirmed 3 prior addressed, raised 2 low findings. APPROVED |
| Jul 28, 10:39 | ifireball manually triggered /fs-fix for remaining low finding |
| Jul 28, 10:39–10:49 | Fix agent iteration 3: fixed 1, correctly disagreed with 1 |
| Jul 28, 11:16 | ifireball APPROVED, enabled auto-merge |
| Jul 28, 11:30 | rh-hemartin APPROVED |
| Aug 3, 05:56 | ifireball manually added to merge queue (6-day gap — see proposal) |
| Aug 3, 06:05 | Merged |
What went well
Review agent quality was excellent. Across 3 iterations, the agent raised 10 findings: 9 true positives (90%) and 0 false positives. The single borderline finding (deterministic URL pattern) was self-acknowledged as a documented design choice, and the fix agent correctly disagreed. High-value catches included a medium-severity secret-exposure risk (--keep-vars omission that could wipe PEM secrets) and a critical breaking-change-unmarked PR title. Severity calibration was appropriate throughout.
Fix agent showed good judgment. Addressed 9 of 9 actionable findings reliably and correctly pushed back on 1 finding with sound reasoning. All fix iterations passed tests including the race detector.
Human review delta was zero. Neither human reviewer (ifireball, rh-hemartin) identified issues the review agent missed. All 10 substantive code review findings came from the agent.
Evidence for existing open issues
- #5536 / #1569 (bot detection): Auto-fix run 30263592039 failed because
gh pr view --json authorreturnedapp/fullsend-ai-coder(no[bot]suffix) and the eligibility regex[bot]$didn't match, treating the bot-authored PR as human-authored. This required ifireball to manually trigger/fs-fixfor every iteration. - #5666 (auto re-review after fix): There was a 7.75-hour gap between fix iteration 1 completing (Jul 27 12:12 UTC) and ifireball manually triggering
/fs-review(Jul 27 19:57 UTC). Automated re-review dispatch after fix pushes would have eliminated this idle time. - agents#421 / agents#563 (breaking-change detection): The code agent produced a breaking change (CLI flag type change) without the
!suffix in the PR title, despite AGENTS.md and COMMITS.md explicitly requiring it. This was the review agent's critical finding. - #1088 (code agent self-review loop): 3 of 5 initial findings were avoidable with context the repo already provides — the breaking-change marker, the outdated docs, and the missing test assertion. A pre-PR self-review would likely have reduced iterations from 3 to 1.
- agents#543 (cascading findings): Fix iteration 1 added a
validate()guard, which made the legacy teardown path dead code — caught in iteration 2. This cascading pattern is inherent to iterative fixing. - agents#380 (symmetric defensive patterns): The code agent created
deployPreview()as a sibling ofdeployDurable()but dropped the--keep-varssafety flag. The sibling method's argument list was visible in the same file. - #1582 (first-pass completeness): Review iteration 1 missed the URL pattern mismatch and
parseWorkerURLrisk that were present in the original commit; these were only found in iteration 2.
Proposals filed
- Auto-merge cannot enqueue PRs on merge-queue-enabled branches with strict status checks (in
fullsend-ai/fullsend)
Summary
Makes
mint deploy --platform=cloudflare --preview=<alias>perform a real Wrangler preview upload instead of a production deploy. The--previewflag changes from a bare boolean to a string that accepts a preview alias, which is passed through to Wrangler as--preview-alias.Related Issue
Closes #5631
Changes
--previewflag: Changed fromBoolVartoStringVar. Value is the preview alias (e.g.--preview=bt-run-42)wrangler versions upload --preview-alias=<alias>instead ofwrangler deploy, so the durable Worker script is not affectedhttps://<alias>-<worker-name>.workers.dev— callers can compute this without scraping Wrangler outputwrangler deleteWranglerRunner.Deployinterface:preview bool→previewAlias string(empty = durable, non-empty = preview)ValidatePreviewAlias()with same rules as Worker names (2-63 lowercase alphanumeric/hyphens)wrangler deleteTesting
go vetpasses on changed packagesNote:
pre-commitcould not run in sandbox due to network restrictions (git fetch blocked). The post-script runs authoritative pre-commit on the runner.Closes #5631
Post-script verification
agent/5631-cf-preview-alias)6d3cb1f2fe81fe4c3a315d5234f0624b19281620..HEAD)