Skip to content

chore: add .coderabbit.yaml for review status and VERSION rules#6

Merged
Octobersama merged 2 commits into
mainfrom
chore/coderabbit-yaml
Jul 20, 2026
Merged

chore: add .coderabbit.yaml for review status and VERSION rules#6
Octobersama merged 2 commits into
mainfrom
chore/coderabbit-yaml

Conversation

@Octobersama

@Octobersama Octobersama commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Add repo-root .coderabbit.yaml (language: zh-CN)
  • Enable review_progress + fail_commit_status so CodeRabbit can surface a GitHub check usable as a merge gate
  • Move VERSION guidance to path_instructions for js/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-main next to Test if desired.

Test plan

  • CI Test green
  • CodeRabbit appears under PR Checks (note exact name)
  • VERSION +1 not flagged as manual edit

本 PR 旨在让代码审查与合并门禁更可靠:新增仓库根目录 .coderabbit.yaml,将 CodeRabbit 配置为中文审查并启用审查进度与提交状态校验,审查异常时直接失败门禁;同时更新贡献与门禁说明,将需要通过的检查从仅 Test 扩展为 Test + CodeRabbit,并调整对 js/version.js 的 VERSION 变更审查指引以减少误判。
此外,js/version.js 的版本常量由 123 更新至 125。

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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploying owproject with  Cloudflare Pages  Cloudflare Pages

Latest commit: a6d7319
Status: ✅  Deploy successful!
Preview URL: https://22869aaa.owproject.pages.dev
Branch Preview URL: https://chore-coderabbit-yaml.owproject.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 45e133a9-6c5d-498d-bd62-acfa7074e52f

📥 Commits

Reviewing files that changed from the base of the PR and between 8450bfe and a6d7319.

📒 Files selected for processing (3)
  • AGENTS.md
  • CONTRIBUTING.md
  • js/version.js

📝 Walkthrough

Walkthrough

新增仓库级 CodeRabbit 审查配置,启用中文审查、状态门禁和自动增量审查;更新 main 分支保护及合并自检文档;同时将 js/version.js 中的版本构建号从 123 更新为 125。

Changes

审查门禁与版本更新

Layer / File(s) Summary
CodeRabbit 审查策略
.coderabbit.yaml
配置中文审查与摘要、审查进度和提交状态;异常时失败门禁,关闭 request-changes 工作流,并设置路径级审查指令及自动增量审查。
合并门禁约定
AGENTS.md, CONTRIBUTING.md
TestCodeRabbit 纳入合并检查,补充分支保护和提交前自检要求,并删除旧的详细配置说明。
版本构建号递增
js/version.js
将导出的 VERSION 常量从 123 更新为 125

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • OTTOWiki/OWProject#5:同样更新了 AGENTS.mdCONTRIBUTING.md 中的 main 分支合并检查约定。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了新增 .coderabbit.yaml 及 VERSION 相关规则,和本次变更的核心内容一致。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b811996 and 8450bfe.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • js/version.js

Comment thread .coderabbit.yaml
Comment on lines +39 to +46
- path: "AGENTS.md"
instructions: |
以 AGENTS.md / CONTRIBUTING.md 为仓库权威约定。
与通用开源习惯冲突时(hook 改 VERSION、禁止游戏内 changelog 等)以仓库文档为准。

- path: "CONTRIBUTING.md"
instructions: |
贡献流程与分支策略以本文件为准;禁止直推 main,合并走 PR。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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))
PY

Repository: OTTOWiki/OWProject

Length of output: 2750


🏁 Script executed:

sed -n '1,120p' .coderabbit.yaml

Repository: 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}")
PY

Repository: 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:


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.
@Octobersama
Octobersama merged commit 4698403 into main Jul 20, 2026
4 checks passed
@Octobersama
Octobersama deleted the chore/coderabbit-yaml branch July 20, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant