ci: gate merges on Test workflow job; ban in-game changelog copy#5
Conversation
Add aggregate Test job for branch protection so future CI jobs can join needs. Document no release notes in player-facing UI strings.
Deploying owproject with
|
| Latest commit: |
cc19d27
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8c2328d9.owproject.pages.dev |
| Branch Preview URL: | https://ci-test-workflow-gate.owproject.pages.dev |
📝 WalkthroughWalkthrough将测试 workflow 的 required check 统一为 ChangesCI 门禁与发布信息
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 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 `@js/version.js`:
- Line 12: 撤销对 js/version.js 中 VERSION 的手动修改,恢复提交前的值;依赖 pre-commit hook 自动递增
VERSION,并确保自动流程最终生成 122。
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2b165919-7eeb-4a62-b895-ea4897785ea8
📒 Files selected for processing (4)
.github/workflows/test.ymlAGENTS.mdCONTRIBUTING.mdjs/version.js
| import { DEPLOY_GIT_HASH } from './git-hash.js'; | ||
|
|
||
| export const VERSION = 121; | ||
| export const VERSION = 122; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
不要手动修改 VERSION。
仓库规则要求由 pre-commit hook 自动递增该值;当前直接将 121 改为 122,提交时可能再次递增为 123,导致构建号与发布预期不一致。请撤销手工改动,并通过自动流程生成 122。
🤖 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 `@js/version.js` at line 12, 撤销对 js/version.js 中 VERSION 的手动修改,恢复提交前的值;依赖
pre-commit hook 自动递增 VERSION,并确保自动流程最终生成 122。
Source: Coding guidelines
Collapse unit+aggregate into one job named Test. Document how to add CodeRabbit as an optional required status check.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 @.github/workflows/test.yml:
- Around line 5-6: Update the guidance comment for the unique Test job to remove
the matrix option. State that future tests must be added as steps within the
existing Test job, preserving the single Test check and avoiding parallel jobs.
- Around line 20-21: 在 GitHub Actions 的 test job(name: Test)中添加显式的 permissions
配置,仅授予 contents: read 权限;保持现有 checkout 和 npm test 流程不变。
In `@CONTRIBUTING.md`:
- Around line 243-258: Update the “protect-main” required-check guidance in
CONTRIBUTING.md to use the actual GitHub status context `coderabbitai` instead
of `CodeRabbit`. Clarify that this is the branch-protection required status
check context, while retaining the instruction to verify the exact name shown
under PR → Checks and keeping `Test` as the other required check.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c870a4df-3bba-441b-a2d0-c61072b45798
📒 Files selected for processing (4)
.github/workflows/test.ymlAGENTS.mdCONTRIBUTING.mdjs/version.js
🚧 Files skipped from review as they are similar to previous changes (1)
- AGENTS.md
| # 分支保护 required check 名:**Test**(本 job 的 name)。 | ||
| # 以后加测:在本 job 里加 step(或 matrix),保持 job name 仍为 Test,不必再拆并列 job。 |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
不要在门禁约定中允许 matrix。
这里将未来测试扩展写成“step(或 matrix)”,与仓库硬约束冲突:测试必须继续放在唯一的 Test job 中,通过新增 step 扩展,不应产生并列检查。请删除“或 matrix”。
As per coding guidelines, CI 只能使用唯一 job 名 Test,新增测试应在同一 job 增加 step,不要拆出并列 check。
🤖 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 @.github/workflows/test.yml around lines 5 - 6, Update the guidance comment
for the unique Test job to remove the matrix option. State that future tests
must be added as steps within the existing Test job, preserving the single Test
check and avoiding parallel jobs.
Source: Coding guidelines
| test: | ||
| name: Test |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file=".github/workflows/test.yml"
echo "== file exists =="
git ls-files "$file"
echo
echo "== line count =="
wc -l "$file"
echo
echo "== numbered content =="
cat -n "$file"Repository: OTTOWiki/OWProject
Length of output: 1240
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== workflows =="
git ls-files '.github/workflows/*' || true
echo
echo "== permissions usage in workflows =="
rg -n "^permissions:|contents: read|GITHUB_TOKEN" .github/workflows -S || trueRepository: OTTOWiki/OWProject
Length of output: 237
为这个测试 job 显式收紧 GITHUB_TOKEN 权限。
当前未声明 permissions,会继承仓库/组织默认值;这里只需要 checkout 和跑 npm test,加上 contents: read 就够了。
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 20-35: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 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 @.github/workflows/test.yml around lines 20 - 21, 在 GitHub Actions 的 test
job(name: Test)中添加显式的 permissions 配置,仅授予 contents: read 权限;保持现有 checkout 和 npm
test 流程不变。
Source: Linters/SAST tools
| **A. 让 CodeRabbit 上报 Status / Check** | ||
|
|
||
| 1. 打开 [CodeRabbit 控制台](https://app.coderabbit.ai/) → 本仓库设置 | ||
| 2. 打开类似 **Status checks** / **Report review status** / **Fail the check on…** 的选项(名称因套餐 UI 而异) | ||
| 3. 再开一个小 PR 或 push 触发一次审查 | ||
| 4. 在 PR → **Checks** 里找到 CodeRabbit 那一行,**记下准确名称**(常见为 `CodeRabbit`,以页面为准) | ||
|
|
||
| 若 Checks 列表始终没有 CodeRabbit,只有评论,则**无法**用 ruleset 硬拦,只能人工看。 | ||
|
|
||
| **B. 写入 `protect-main` required checks** | ||
|
|
||
| 在现有 **`Test`** 之外追加 CodeRabbit 的 context,例如: | ||
|
|
||
| - required:`Test` + `CodeRabbit`(名称必须与 Checks 完全一致) | ||
|
|
||
| 之后合并条件变为:PR + **`Test` 绿** + **CodeRabbit check 绿** + 有写权限的人点 Merge(仍可不要求人类 Approve)。 |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== CONTRIBUTING.md around the cited lines ==\n'
sed -n '220,285p' CONTRIBUTING.md
printf '\n== Search for CodeRabbit mentions ==\n'
rg -n --hidden --glob '!**/.git/**' 'CodeRabbit|Status checks|Report review status|Fail the check on|required checks|protect-main|Test' .
printf '\n== Repo file list for likely docs/config files ==\n'
git ls-files | sed -n '1,200p'Repository: OTTOWiki/OWProject
Length of output: 10774
🌐 Web query:
CodeRabbit docs pre-merge checks GitHub required status check CodeRabbit check name
💡 Result:
To configure CodeRabbit as a required status check in GitHub, use the status check name: coderabbitai [1]. You can enforce this by navigating to your GitHub repository's branch protection rules (Settings > Branches > Branch protection rules) and adding "coderabbitai" to the list of required status checks [1]. Regarding pre-merge checks, CodeRabbit features a "Pre-Merge Checks" system that validates pull requests against built-in or custom rules [2][3]. These are configured within the .coderabbit.yaml file or via the CodeRabbit web interface [2]. While these checks help evaluate pull request quality, they are distinct from the primary GitHub-level status check (coderabbitai) that tracks the overall review completion [2][1]. Pre-merge check results—such as errors or warnings—are reported as part of the CodeRabbit review process, and if "Request Changes" is enabled, failing checks marked as "error" can block the pull request [2].
Citations:
- 1: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/saas-packs/coderabbit-pack/skills/coderabbit-ci-integration/SKILL.md
- 2: https://docs.coderabbit.ai/pr-reviews/pre-merge-checks
- 3: https://www.coderabbit.ai/blog/pre-merge-checks-built-in-and-custom-pr-enforced
🌐 Web query:
site:docs.coderabbit.ai coderabbitai required status check GitHub CodeRabbit
💡 Result:
CodeRabbit does not function as a standard GitHub "required status check" that blocks merges by itself via the GitHub branch protection rules in the way a traditional CI/CD status check (like GitHub Actions or CircleCI) does. Instead, CodeRabbit offers specific mechanisms for controlling merge behavior based on its analysis [1][2]. 1. GitHub Checks Integration: CodeRabbit uses the GitHub Checks API to read results from your CI/CD pipelines (such as GitHub Actions) to provide automated remediation suggestions on pull requests [3][2]. While this monitors your existing checks, it is an analytical integration rather than a primary gatekeeper for branch protection rules [3]. 2. Pre-Merge Checks: CodeRabbit provides an "Agentic Pre-Merge Checks" feature that can block merges [1]. When you enable the "Request Changes" workflow within CodeRabbit, you can configure these checks to an "error" mode [1]. If a check fails while in error mode, the pull request is blocked from being merged until the issue is resolved or explicitly ignored via the CodeRabbit UI [1]. Configuration: You can configure both the GitHub Checks integration and Pre-Merge Checks via the CodeRabbit web interface or by using a.coderabbit.yaml file in your repository [3][1][4]. - For GitHub Checks configuration, use the github-checks tool setting [4]: reviews: tools: github-checks: enabled: true - For Pre-Merge Checks, which can block merges, you configure them under the reviews.pre_merge_checks section in your.coderabbit.yaml [1]: reviews: pre_merge_checks: enabled: true # Example of setting a check to error mode to block merges some_check_name: "error" If you require a strict GitHub status check to appear in your repository's branch protection settings, you must configure your underlying CI/CD pipeline (e.g., GitHub Actions) to report its status to GitHub, which CodeRabbit then complements with its own analysis [3][2].
Citations:
- 1: https://docs.coderabbit.ai/pr-reviews/pre-merge-checks
- 2: https://docs.coderabbit.ai/pr-reviews/cicd-pipeline-analysis
- 3: https://docs.coderabbit.ai/tools/github-checks
- 4: https://docs.coderabbit.ai/tools/reference
🌐 Web query:
CodeRabbit GitHub required status check coderabbitai official docs
💡 Result:
To set up CodeRabbit as a required status check on GitHub, you can use the branch protection rules in your repository settings [1]. 1. Navigate to your GitHub repository and go to Settings > Branches > Branch protection rules [1]. 2. Click "Add rule" or edit an existing rule for your target branch (e.g., main) [1]. 3. Enable "Require status checks to pass before merging" [1]. 4. Search for and select "coderabbitai" in the list of available status checks [1]. 5. Save your changes [1]. Important Requirements and Notes: - Visibility: For the "coderabbitai" status check to appear in the list, CodeRabbit must have been installed and must have completed at least one review on a pull request within that repository [1]. - Enforcement: Once configured, pull requests cannot be merged until CodeRabbit has finished its review and reported a passing status [1]. - GitHub Integration: CodeRabbit automatically requests the necessary read and write permissions (including commit statuses) upon installation to manage these checks [2]. - Pre-Merge Checks vs. Status Checks: Note that CodeRabbit also offers "Pre-Merge Checks" (distinct from standard GitHub status checks), which can be configured in your.coderabbit.yaml file [3][4][5]. When the "Request Changes Workflow" is enabled, these pre-merge checks can block merges if set to "error" mode [3][4][5]. For more information, refer to the official CodeRabbit documentation on GitHub integration and configurations [2][4].
Citations:
- 1: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/saas-packs/coderabbit-pack/skills/coderabbit-ci-integration/SKILL.md
- 2: https://docs.coderabbit.ai/platforms/github-com
- 3: https://docs.coderabbit.ai/pr-reviews/pre-merge-checks
- 4: https://docs.coderabbit.ai/reference/configuration
- 5: https://www.coderabbit.ai/blog/pre-merge-checks-built-in-and-custom-pr-enforced
🌐 Web query:
docs.coderabbit.ai "coderabbitai" "required status check"
💡 Result:
You can configure CodeRabbit as a required status check in GitHub to block pull requests from merging until the AI review or specific pre-merge checks are completed [1]. To set this up, follow these general steps: 1. Enable Branch Protection in GitHub: Navigate to your repository's Settings, then to Branches, and edit the branch protection rule for your target branch (e.g., main) [1]. 2. Require Status Checks: Enable the option "Require status checks to pass before merging" [1]. 3. Search for CodeRabbit: In the list of available status checks, search for "coderabbitai" and select it as a required check [1]. In addition to the general GitHub status check, CodeRabbit offers granular control through its own Pre-Merge Checks, which can also block merges [2][3]. These are configured via the.coderabbit.yaml file or the CodeRabbit web interface [2][3]. By setting the enforcement mode of a Pre-Merge Check to "error," CodeRabbit will block the merge if that specific check fails (when the Request Changes workflow is enabled) [2][4]. If you encounter issues where "coderabbitai" does not appear in the GitHub status checks list, ensure that the CodeRabbit App is correctly installed on the repository and that at least one pull request has been reviewed by CodeRabbit to register the status check [1].
Citations:
- 1: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/saas-packs/coderabbit-pack/skills/coderabbit-ci-integration/SKILL.md
- 2: https://docs.coderabbit.ai/pr-reviews/pre-merge-checks
- 3: https://www.coderabbit.ai/blog/pre-merge-checks-built-in-and-custom-pr-enforced
- 4: https://docs.coderabbit.ai/reference/configuration
把 required check 名改成 coderabbitai,不要写 CodeRabbit。
这里说的是 GitHub branch protection 的 required status check,不是 CodeRabbit 的 pre-merge checks;应以 PR → Checks 里实际出现的 context 为准。现在这段直接写 Test + CodeRabbit,容易配错并让规则失效。
🤖 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 `@CONTRIBUTING.md` around lines 243 - 258, Update the “protect-main”
required-check guidance in CONTRIBUTING.md to use the actual GitHub status
context `coderabbitai` instead of `CodeRabbit`. Clarify that this is the
branch-protection required status check context, while retaining the instruction
to verify the exact name shown under PR → Checks and keeping `Test` as the other
required check.
Summary
Testrunsnpm test(no separatenpm testjob in Checks).Test(already set onprotect-main).Test).Merge conditions after this PR
main)Testonly (for Actions)Test plan
Testonce (notnpm test+Test)Testis greenSummary by CodeRabbit
CI / 合并门禁
.github/workflows/test.yml中将测试 job 明确为name: Test,并由该 job 内部运行npm test(由原jobs.unit改为jobs.test)。protect-mainrequired check 的约定为:必须通过聚合 jobTest;后续如需加入更多测试,优先继续保持同一 job name(仍为Test),避免新增并列 required check 名。Test与CodeRabbit同时通过。版本更新
js/version.js:构建号VERSION更新为 123(用于页面版本悬停/提示中的 build 数字)。文档与贡献规范
AGENTS.md:新增文档对齐红线条目,要求当改动测试入口或 CI 约定时同步核对文档;并强化玩家可见游戏文案的约定——“更改详情不要写入游戏内提示”,限定版本说明/修复列表/开发备注/PR/commit 摘要等只写入 Git/文档/发布说明,禁止出现在玩家可见位置。CONTRIBUTING.md:将合并前状态检查要求从npm test调整为聚合检查名Test,并补充 CodeRabbit 可选 required check 的说明。