Skip to content

ci: gate merges on Test workflow job; ban in-game changelog copy#5

Merged
Octobersama merged 2 commits into
mainfrom
ci/test-workflow-gate
Jul 20, 2026
Merged

ci: gate merges on Test workflow job; ban in-game changelog copy#5
Octobersama merged 2 commits into
mainfrom
ci/test-workflow-gate

Conversation

@Octobersama

@Octobersama Octobersama commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  1. CI: single job Test runs npm test (no separate npm test job in Checks).
  2. Ruleset: required check remains Test (already set on protect-main).
  3. AGENTS: no changelog/change details in player-facing in-game copy.
  4. CONTRIBUTING §5.2: how to make CodeRabbit a merge gate (enable its status check, then add the exact check name next to Test).

Merge conditions after this PR

  • Must be PR (no direct push to main)
  • Required status: Test only (for Actions)
  • CodeRabbit: comments only unless you complete §5.2
  • Self-merge OK (0 approvals)

Test plan

  • Checks list shows Test once (not npm test + Test)
  • Test is green
  • Optional: enable CodeRabbit status in its dashboard and note the check name for ruleset

Summary by CodeRabbit

  • CI / 合并门禁

    • 将测试工作流改为单一聚合入口:.github/workflows/test.yml 中将测试 job 明确为 name: Test,并由该 job 内部运行 npm test(由原 jobs.unit 改为 jobs.test)。
    • 更新 protect-main required check 的约定为:必须通过聚合 job Test;后续如需加入更多测试,优先继续保持同一 job name(仍为 Test),避免新增并列 required check 名。
    • 文档同步说明可选将 CodeRabbit 作为额外 required status check:要求 TestCodeRabbit 同时通过。
  • 版本更新

    • js/version.js:构建号 VERSION 更新为 123(用于页面版本悬停/提示中的 build 数字)。
  • 文档与贡献规范

    • AGENTS.md:新增文档对齐红线条目,要求当改动测试入口或 CI 约定时同步核对文档;并强化玩家可见游戏文案的约定——“更改详情不要写入游戏内提示”,限定版本说明/修复列表/开发备注/PR/commit 摘要等只写入 Git/文档/发布说明,禁止出现在玩家可见位置。
    • CONTRIBUTING.md:将合并前状态检查要求从 npm test 调整为聚合检查名 Test,并补充 CodeRabbit 可选 required check 的说明。

Add aggregate Test job for branch protection so future CI jobs can join needs. Document no release notes in player-facing UI strings.
@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: cc19d27
Status: ✅  Deploy successful!
Preview URL: https://8c2328d9.owproject.pages.dev
Branch Preview URL: https://ci-test-workflow-gate.owproject.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

将测试 workflow 的 required check 统一为 Test,同步更新 CI 与贡献规范文档,并将构建版本号从 121 更新为 123。

Changes

CI 门禁与发布信息

Layer / File(s) Summary
Test 检查约定
.github/workflows/test.yml
测试 job 从 unit 改为 test,显示名称从 npm test 改为 Test,并新增 required check 命名约定。
CI 规范同步
AGENTS.md, CONTRIBUTING.md
将分支保护和合并门禁说明更新为 Test,补充 CI 变更核对、分支保护示例、CodeRabbit 门禁说明及代码约束。
构建版本更新
js/version.js
将导出的 VERSION 从 121 更新为 123。

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了此次 PR 的两项主要改动:以 Test 工作流作合并门禁,并禁止游戏内展示变更/更新文案。
✨ 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 `@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

📥 Commits

Reviewing files that changed from the base of the PR and between 3b28a06 and edc326f.

📒 Files selected for processing (4)
  • .github/workflows/test.yml
  • AGENTS.md
  • CONTRIBUTING.md
  • js/version.js

Comment thread js/version.js Outdated
import { DEPLOY_GIT_HASH } from './git-hash.js';

export const VERSION = 121;
export const VERSION = 122;

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 | 🟠 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between edc326f and cc19d27.

📒 Files selected for processing (4)
  • .github/workflows/test.yml
  • AGENTS.md
  • CONTRIBUTING.md
  • js/version.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • AGENTS.md

Comment on lines +5 to +6
# 分支保护 required check 名:**Test**(本 job 的 name)。
# 以后加测:在本 job 里加 step(或 matrix),保持 job name 仍为 Test,不必再拆并列 job。

Copy link
Copy Markdown

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

不要在门禁约定中允许 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

Comment on lines +20 to +21
test:
name: Test

Copy link
Copy Markdown

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

🧩 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 || true

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

Comment thread CONTRIBUTING.md
Comment on lines +243 to +258
**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)。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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


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


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


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


把 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.

@Octobersama
Octobersama merged commit b811996 into main Jul 20, 2026
4 checks passed
@Octobersama
Octobersama deleted the ci/test-workflow-gate 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