Repository navigation
refactor(cf-v2): manual persistent-dev dispatch uses the standard pipeline (remove the manual job) - #93
Draft
ClaudiaFang wants to merge 4 commits into
Draft
refactor(cf-v2): manual persistent-dev dispatch uses the standard pipeline (remove the manual job)#93ClaudiaFang wants to merge 4 commits into
ClaudiaFang wants to merge 4 commits into
Conversation
…eline (remove the manual delivery job and mode) A workflow_dispatch with dispatch_target=persistent-dev now only selects the persistent-dev kind in the Plan; CI, Plan, Migrate, Deploy, Smoke and conditional Rollback are the same as for an automatic Shared Dev push. The delivery workflow has only deploy / smoke / rollback; the manual job, input, legacy two-command contract and the engine mode input are removed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…add manual-dispatch failure tests Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…target, non-production D1 recovery guard, publish-only dev_deploy_cmd guard Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…cmd and the Wrangler guard); Dev CI env for automatic Persistent Dev Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A manual
workflow_dispatchof Persistent Dev no longer has its own implementation, and no caller can bring its own publish step. Exactly four delivery kinds (production,native-branch,native-dev,persistent-dev) share one audited engine and one DAG; the trigger decides when, the kind decides where.1. Before / after DAG
Before (manual):
workflow_dispatch -> persistent-dev / manual (build -> audit -> migrate -> publish by a caller command -> smoke); CI, Plan, Migrate and Revert skipped.After (manual and automatic identical):
Push / Dispatch -> CI + Validation Gate -> Plan -> Migrate (only if needed) -> Delivery(kind): Deploy -> Smoke -> Conditional Revert -> Release (verified Production only).2. Removed
manualjob, its input and routing; enginemode; the CI bypass for a dispatch.dev_deploy_cmdexecution,PUBLISH_CMD, and (after an intermediate revision) the whole guard layer built to police it -wrangler-guard.sh,wranglerPublishBlock,devPublishCmdBlock, thewrangler-guard/publish-cmd-checkCLIs, the shim installation and their tests. None of that exists in the final diff.dev_build_cmdorbuild_cmd) -> audit the effective Wrangler config and D1/Worker identity ->wrangler deploy --config <audited>(plus--env <dev env>only for an audited source config; flattened configs never take an env) -> Smoke. Config SHA, artifact digest, stale-SHA guards, D1 identity and "never migrate inside Deploy" are unchanged.dev_deploy_cmdstays declared but retired: a non-empty value fails the Plan before anything is built, migrated or published, with an explicit message (a stale caller gets that instead of a workflow-syntax error). All other public inputs and outputs are unchanged.3. Final modified files (23 vs
main; why each remains)Workflows:
_cf-worker-v2.yml(Planif, CI target env, retired input, concurrency/routing),_cf-worker-delivery.yml(manual job removed),_cf-worker-ci.yml+actions/cf-ci-check/action.yml(CI env input). Engine:delivery.mjs(target resolution, D1 recovery rule,ciTargetEnv),cli.mjs(plan rejection,recovery-guard),engine.sh(recovery guard, mode removal),publish.sh(reverted to the single publisher),actions/cf-deploy/action.yml. Docs/openspec (5 files + 2) updated to the final architecture. Tests:delivery.test.mjs,test-jobs.py,jobrunner.py,ghexpr.py(startsWith),run-job-groups.py,test-deploy.sh,test-workflow-contract.py.Net size: this PR vs
main: 23 files, +609 / -309. The final cleanup commit alone vs the previous PR head: 18 files, +104 / -312 (the guard layer and its tests removed).4. CI target environment
VITE_APP_ENV, imported build env)build_env_dev, sameVITE_APP_ENVas the automatic run)ciTargetEnv), exactly one build env imported,ci_envapplied after it, no Cloudflare credentials in CI, no extra job, no dependency on the Plan. The contract test compares the expression with the twin on 960 scenarios and checksdev<=> the run's only target (perresolveDeliveryTargets) is persistent-dev; executedcf-ci-checktests assert the actual values the CI commands receive.5. Preserved safety fixes
dispatch_targetfails closed (valid only forworkflow_dispatch, onlypersistent-dev, tag/PR/push/delete with a target ends red via the Planif:); non-Production recovery D1 guard (nonProdRecoveryBlock, same rule as Production; missing/mismatched/destructive/unattested -> blocked, D1 never reverted); one dedicated Migrate job; manual and automatic Dev share one concurrency group; Release only after a verified Production delivery (never from a dispatch).6. Consumers (public summary; detail kept out of this PR)
Every branch of every consumer workflow was searched for
dev_deploy_cmd. Exactly two hits: (a) one consumer app on its default branch (legacy persistent Dev command), whose open draft PR moves it to Native Dev and removes the input - that PR must be merged and its Native Dev deployment verified before the sharedv2tag moves; (b) a legacy-contract fixture inside the scratch-caller repo (test workflow; it will fail the Plan by design, retire or update it). All other consumers set nodev_deploy_cmd(Dev users already setdev_build_cmd) and are unaffected.v2stays unchanged. Merging this PR does not affect consumers by itself; only promotingv2does. No consumer repo was modified.7. Tests (actually run, HEAD of this PR)
scripts/cf-preview/test.sh full: workflow contract, node unit + cli, deploy, migrate, smoke, parse-env, probe, gh, testsh, gc unit, delivery chain groups (108s) all ok ->PASSED (full). Explicit regressions: Dev build -> audited config -> engine publish -> content Smoke -> verified; failed publish -> Deploy red,smoke_status=none, no recovery, no verified result, no Release; retireddev_deploy_cmd-> Plan fails with nothing built/migrated/published.Not run:
actionlintandshellcheck- not installed here and installing them was refused by the environment, so no result is claimed. The earlier reviewer actionlint run covers an older revision.8. Scratch-caller validation: not performed (blocker)
No authorized, isolated non-Production environment or credentials were available to this session, so none of the 8 live cases (automatic Dev push, approved / unauthorized / main dispatch, invalid target, successful Smoke, failed Smoke with recovery, failed Smoke after a destructive migration) was executed on GitHub Actions. All of them are covered only by the stub-based executed-chain tests. Needed: a run of the scratch caller pinned to this PR's SHA with an isolated scratch Worker + D1.
9. Known risks
if:, Dev CI env and the recovery guard are verified against stubs only.dev_deploy_cmdis a breaking change for any caller that sets it; the transition is an explicit Plan error, and only promotingv2exposes callers.d1_rollback_compat: expand-contractand the scan is additive (intended).moderemoval: nomodein the Shared Dev ledger payload, nocf-deploymode:input, no "(manual|auto)" in the summary.10. Recommendation
Ready for review; merge after approval.
v2: No-Go until (1) the consumer Native Dev PR is merged and verified, (2) the scratch-caller run on this SHA, (3) actionlint + shellcheck. No tag moved, nothing merged, no Production deploy.🤖 Generated with Claude Code