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.
feat: 自动合并 SLI 周报 + 每周抽样审计(P3-4,.github #98,ADR-0059) #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat: 自动合并 SLI 周报 + 每周抽样审计(P3-4,.github #98,ADR-0059) #184
Changes from all commits
181ec6338482ee0290261dc660d0File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
将权限移至
slijob。Line 17-19 的顶层权限会自动授予后续新增的 job。将顶层设为
permissions: {},并在jobs.sli声明当前所需权限。As per path instructions, “权限必须最小化,优先 job 级 permissions”。
🤖 Prompt for AI Agents
Source: Path instructions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
高风险:通过
scripts/gh-app-token.sh获取每仓令牌。Line 33 直接注入
GOVERNANCE_TOKEN。此路径无法强制 GitHub Appcloudbrid-agent身份、单仓作用域和 1 小时过期。该 job 会读取多个仓库并在.github创建 issue,因此应按目标仓库分别获取令牌,并为.github写入操作获取独立令牌。As per coding guidelines, “令牌经 scripts/gh-app-token.sh,单仓作用域、1h 过期”。
🤖 Prompt for AI Agents
Source: Coding guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
保留阈值升级的失败退出码。
当
scripts/sli-report.sh返回 1 时,Line 41 仍返回 0。运行不会变红,且与 Line 39 的退出码契约冲突。完成基础设施错误处理后,返回原始exit_code。建议修改
bash scripts/sli-report.sh || exit_code=$? # 0=正常 | 1=阈值升级触发(已开 P1——运行可见红)| 2=基础设施故障(fail-closed) if [ "$exit_code" -eq 2 ]; then echo "::error::SLI 采集基础设施故障(fail-closed)"; exit 1; fi - exit 0 + exit "$exit_code"📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win
严重:移除未绑定的
SLI_SELFTEST_DIR展开。Line 42 在
set -u下展开未设置的SLI_SELFTEST_DIR。工作流未传入该变量,因此--self-test会立即失败,周报任务无法执行。建议修改
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Self-test unbound variable
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation toolsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
实现
--audit-only分支,或删除该接口。文档在 Line 18 声明
--audit-only只重放抽样。当前代码只识别--self-test。传入--audit-only会进入完整采集路径并创建周报和审计 issue。该行为会产生非预期的外部写入。🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
解析失败时必须停止,并且只选择 active 仓库。
Line 107 未过滤
status: active。Line 110 会在解析失败或清单为空时使用硬编码列表。该行为会把非受管或停用仓库纳入指标,并把基础设施故障伪装为有效周报。解析REPOS.yaml失败或 active 列表为空时必须以退出码 2 停止。🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5. Missing pagination skews metrics
🐞 Bug☼ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation toolsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
分页拉取 PR,并对采集失败执行 fail-closed。
Line 114 和 Line 118 最多读取 50 条 PR。仓库超过该数量时,
auto_merge_rate、stuck_prs和 P95 会被截断。Line 119 还忽略 open PR 请求失败,而INFRA未在后续阻止报告发布。使用--paginate,记录所有 API 失败,并在计算指标前检测INFRA后退出 2。🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
在计算指标前获取 P0 计数。
Line 137 读取
$TMP/p0count时文件尚不存在。Line 157-158 在指标文件生成后才写入 P0 计数。因此每期escape_rate都将 P0 固定为 0。先查询并验证 P0 计数,再运行指标计算;查询失败时不得使用echo 0伪造数据。Also applies to: 156-158
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. P0 excluded from escape_rate
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation toolsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
使用稳定的周 seed。
Line 142 使用 Python
hash()。Python 会为每个进程随机化 hash seed,因此同一 ISO 周在不同运行中可得到不同样本。直接使用 ISO 周字符串作为random.Random的 seed,或使用hashlib生成固定整数。建议修改
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Non-deterministic sample seed
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation toolsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
修正 P1 升级条件的返回码方向。
Line 167 在上期和本期
escape_rate都大于 0 时返回 0,因此不会设置ESCALATE。当任一期为 0 时返回 1,反而设置ESCALATE。在 Python 命令成功时设置升级状态。建议修改
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
对 P1 升级 issue 做幂等处理。
每次满足条件的运行都会创建新的 P1 issue。手动重跑和后续周运行会重复创建相同升级事项。创建前查询未关闭的同类 P1 issue;存在时追加周报链接或跳过创建。
🤖 Prompt for AI Agents