Repository navigation
hop→waker 迁移 · 切换:删原生 [triggers]、单一由 waker 驱动 - #164
Merged
todosdev[bot] merged 1 commit intoOct 29, 2026
Merged
Conversation
wrangler.toml declares [triggers] crons = [] so every deploy removes the native Cron Trigger (an absent section leaves it running). The deploy gate and guard tests now require no cron schedule instead of "0 3 * * *". Checkpoint: qQRfiv9Md25Mw4PJzvwAD
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
apps/worker/wrangler.toml的[triggers]改为crons = []。crons为空数组时删除全部 Cron Trigger,triggers为undefined时会保留已部署的调度(wrangler 4.103.0 的triggersDeploy同样以if (crons)门控PUT .../schedules)——字面删段会让旧 cron 继续跑。0 3 * * *在场,必须同 PR 翻转,否则 CI 红、部署必失败。Changes
部署配置
apps/worker/wrangler.toml:crons = ["0 3 * * *"]→crons = [],并重写段注释(为何用空数组、回滚=写回表达式后重新部署)。文件内不再出现任何 cron 表达式,且仅保留一条crons =声明。流水线闸门
.github/scripts/verify-deployment.sh:排期闸门反向——GET /workers/scripts/hop/schedules有任一 cron 即失败(文案含expected no cron schedules,并给出控制台/PUT /schedules空数组两种清理途径),成功输出Cron schedules: <none>;WAKER_SIGNING_KEY_EXPECTED=absent分支追加::warning::,说明原生 cron 移除后无 key 即清理完全不跑。.github/workflows/deploy.yml:仅两处文案/注释,删除「原生 Cron Trigger 不受影响」的旧说法;未引入triggers字样或任何模式变量。门禁测试
.github/scripts/test-waker-deploy.mjs:不变量翻转——[triggers]+crons = []、wrangler.toml零 cron 表达式、services/waker.ts的WAKER_JOB_CRON/WAKER_JOB_NIGHTLY_CLEANUP为唯一调度声明;闸门断言改为「必须要求零 cron」。.github/scripts/test-deploy-checks.mjs:默认 schedules 响应改为空数组、成功断言<none>;原「schedules 为空 → 失败」翻成「仍残留0 3 * * *→ 必须失败」;Inject 步用例断言产物为crons = []且不含 cron 表达式。文档与注释(不改行为)
README.md/README.zh-CN.md:章节改为「清理由 waker 独驱动」,状态表(无 key ⇒ 清理不跑)、空数组语义、部署核对<none>、回滚步骤,waker 任务表逐字保留,锚点链接同步。apps/worker/src/index.ts(scheduled()保留以便回滚)、apps/worker/src/services/waker.ts、apps/worker/.dev.vars.example:注释同步为 waker 独驱动。Testing
pnpm check→ 118 文件无问题;pnpm typecheck→ 2 packages;pnpm build→ 2 taskspnpm test→ worker 129/129、web 55/55(node)+ 4/4(vitest)shellcheck .github/scripts/*.sh→ 通过node --test .github/scripts/test-waker-deploy.mjs8/8、test-deploy-checks.mjs45/45(含新用例「仍残留原生 cron 0 3 * * * → 必须失败」)、test-d1-migrations.mjs18/18Cron schedules: <none>、exit 0;含0 3 * * *→::error::… expected no cron schedules、exit 1cd apps/worker && pnpm exec wrangler deploy --dry-run通过(配置被 wrangler 4.103.0 接受)grep -c '0 3 \* \* \*' apps/worker/wrangler.toml= 0;^crons仅crons = []GET /schedules复核(属用户关口,合并后由 Deploy 的 Verify 步输出Cron schedules: <none>作验收证据)apps/web/dist、.wrangler/均未入库)