Repository navigation
feat(#622): 错峰时段串解析失败不再静默——启动告警 + 面板提示 - #629
modusensus wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
做什么
#622 的可观测性补丁。
parsePeakSpec的失败语义(整串视为未配置)不动——排程是省钱手段,绝不因为写错格式把蒸馏/巩固停掉;补的是可见性:配置写错的唯一症状从「功能悄悄没生效」(#424 的排查只能靠『高峰期还在巩固』倒推)变成启动日志一条 warn + 面板输入行下一条红色提示。实现
src/index.js):cfg 装配后对summarizePeakHours/dreamPeakHours各跑一次解析——非空且解析为 null 时logger.warn(键名 + 原串 + 正确写法示例)。空串是合法的未配置,不告警(验收第 2 条);行为零变化,只 log。src/api.js+lib/client.js):GET/PUT /features答复新增invalidPeakHours——校验在服务端用同一份parsePeakSpec算好,面板只渲染(独立 bundle 复制解析器必然漂移;与 config-keys 卡「分类在服务端算好」同一纪律)。PUT 同走featureSnapshot,保存后提示立即跟着换。src/peak-hours.js):新增PEAK_SPEC_KEYS+invalidPeakSpecs(cfg)。helper 只转述解析器:等价类归一(PR fix(peak-hours): 全角等价符号归一,错峰串不再静默失效(#424) #621,评审中)落地后救得了的写法自然不再告警,两批无需联动(本 PR 基线未含 fix(peak-hours): 全角等价符号归一,错峰串不再静默失效(#424) #621,全角串当前确实解析失败,告警是当前真话)。验证
npm test:3159 / 3158 通过 / 0 失败 / 1 跳过;check-sync 通过(118 文件)。test/peak-hours-observability.test.js3 条(helper 只报「非空且解析失败」+ 全角现状断言 + 接线锁:告警读装配后的 cfg、不改写 cfg、排在 sessionGate 之前);test/api.test.js+1(GET/PUT 答复字段与 helper 同源,合法/空串不报);test/client.test.js+1(提示行走服务端字段、反拷贝锁匹配调用形态、i18n 双语键成对)。pendingRestart逐字保留);euthyna gate2/2 通过(exit 0)。报告在车道本地不入库。Closes #622