Repository navigation
fix: honor documented default-zero Cloud Run traffic - #619
Merged
Merged
Conversation
6 of 14 tasks
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.
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 消息。