testing.yaml: test_integrity 规则/阈值声明(ADR-0035 / #86,P2-1) - #115
Conversation
|
Warning Review limit reached
Next review available in: 8 minutes 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 (1)
Comment |
PR Summary by QodoDeclare a fail-closed test integrity gate policy
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Uppercase assertions evade TI-R2
|
| note: "测试文件有删改行且零实现文件变更;调为 red 则不可豁免"} | ||
| patterns: # ERE;bash =~ 与 grep -E 语义(\b 为 GNU 扩展,ubuntu runner 原生) | ||
| test_file: '((^|/)(tests?|__tests__|__snapshots__|testdata)(/|$)|_test\.go$|\.test\.[cm]?[jt]sx?$|\.spec\.[cm]?[jt]sx?$|(^|/)test_[^/]*\.py$|_test\.py$|_test\.rs$|\.snap$)' | ||
| assertion: '\bassert|\bexpect\(|\bexpect\.|\brequire\(|\brequire\.|\bshould\b|\bt\.Error|\bt\.Fatal|\bself\.assert|\bfail_if\(|\bAssert|\bExpect\(|\bRequire\(|\bSo\(' |
There was a problem hiding this comment.
1. Uppercase assertions evade ti-r2 🐞 Bug ≡ Correctness
TI-R2 的大小写敏感正则无法匹配 ASSERT_EQ、EXPECT_EQ、REQUIRE 等常见全大写 C/C++ 断言宏。删除这些断言不会减少检测器统计值,因此可绕过声明为 red 的断言净下降检查。
Agent Prompt
## Issue description
TI-R2's assertion ERE omits conventional all-uppercase assertion macros, allowing assertion deletion to evade the red gate.
## Issue Context
The policy describes the detector as language-independent and defines any negative assertion net as red. Preserve compatibility with GNU ERE and synchronize the corrected expression with the CI-Workflows built-in default and its tests.
## Fix Focus Areas
- governance/policy/testing.yaml[79-87]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
9e1ba78 to
c9cc61b
Compare
摘要
P2-1(#86 / ADR-0035)的 policy 面:
governance/policy/testing.yaml新增test_integrity节——CI-Workflowstest-integrity.yml(配套 PR CI-Workflows#17)运行时拉取本节覆盖检测器内置缺省。验证清单