Repository navigation
fix(scheduler): 补齐 2027 年中国工作日历 - #3904
Merged
Merged
Conversation
xiongz-c
requested review from
47seek,
LucasIcarus,
deepcoldy and
xiaoxueSunn
as code owners
November 27, 2026 03:52
deepcoldy
reviewed
Nov 27, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
复审结论:0 个阻断项,代码与数据通过;CI 待全绿收口
复审对象:7bf14767efbf789bfdd81370169e54d6648db54a。该提交直接基于当前 origin/master(0e69a2de),差异为 9 个文件、+89/-68。未发现需要修改的代码或数据问题;发布本评论时仍有 build、bun-binary 及部分 test/bun-test 分片未完成,合并仍以 CI 全绿为准。
独立核对
- 权威来源与数据一致:读取国办发明电〔2026〕10号 gov.cn 正文及政府网站转载,2027 年七段安排逐条为:元旦 01-01..01-03、春节 02-05..02-13、清明 04-03..04-05、劳动节 05-01..05-05、端午 06-09、中秋 09-15、国庆 10-01..10-07;补班为 01-31、02-14、05-08、09-26、10-09。与
src/services/work-calendars/cn.json:19-40完全一致。2026 年通知也重新读取,旧文件中的 33 个休息日、6 个补班日、时区和 workWeek 均逐字保留。 - 730 天独立探针:期望表由两份通知独立转录,经真实
checkWorkCalendar逐日检查 2026、2027 全年的日期、状态和原因码,并核验 62 个休息日、11 个补班日、排序、coverage 与来源元数据,共 2216 项断言全部通过。北京时间边界正确:2026-01-01 首日可判,2027-12-31 仍可判,2028-01-01 返回calendar_out_of_coverage,与src/services/work-calendar.ts:142-148的 fail-closed 路径一致。 - 编译态实测:将同一探针用
bun build --compile编成独立单文件二进制,在无源码 JSON 读取路径下复跑全年与边界检查,2211 项断言全部通过。bun run build通过,资产审计输出19 dist asset(s) accounted for;src/services/work-calendars/catalog.ts:1与scripts/audit-embedded-assets.mjs:54的重命名相互匹配,HEAD 无cn-2026残留。 - CLI 用户面:通过构建产物执行
schedule calendars --lark-app-id pr3904_review,实际输出cn的dataVersion=2027.1、coverage2026-01-01..2027-12-31和完整日期表。 - 定向测试:
bun run test test/work-calendar.test.ts test/scheduler-calendar.test.ts test/schedule-cli-update.test.ts为 153/154 通过。唯一失败test/schedule-cli-update.test.ts:676是 root 下chmod 0o000不产生 EACCES 的环境性失败;在父提交0e69a2de的独立临时 worktree 中单独复跑同一条,仍以相同断言失败,确认不是本 PR 引入。 - 变异复验:临时删除
2027-06-09后,test/work-calendar.test.ts精确咬红,报告该日由期望的rest_date/rest变为work_week/working;恢复后该文件 43/43 通过,git diff --exit-code HEAD --通过,工作树无残留。 git diff --check通过。调度器、持久化格式、CLI/IM/后端执行逻辑未改;存量cn绑定无需迁移,自定义日历与无日历任务不受影响。2028 年及以后仍按覆盖不足停止自动执行,不作节假日推算。
Owner
|
感谢贡献,已合并。 评审中按国务院办公厅国办发明电〔2026〕10号原文逐日核对了 2027 年七段假期(29 天休息日)与 5 个周末补班日,并确认 2026 年数据逐字保留、coverage 扩至 2027-12-31 后 2028 年仍按 |
|
@xiongz-c @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 7fe5bdc…63f6dcb16(4 个提交),同批合入的还有 #3880 #3903 #3907,失败不一定由本 PR 引起。
|
This was referenced Nov 27, 2026
|
🚀 Released in v3.59.36 |
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.
跨年行为
#1662 引入的内置
cn日历只覆盖到 2026-12-31。北京时间进入 2027 年后,绑定该日历的工作日任务和休息日任务都会跳过自动执行并记录calendar_out_of_coverage。依据国务院办公厅发布的安排,补齐 2027 年的 7 段假期(29 天)及 5 个周末补班日,保留 2026 年数据。升级后,现有任务按原绑定继续运行。例如,每天 09:00 的工作日任务在元旦假期后于 1 月 4 日执行,1 月 31 日(周日)也可正常触发。2027 年通知(国办发明电〔2026〕10号) · 政府网站转载
影响范围
更新内置日历数据、静态资源引用和中英文使用文档。调度器、持久化格式及 CLI、IM、后端各自的执行路径沿用原实现。自定义日历与无日历绑定的任务不受影响。已核实范围截至 2027-12-31,再往后的日期仍记录覆盖不足。
验证
bun run test test/work-calendar.test.ts test/scheduler-calendar.test.ts test/schedule-cli-update.test.ts通过,3 个文件共 154 项。按两份年度通知逐日核对 730 天的判定及原因码,覆盖北京时间跨年、下次触发预览、调度器实际准入和 CLI 绑定。bun run build通过,含类型检查、打包及静态资源审计。通过构建产物运行schedule calendars,回读到cn版本2027.1和完整覆盖范围。bun build --compile编译日历模块,在独立可执行文件中验证了元旦休息、1 月 4 日工作、1 月 31 日补班和 2028 年越界。git diff --check通过。