fix(butler): 熔断变量创建端点勘误(POST 集合端点+value 字符串)(W1-C5 #168,ADR-0057) - #181
Conversation
…304 抓出;同修 cost-check set_breaker 同款潜伏 bug)(W1-C5 #168,ADR-0057/ADR-0040)
|
Warning Review limit reached
Next review available in: 1 minute Limit details: You’ve used all 10 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Comment |
PR Summary by QodoFix org breaker variable creation in deadman-trip workflow and cost-check
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a latent bug in the “breaker” org variable mutation logic used by the butler dead-man trip and cost-check paths, ensuring org variable creation uses the correct REST collection endpoint and that value is sent as a string (per API expectations). It also updates reset/runbook instructions to match the corrected gh api flag usage.
Changes:
- Fix org variable creation to
POST orgs/{org}/actions/variables(collection endpoint), not.../variables/{name}. - Send
value=true|falseas a string via-f/--raw-fieldrather than typed-F/--fieldto avoid 422 type errors. - Update operational reset instructions in both workflow output text and docs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
governance/cost-check.sh |
Corrects breaker variable PATCH/POST logic to use the proper POST endpoint and string value. |
docs/deadman-setup.md |
Updates the documented reset command to use -f value=false (string). |
.github/workflows/butler-deadman-trip.yml |
Fixes org variable creation endpoint and ensures value is sent as a string; aligns reset guidance text. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| set_breaker() { # PATCH 已有 / POST 新建(404 时) | ||
| # 端点勘误(2026-08-21 deadman 演习实测):创建 org 变量必须 POST 到集合端点 |
| # 1) 置共用熔断变量(PATCH 已有 / 404 时 POST 新建——同 cost-check.sh set_breaker) | ||
| if ! gh api -X PATCH "orgs/$ORG/actions/variables/$CB" -f name="$CB" -F value=true >/dev/null 2>&1; then | ||
| if ! gh api -X POST "orgs/$ORG/actions/variables/$CB" -f name="$CB" -F value=true -f visibility=all >/dev/null 2>&1; then | ||
| # 端点勘误(2026-08-21 首次演习实测):POST 须打集合端点 /actions/variables |
Code Review by Qodo
1. PR body missing ADR-####
|
动机
deadman trip 首次演习(run 32481546304)抓出潜伏 bug:创建 org 变量的 POST 打到了
/actions/variables/<name>(正确=集合端点/actions/variables,带名 POST=404),且-F value=true发送布尔(API 要字符串=422)。两错叠加 → 变量从未真正创建成功。变更
.github/workflows/butler-deadman-trip.yml:POST 集合端点 +-f value;复位指引同步governance/cost-check.shset_breaker():同款潜伏 bug 一并修复(该路径首次真实触发前从未执行过);复位指引同步docs/deadman-setup.md:复位命令-F→-f验证
POST orgs/…/actions/variables -f name -f value -f visibility→ 变量创建成功(当前已置位=true,由本次演习链路置上)AC 映射(#168 AC-3)
回滚:revert 本 PR。