chore: add .coderabbit.yaml for review status and VERSION rules#6
Conversation
Enable review_progress and fail_commit_status for merge-gate readiness. Move VERSION guidance to path_instructions so reviews do not false-positive on hook bumps.
Deploying owproject with
|
| Latest commit: |
a6d7319
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://22869aaa.owproject.pages.dev |
| Branch Preview URL: | https://chore-coderabbit-yaml.owproject.pages.dev |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough新增仓库级 CodeRabbit 审查配置,启用中文审查、状态门禁和自动增量审查;更新 Changes审查门禁与版本更新
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.coderabbit.yaml:
- Around line 39-46: Remove the AGENTS.md and CONTRIBUTING.md entries from
reviews.path_instructions in the configuration. Keep AGENTS.md covered by the
default guideline list, and add CONTRIBUTING.md to
knowledge_base.code_guidelines.filePatterns so its contribution rules apply
globally.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3fe365d3-b804-4c0a-8de8-f89b01c840e0
📒 Files selected for processing (2)
.coderabbit.yamljs/version.js
| - path: "AGENTS.md" | ||
| instructions: | | ||
| 以 AGENTS.md / CONTRIBUTING.md 为仓库权威约定。 | ||
| 与通用开源习惯冲突时(hook 改 VERSION、禁止游戏内 changelog 等)以仓库文档为准。 | ||
|
|
||
| - path: "CONTRIBUTING.md" | ||
| instructions: | | ||
| 贡献流程与分支策略以本文件为准;禁止直推 main,合并走 PR。 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
curl -fsSL https://www.coderabbit.ai/integrations/schema.v2.json |
jq -e '.properties.knowledge_base.properties.code_guidelines.properties.filePatterns'Repository: OTTOWiki/OWProject
Length of output: 1343
🏁 Script executed:
python3 - <<'PY'
import json, urllib.request
schema = json.load(urllib.request.urlopen("https://www.coderabbit.ai/integrations/schema.v2.json"))
# show review path instructions and knowledge base guideline schema
reviews = schema["properties"]["reviews"]["properties"]["path_instructions"]
kb = schema["properties"]["knowledge_base"]["properties"]["code_guidelines"]
print("path_instructions:", json.dumps(reviews, ensure_ascii=False, indent=2))
print("code_guidelines:", json.dumps(kb, ensure_ascii=False, indent=2))
PYRepository: OTTOWiki/OWProject
Length of output: 2750
🏁 Script executed:
sed -n '1,120p' .coderabbit.yamlRepository: OTTOWiki/OWProject
Length of output: 1774
🏁 Script executed:
python3 - <<'PY'
from pathlib import Path
p = Path('.coderabbit.yaml')
print(p.exists())
if p.exists():
for i, line in enumerate(p.read_text(encoding='utf-8').splitlines(), 1):
if 1 <= i <= 120:
print(f"{i:4}: {line}")
PYRepository: OTTOWiki/OWProject
Length of output: 2109
🌐 Web query:
CodeRabbit reviews.path_instructions apply only to matched files documentation
💡 Result:
In CodeRabbit, the reviews.path_instructions configuration allows you to define targeted, natural language review guidance that applies only to files matching specified glob patterns [1][2]. Key characteristics of this feature include: Scope: The instructions you provide are injected into the AI reviewer's prompt specifically for files changed in a pull request that match the defined glob pattern [1][3]. If a pull request contains multiple files, CodeRabbit applies the instructions to each file based on its matching path; if a file matches multiple patterns, it receives all applicable instructions [4][5]. Configuration: You define these rules within your .coderabbit.yaml file under the reviews.path_instructions section [6][2]. Each entry requires a path (using glob patterns) and instructions (the specific guidance) [1][5]. Best Practices and Usage: - Purpose: They are best used as a supplement to global instructions (set under reviews.instructions) for domain-specific criteria, such as requiring security checks for API routes or performance standards for database queries [2][7]. - Complementary Nature: These instructions do not replace other review features. For instance, they do not disable automatic features like docstring generation or docstring coverage checks [1]. - Management: You can manage these instructions manually or use the @coderabbitai emit path instructions command in a pull request comment to automatically generate and merge suggested path-specific rules based on your codebase's history [8]. - Distinction from Guidelines: It is important not to confuse path_instructions with "Code Guidelines" (e.g., AGENTS.md or CLAUDE.md). Adding guideline file names to path_instructions will cause CodeRabbit to attempt to review those files as code rather than using them as instructional context [9]. Each path_instructions entry supports up to 20,000 characters of text [6][3].
Citations:
- 1: https://docs.coderabbit.ai/configuration/path-instructions
- 2: https://dev.to/rahulxsingh/coderabbit-configuration-coderabbityaml-reference-5493
- 3: https://github.com/RedHatProductSecurity/prodsec-skills/blob/main/docs/ADRs/0003-coderabbit-integration.md
- 4: https://aicodereview.cc/blog/coderabbit-custom-rules/
- 5: https://dev.to/rahulxsingh/coderabbit-custom-rules-review-instructions-guide-1nc1
- 6: https://docs.coderabbit.ai/reference/configuration
- 7: https://aicodereview.cc/blog/coderabbit-configuration/
- 8: https://docs.coderabbit.ai/reference/review-commands
- 9: https://docs.coderabbit.ai/knowledge-base/code-guidelines
把 AGENTS.md / CONTRIBUTING.md 作为 code guidelines 加载。
reviews.path_instructions 只会对命中的变更文件注入提示,放这里不会让这些仓库约定影响其它文件的审查。删掉这两条路径指令;AGENTS.md 已在默认 guideline 列表中,CONTRIBUTING.md 需要放到 knowledge_base.code_guidelines.filePatterns。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.coderabbit.yaml around lines 39 - 46, Remove the AGENTS.md and
CONTRIBUTING.md entries from reviews.path_instructions in the configuration.
Keep AGENTS.md covered by the default guideline list, and add CONTRIBUTING.md to
knowledge_base.code_guidelines.filePatterns so its contribution rules apply
globally.
Remove §5.1/§5.2 repo-configuration how-tos. Contributors only need to know PR requires Test + CodeRabbit.
Summary
.coderabbit.yaml(language: zh-CN)review_progress+fail_commit_statusso CodeRabbit can surface a GitHub check usable as a merge gatepath_instructionsforjs/version.js(stop false positives on pre-commit +1)Follow-up
After CodeRabbit runs, read the exact Checks name and add it to ruleset
protect-mainnext toTestif desired.Test plan
Testgreen本 PR 旨在让代码审查与合并门禁更可靠:新增仓库根目录
.coderabbit.yaml,将 CodeRabbit 配置为中文审查并启用审查进度与提交状态校验,审查异常时直接失败门禁;同时更新贡献与门禁说明,将需要通过的检查从仅Test扩展为Test+CodeRabbit,并调整对js/version.js的 VERSION 变更审查指引以减少误判。此外,
js/version.js的版本常量由 123 更新至 125。