Skip to content

fix: honor documented default-zero Cloud Run traffic - #619

Merged
Pigbibi merged 1 commit into
mainfrom
codex/readonly-route-traffic-shape
Oct 13, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
codex/readonly-route-traffic-shape

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Cloud Run REST v1 TrafficTarget 明确规定:percent 未指定时默认零。旧诊断把缺键与非法值一并拒绝,因此合法的 100% serving 流量加一个缺省零流量项也会被判为 unknown。本 PR 仅对字典行中完全缺少 percent 键采用该官方默认值,沿用既有零流量跳过逻辑;显式 null/bool/string/float、越界、非法行以及正流量 revision 歧义仍拒绝,完整 100% 覆盖条件保持。

另外附加固定 traffic_issue / traffic_detail 原因,便于在公开诊断中区分结构问题及 percent_default_zero;不输出真实值、名称、tag、URL、数量或自由错误。schema 兼容新增字段;token 固定版本、唯一容器、project-only 比较、中央 chat/topic unknown、隐私边界及生产行为保持。

验证:原 74 个回归完整保留,新 28 个回归覆盖官方默认零、显式非法类型、缺失与失败三态和 stdout/summary 隐私;初始 RED 两仓各 28 failed / 74 passed,修改后各 102 focused 通过。本地最终全量:IBKR 1675 passed / 5 既有 skipped;Schwab 2316 passed / 19 subtests / 0 skipped。新合法默认零用例确实复现旧源码误拒;这不等于真实 Schwab 原因已经确认,需最终 CI、正常合并后通过 main 只读结果确认。

权威来源:https://cloud.google.com/run/docs/reference/rest/v1/TrafficTarget (percent: “This defaults to zero if unspecified.”)。关联 QuantRuntimeSettings#632;不修改生产流量、secret、IAM、route、预算或交易,不发送 Telegram 消息。

@Pigbibi
Pigbibi merged commit fc09b46 into main Oct 13, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/readonly-route-traffic-shape branch October 13, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant