fix(butler): heartbeat-watch 阈值读取路径勘误(ADR-0074) - #233
Conversation
…ash -e 吞错)(ADR-0074)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughChangesButler 心跳监控
Suggested labels: Merge Risk: 🔵 Low · up to The workflow fix is localized and addresses the configuration-path and exit-code behavior, but merge readiness still requires confirmation that the required CODEOWNERS owner approval for this governance-path change is complete. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoFix heartbeat-watch threshold YAML path and fail-closed error handling
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
There was a problem hiding this comment.
Pull request overview
This PR fixes the butler-heartbeat-watch workflow’s stale-threshold lookup so it reads the correct nested key from governance/policy/butler.yaml (thresholds.deadman_stale_hours) and routes YAML-read failures through the intended infra error path (exit 2), aligning with ADR-0074 fail-closed behavior.
Changes:
- Corrects the threshold key path from a top-level lookup to
thresholds.deadman_stale_hours. - Refactors threshold resolution to avoid unhandled
$(...)failures and emit a dedicated infra error (exit 2) on read failures.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # 顶层键 KeyError;且 Actions 默认 bash -e 会令 $( ) 失败直灭脚本 exit 1, | ||
| # 现显式捕获走 infra 通道 exit 2) | ||
| STALE_H="${STALE_HOURS_OVERRIDE:-}" | ||
| if [[ -z "$STALE_H" ]]; then | ||
| STALE_H=$(python3 -c 'import yaml; print(yaml.safe_load(open("governance/policy/butler.yaml", encoding="utf-8"))["thresholds"]["deadman_stale_hours"])' | tr -d '\r') || { |
Code Review by Qodo
1. Card: line formatted as code
|
| # 阈值真源 = butler.yaml#thresholds.deadman_stale_hours(嵌套键——首版误读 | ||
| # 顶层键 KeyError;且 Actions 默认 bash -e 会令 $( ) 失败直灭脚本 exit 1, | ||
| # 现显式捕获走 infra 通道 exit 2) | ||
| STALE_H="${STALE_HOURS_OVERRIDE:-}" |
There was a problem hiding this comment.
2. card: line formatted as code 📘 Rule violation § Compliance
The PR description’s card metadata is formatted as inline code (wrapped in backticks), so it does not start with the required literal Card: prefix and may not be parsed by tooling. This violates the required PR card metadata line format.
Agent Prompt
## Issue description
PR description must include exactly one plain-text line starting with `Card: ` followed by `<owner>/<repo>#<n>` (not wrapped in backticks / code formatting).
## Issue Context
This PR has a card reference, but it is formatted as inline code, which prevents the line from literally starting with `Card: `.
## Fix Focus Areas
- .github/workflows/butler-heartbeat-watch.yml[48-55]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
首版误读 butler.yaml 顶层键(实际嵌套 thresholds: 下)→ KeyError;且 Actions 默认 bash -e 令 $( ) 失败直灭脚本 exit 1 而非 infra 通道。修复:正确嵌套路径 + 显式捕获 exit 2。
Card: Cloudbird-Software/.github#168Summary by CodeRabbit