Skip to content

Release-notes workflow, anonymous magnets, and bilingual templates - #6

Merged
FlanChanXwO merged 8 commits into
mainfrom
codex/release-notes-system
Aug 2, 2026
Merged

FlanChanXwO merged 8 commits into
mainfrom
codex/release-notes-system

Conversation

@FlanChanXwO

@FlanChanXwO FlanChanXwO commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • magnets and detail --magnets no longer require a default account: they use a saved token when present and fall back to anonymous requests when the token is rejected.
  • Introduce a versioned bilingual release-notes workflow with offline validation, audit, render, and machine-readable PR release-note declarations. Release logs for v0.1.0–v0.3.0 are updated, with every entry citing its commit or PR source.
  • Adopt bilingual issue/PR templates, Copilot instructions, and CONTRIBUTING guides, and add a real-API e2e workflow with docs path filtering.

Scope and compatibility

CLI and public Go SDK behavior are unchanged except that magnets and detail --magnets no longer require login (anonymous fallback when a saved token is rejected). The project still has no MCP server.

Test plan

  • go test ./... passes
  • sh scripts/build.sh passes
  • sh scripts/test-releasenotes.sh passes
  • python -m pre_commit run --all-files passes (gofmt, go test, release tooling, release notes, documentation structure, architecture structure)

Summary by CodeRabbit

  • 新功能
    • 磁力查询及详情中的磁力链接现支持匿名访问;令牌失效时会自动回退。
    • 建立按版本归档的中英文发布说明体系,支持生成 GitHub Release 正文。
  • 文档
    • 更新主页、贡献指南、维护文档及问题模板,明确发布流程与使用要求。
  • 改进
    • PR 变更支持发布说明声明、来源追踪与一致性校验。
    • 文档专属变更可执行精简验证,发布流程新增审计、双语渲染及历史同步校验。

@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

审阅者指南

引入一个带版本控制的双语变更日志系统(基于 Go 工具),并将其接入 CI/发布流程(包括仅文档变更的路由和平台冒烟门控),同时在仓库中增加本地 agent 技能,以及相关文档和元数据更新,以支持新的发布流程。

带审计的版本化发布说明的发布流程序列图

sequenceDiagram
  actor Actions as GitHubActions
  participant validate as job_validate
  participant release_notes_audit as job_release_notes_audit
  participant publish as job_publish
  participant Releasenotes as scripts_releasenotes
  participant GitHub as GitHubAPI
  participant GHCLI as gh_cli

  Actions->>validate: run validate job
  validate-->>Actions: set RELEASE_TAG

  Actions->>release_notes_audit: run Audit release notes
  release_notes_audit->>Releasenotes: go run ./scripts/releasenotes validate --version --dir
  release_notes_audit->>Releasenotes: go run ./scripts/releasenotes audit --repo --from --to --require-classified
  Releasenotes->>GitHub: requestJSON commits/pulls
  GitHub-->>Releasenotes: auditReport
  release_notes_audit->>Releasenotes: go run ./scripts/releasenotes validate --version --dir --audit
  release_notes_audit-->>publish: job dependency release_notes_audit

  Actions->>publish: run Publish GitHub Release
  publish->>Releasenotes: go run ./scripts/releasenotes render --version --dir --output
  publish->>GHCLI: gh release create --notes-file release/release-notes.md
  GHCLI->>GitHub: create draft Release with rendered bilingual body
Loading

CI 与平台冒烟(仅文档变更路由)的序列图

sequenceDiagram
  actor Actions as GitHubActions
  participant classify_changes as job_classify_changes
  participant changescope as cmd_changescope
  participant quality as job_quality
  participant packaged_smoke as job_packaged_binary_smoke
  participant smoke_gate as job_platform_smoke_gate

  Actions->>classify_changes: run Classify change scope
  classify_changes->>changescope: go run ./scripts/changescope --base --head --github-output
  changescope-->>classify_changes: docs_only=true|false

  Actions->>quality: run quality job (needs classify_changes)
  quality->>quality: releasenotes pr-validate (pull_request only)
  alt docs_only == 'true'
    quality->>quality: sh scripts/test-documentation.sh
  else docs_only != 'true'
    quality->>quality: gofmt / go test / go test -race / go vet
    quality->>quality: sh scripts/build.sh
    quality->>quality: sh scripts/test-package-release.sh
    quality->>quality: sh scripts/test-workflows.sh
    quality->>quality: pre-commit checks
  end

  Actions->>packaged_smoke: run packaged_binary_smoke (needs classify_changes)
  alt docs_only == 'true'
    packaged_smoke-->>Actions: job skipped
  else docs_only != 'true'
    packaged_smoke->>packaged_smoke: build, download, smoke javdb-cli
  end

  Actions->>smoke_gate: run platform_smoke_gate (needs classify_changes, packaged_smoke)
  smoke_gate->>smoke_gate: check DOCS_ONLY and MATRIX_RESULT
  alt DOCS_ONLY == true
    smoke_gate->>smoke_gate: require MATRIX_RESULT == skipped
  else DOCS_ONLY != true
    smoke_gate->>smoke_gate: require MATRIX_RESULT == success
  end
Loading

文件级变更

Change Details Files
添加基于 Go 的 releasenotes 和 changescope 工具,用于管理带版本控制的双语变更日志条目、PR 的发布说明元数据以及 GitHub Release 正文。
  • 引入 scripts/releasenotes CLI,包含 validate、audit、prepare、render、pr-validate 和 sync-history 等子命令,并集成 GitHub API,附带大量单元测试。
  • 新增 scripts/internal/releasenotesrender 包,用于提取按版本划分的发布说明并渲染双语 GitHub Release 正文。
  • 实现 scripts/changescope,用于将 diff 分类为仅文档(docs-only)或完整变更,采用严格的白名单策略并包含单元测试。
  • 增加 scripts/test-releasenotes.sh,并将其接入 pre-commit 和文档测试,用于验证变更日志结构、发布计划以及历史版本。
scripts/releasenotes/main.go
scripts/releasenotes/main_test.go
scripts/internal/releasenotesrender/render.go
scripts/changescope/main.go
scripts/changescope/main_test.go
scripts/test-releasenotes.sh
.pre-commit-config.yaml
将根目录的变更日志迁移到带版本控制的双语 changelog/ 目录中,并为历史发布和发布准备计划提供审计。
  • 用指向 changelog/ 索引的指针替换根目录 CHANGELOG.md 和 CHANGELOG.zh-CN.md 的正文,同时保持兼容性。
  • 新增 changelog/README.{md,zh-CN.md}、按版本划分的 v0.1.0–v0.2.0 双语发布说明、未发布条目占位文件,以及用于历史版本的 JSON 计划文件。
  • 扩展 scripts/test-documentation.sh,以检查新变更日志文件的存在性及其接线是否正确。
CHANGELOG.md
CHANGELOG.zh-CN.md
changelog/README.md
changelog/README.zh-CN.md
changelog/v0.1.0/en.md
changelog/v0.1.0/zh-CN.md
changelog/v0.1.1/en.md
changelog/v0.1.1/zh-CN.md
changelog/v0.2.0/en.md
changelog/v0.2.0/zh-CN.md
changelog/unreleased/en.md
changelog/unreleased/zh-CN.md
changelog/plans/v0.1.0.json
changelog/plans/v0.1.1.json
changelog/plans/v0.2.0.json
scripts/test-documentation.sh
将发布说明校验、变更日志审计和渲染接入发布工作流,并收紧发布门控。
  • 新增 release_notes_audit 任务,在该任务中检出发布标签,验证计划 JSON 和各版本发布说明,运行 releasenotes validate/audit,并生成审计 JSON。
  • 让 publish 任务依赖 release_notes_audit,在其中配置 Go 工具链,并将发布说明渲染到一个文件,作为 GitHub Release 的正文通过 --notes-file 使用。
  • 扩展 scripts/test-workflows.sh,以检查新审计任务、权限配置、releasenotes 调用以及 notes-file 使用情况的存在性和接线是否正确。
.github/workflows/release.yml
scripts/test-workflows.sh
使用 changescope 分类器引入仅文档变更的 CI 路由,以及稳定的平台冒烟门控。
  • 在 ci.yml 和 platform-smoke.yml 中添加 classify_changes 任务,运行 scripts/changescope 并暴露 docs_only 输出。
  • 用基于 docs_only 的条件保护 quality/packaged_binary_smoke 步骤,并添加 platform_smoke_gate 任务,对仅文档变更与完整变更分别强制执行预期的矩阵结果。
  • 更新工作流测试,检查分类器存在性、门控任务命名以及 docs_only 接线是否正确。
.github/workflows/ci.yml
.github/workflows/platform-smoke.yml
scripts/test-workflows.sh
更新贡献者/维护者文档、PR 模板和 agent 技能,以反映新的发布说明和文档流程,并澄清公开的 Go SDK。
  • 扩展维护者开发、agent 和文档指南,以描述 classify_changes 路由、发布准备清单、按版本划分的发布说明以及历史同步责任。
  • 更新 CONTRIBUTING(双语版本)、AGENTS.md 和 README*.md,指向 changelog/,澄清 javdb 是公开的 Go SDK,并禁止声称支持 MCP server。
  • 修改 PR 模板,增加一个已校验的发布说明元数据块,并替换旧的“未发布变更日志”检查项。
  • 新增仓库本地 .agents/skills,覆盖评审、文档、提交信息以及发布说明流程,并添加一个 superpowers 规格文档,用于描述发布说明系统的设计。
docs/maintainers/development.md
docs/maintainers/agents/documentation-guidelines.md
docs/maintainers/agents/index.md
docs/superpowers/specs/2026-07-30-release-notes-system-design.md
CONTRIBUTING.md
CONTRIBUTING.zh-CN.md
AGENTS.md
README.md
README.zh-CN.md
.github/PULL_REQUEST_TEMPLATE.md
.agents/skills/javdb-cli-review/SKILL.md
.agents/skills/javdb-cli-docs/SKILL.md
.agents/skills/javdb-cli-commit-message/SKILL.md
.agents/skills/javdb-cli-release-notes/SKILL.md

提示与命令

与 Sourcery 交互

  • 触发新的审阅: 在 Pull Request 上评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 通过回复审阅评论,请求 Sourcery 从该评论创建一个 issue。也可以在某条审阅评论下回复 @sourcery-ai issue,从中创建一个 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题中任意位置写入 @sourcery-ai,即可随时生成标题。也可以在 Pull Request 上评论 @sourcery-ai title,随时(重新)生成标题。
  • 生成 Pull Request 摘要: 在 Pull Request 描述正文中任意位置写入 @sourcery-ai summary,即可在准确的位置随时生成 PR 摘要。也可以在 Pull Request 上评论 @sourcery-ai summary,随时(重新)生成摘要。
  • 生成审阅者指南: 在 Pull Request 上评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 Pull Request 上评论 @sourcery-ai resolve,以解决所有 Sourcery 评论。当你已经处理完所有评论且不希望再看到它们时,这非常有用。
  • 忽略所有 Sourcery 审阅: 在 Pull Request 上评论 @sourcery-ai dismiss,以忽略所有现有的 Sourcery 审阅。尤其适用于你想从头开始一次新的审阅——别忘了再评论 @sourcery-ai review 以触发新的审阅!

自定义你的使用体验

访问你的 控制面板 以:

  • 启用或禁用审阅特性,例如 Sourcery 自动生成的 Pull Request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Introduces a versioned bilingual changelog system with Go-based tooling, wires it into CI/release workflows (including docs-only routing and a platform smoke gate), and adds repo-local agent skills plus documentation/metadata updates to support the new release process.

Sequence diagram for release workflow with audited versioned release notes

sequenceDiagram
  actor Actions as GitHubActions
  participant validate as job_validate
  participant release_notes_audit as job_release_notes_audit
  participant publish as job_publish
  participant Releasenotes as scripts_releasenotes
  participant GitHub as GitHubAPI
  participant GHCLI as gh_cli

  Actions->>validate: run validate job
  validate-->>Actions: set RELEASE_TAG

  Actions->>release_notes_audit: run Audit release notes
  release_notes_audit->>Releasenotes: go run ./scripts/releasenotes validate --version --dir
  release_notes_audit->>Releasenotes: go run ./scripts/releasenotes audit --repo --from --to --require-classified
  Releasenotes->>GitHub: requestJSON commits/pulls
  GitHub-->>Releasenotes: auditReport
  release_notes_audit->>Releasenotes: go run ./scripts/releasenotes validate --version --dir --audit
  release_notes_audit-->>publish: job dependency release_notes_audit

  Actions->>publish: run Publish GitHub Release
  publish->>Releasenotes: go run ./scripts/releasenotes render --version --dir --output
  publish->>GHCLI: gh release create --notes-file release/release-notes.md
  GHCLI->>GitHub: create draft Release with rendered bilingual body
Loading

Sequence diagram for CI and platform smoke docs-only routing

sequenceDiagram
  actor Actions as GitHubActions
  participant classify_changes as job_classify_changes
  participant changescope as cmd_changescope
  participant quality as job_quality
  participant packaged_smoke as job_packaged_binary_smoke
  participant smoke_gate as job_platform_smoke_gate

  Actions->>classify_changes: run Classify change scope
  classify_changes->>changescope: go run ./scripts/changescope --base --head --github-output
  changescope-->>classify_changes: docs_only=true|false

  Actions->>quality: run quality job (needs classify_changes)
  quality->>quality: releasenotes pr-validate (pull_request only)
  alt docs_only == 'true'
    quality->>quality: sh scripts/test-documentation.sh
  else docs_only != 'true'
    quality->>quality: gofmt / go test / go test -race / go vet
    quality->>quality: sh scripts/build.sh
    quality->>quality: sh scripts/test-package-release.sh
    quality->>quality: sh scripts/test-workflows.sh
    quality->>quality: pre-commit checks
  end

  Actions->>packaged_smoke: run packaged_binary_smoke (needs classify_changes)
  alt docs_only == 'true'
    packaged_smoke-->>Actions: job skipped
  else docs_only != 'true'
    packaged_smoke->>packaged_smoke: build, download, smoke javdb-cli
  end

  Actions->>smoke_gate: run platform_smoke_gate (needs classify_changes, packaged_smoke)
  smoke_gate->>smoke_gate: check DOCS_ONLY and MATRIX_RESULT
  alt DOCS_ONLY == true
    smoke_gate->>smoke_gate: require MATRIX_RESULT == skipped
  else DOCS_ONLY != true
    smoke_gate->>smoke_gate: require MATRIX_RESULT == success
  end
Loading

File-Level Changes

Change Details Files
Add Go-based releasenotes and changescope tooling to manage versioned bilingual changelog entries, PR release-note metadata, and GitHub Release bodies.
  • Introduce scripts/releasenotes CLI with subcommands for validate, audit, prepare, render, pr-validate, and sync-history, including GitHub API integration and extensive unit tests.
  • Add scripts/internal/releasenotesrender package to extract per-version notes and render bilingual GitHub Release bodies.
  • Implement scripts/changescope to classify diffs as docs-only vs full, with strict allowlist and unit tests.
  • Add scripts/test-releasenotes.sh and wire it into pre-commit and documentation tests to validate changelog structure, plans, and historical versions.
scripts/releasenotes/main.go
scripts/releasenotes/main_test.go
scripts/internal/releasenotesrender/render.go
scripts/changescope/main.go
scripts/changescope/main_test.go
scripts/test-releasenotes.sh
.pre-commit-config.yaml
Migrate root changelog into a versioned bilingual changelog/ directory with audited historical releases and release-prep plans.
  • Replace root CHANGELOG.md and CHANGELOG.zh-CN.md bodies with pointers into changelog/ indexes while preserving compatibility.
  • Add changelog/README.{md,zh-CN.md}, versioned v0.1.0–v0.2.0 bilingual notes, unreleased stubs, and JSON plans for historical versions.
  • Extend scripts/test-documentation.sh to assert presence and wiring of new changelog files.
CHANGELOG.md
CHANGELOG.zh-CN.md
changelog/README.md
changelog/README.zh-CN.md
changelog/v0.1.0/en.md
changelog/v0.1.0/zh-CN.md
changelog/v0.1.1/en.md
changelog/v0.1.1/zh-CN.md
changelog/v0.2.0/en.md
changelog/v0.2.0/zh-CN.md
changelog/unreleased/en.md
changelog/unreleased/zh-CN.md
changelog/plans/v0.1.0.json
changelog/plans/v0.1.1.json
changelog/plans/v0.2.0.json
scripts/test-documentation.sh
Wire release-note validation, changelog auditing, and rendering into the release workflow and tighten publish gating.
  • Add release_notes_audit job that checks out the release tag, validates the plan JSON and versioned notes, runs releasenotes validate/audit, and produces an audit JSON.
  • Make publish job depend on release_notes_audit, set up Go tooling there, and render release notes to a file used as the GitHub Release body via --notes-file.
  • Extend scripts/test-workflows.sh to assert presence and wiring of the new audit job, permissions, releasenotes invocations, and notes-file usage.
.github/workflows/release.yml
scripts/test-workflows.sh
Introduce docs-only CI routing and a stable platform smoke gate using the changescope classifier.
  • Add classify_changes job to both ci.yml and platform-smoke.yml that runs scripts/changescope and exposes a docs_only output.
  • Guard quality/packaged_binary_smoke steps with docs_only-based conditionals and add a platform_smoke_gate job that enforces expected matrix results for docs-only vs full changes.
  • Update workflow tests to assert classifier presence, gate job naming, and docs_only wiring.
.github/workflows/ci.yml
.github/workflows/platform-smoke.yml
scripts/test-workflows.sh
Update contributor/maintainer docs, PR template, and agent skills to reflect the new release-note and documentation processes and clarify the public Go SDK.
  • Extend maintainer development, agent, and documentation guidelines to describe classify_changes routing, release-prep manifests, versioned notes, and historical sync responsibilities.
  • Update CONTRIBUTING (both locales), AGENTS.md, and README*.md to point at changelog/, clarify that javdb is the public Go SDK, and prohibit claiming MCP server support.
  • Modify PR template to add a validated release-note metadata block and replace the old unreleased changelog checklist item.
  • Add repo-local .agents/skills for review, docs, commit-message, and release-notes flows, plus a superpowers spec documenting the release-notes system design.
docs/maintainers/development.md
docs/maintainers/agents/documentation-guidelines.md
docs/maintainers/agents/index.md
docs/superpowers/specs/2026-07-30-release-notes-system-design.md
CONTRIBUTING.md
CONTRIBUTING.zh-CN.md
AGENTS.md
README.md
README.zh-CN.md
.github/PULL_REQUEST_TEMPLATE.md
.agents/skills/javdb-cli-review/SKILL.md
.agents/skills/javdb-cli-docs/SKILL.md
.agents/skills/javdb-cli-commit-message/SKILL.md
.agents/skills/javdb-cli-release-notes/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@FlanChanXwO, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7abe9546-80e7-4a28-a4d1-6d596289b1f3

📥 Commits

Reviewing files that changed from the base of the PR and between 2f98ce9 and 72b4cdc.

📒 Files selected for processing (1)
  • internal/cli/authclient_test.go
📝 Walkthrough

Walkthrough

本次变更新增版本化双语发布说明系统、release notes CLI、docs-only CI 分类、发布审计门禁、仓库流程文档,并使磁力相关命令支持匿名请求和认证失败回退。

Changes

版本化发布说明系统

Layer / File(s) Summary
发布说明 CLI、校验与历史同步
scripts/releasenotes/*, scripts/internal/releasenotesrender/*
新增审计、准备、验证、渲染、PR 校验和历史 Release 同步命令,并覆盖双语来源、声明解析、版本升级和 GitHub API 流程。
双语 changelog 与历史迁移
changelog/*, CHANGELOG*.md, README*.md
新增双语索引、版本计划、未发布暂存区及 v0.1.0–v0.3.0 发布说明。根目录 changelog 改为兼容入口。
发布工作流门禁
.github/workflows/release.yml, scripts/test-releasenotes.sh
发布前校验计划和审计结果,渲染双语正文,并使用 --notes-file 创建 Release。

CI 门禁与仓库流程

Layer / File(s) Summary
docs-only 分类与条件化检查
scripts/changescope/*, .github/actions/classify-change-scope/action.yml, .github/workflows/ci.yml, .github/workflows/platform-smoke.yml
通过文档路径白名单分类变更,并根据 docs_only 条件化质量检查和平台 smoke。
PR 契约与维护文档
.agents/skills/*, .github/PULL_REQUEST_TEMPLATE.md, AGENTS.md, CONTRIBUTING*.md, docs/maintainers/*, docs/superpowers/specs/*
新增 release-note 声明模板、四项仓库 skills,以及 changelog 路由、发布授权和审计规则。

匿名磁力请求

Layer / File(s) Summary
可选认证客户端与命令接入
internal/cli/*, internal/javdb/appapi/movie.go, javdb/movie.go, skills/javdb-cli/*, docs/*/cli-reference.md, e2e/run.sh
magnets 和 detail --magnets 可匿名运行。可用令牌会优先使用,认证失败时回退匿名请求一次。测试和文档同步更新。

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant CI
  participant ReleaseNotesCLI
  participant Changelog
  participant GitHubRelease
  PullRequest->>CI: submit release-note declaration
  CI->>ReleaseNotesCLI: validate declaration and change scope
  ReleaseNotesCLI->>Changelog: audit and prepare bilingual notes
  ReleaseNotesCLI->>GitHubRelease: render and publish release body
  GitHubRelease-->>ReleaseNotesCLI: return release body for verification
Loading

Possibly related PRs

Poem

小兔整理 changelog,
双语目录排成行。
令牌失效不慌张,
匿名请求接着忙。
CI 门禁亮银光。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.12% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 标题准确概括了发布说明工作流、匿名磁力请求和双语模板这三项主要变更。
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sourcery-ai sourcery-ai 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.

Hey - 我在这里给出了一些总体反馈:

  • scripts/releasenotes 命令已经变得相当庞大且承担多种职责;可以考虑将其功能拆分到更小的内部包或子命令文件中(例如 audit/prepare/render/sync-history),以便后续维护更轻松,也更容易理解和控制其副作用。
  • scripts/changescope 中的仅文档路径白名单目前是硬编码的;或许值得将这组路径(以及其设计理由)集中放在单一的配置或共享的辅助工具中,这样未来新增文档路径时就不需要在多个位置更新,也能降低遗漏新文档位置的风险。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- The `scripts/releasenotes` command has grown quite large and multi-purpose; consider splitting the functionality into smaller internal packages or subcommands files (e.g., audit/prepare/render/sync-history) to make future maintenance and reasoning about side effects easier.
- The docs-only path allowlist in `scripts/changescope` is currently hard-coded; it may be worth centralizing this set (and its rationale) in a single config or shared helper so future additions to documentation paths don’t require updating multiple places and reduce the risk of missing a new docs location.

Sourcery 对开源项目是免费的——如果你觉得我们的代码评审有帮助,请考虑分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈改进为你提供的评审。
Original comment in English

Hey - I've left some high level feedback:

  • The scripts/releasenotes command has grown quite large and multi-purpose; consider splitting the functionality into smaller internal packages or subcommands files (e.g., audit/prepare/render/sync-history) to make future maintenance and reasoning about side effects easier.
  • The docs-only path allowlist in scripts/changescope is currently hard-coded; it may be worth centralizing this set (and its rationale) in a single config or shared helper so future additions to documentation paths don’t require updating multiple places and reduce the risk of missing a new docs location.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `scripts/releasenotes` command has grown quite large and multi-purpose; consider splitting the functionality into smaller internal packages or subcommands files (e.g., audit/prepare/render/sync-history) to make future maintenance and reasoning about side effects easier.
- The docs-only path allowlist in `scripts/changescope` is currently hard-coded; it may be worth centralizing this set (and its rationale) in a single config or shared helper so future additions to documentation paths don’t require updating multiple places and reduce the risk of missing a new docs location.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

🧹 Nitpick comments (8)
scripts/changescope/main.go (1)

42-46: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

建议用 exec.CommandContext 并对 git 调用设置超时。

golangci-lint noctx 已提示;CI 中挂起的 git diff 会阻塞整条流水线。

🤖 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 `@scripts/changescope/main.go` around lines 42 - 46, Update the git diff
invocation in the surrounding changescope flow to use exec.CommandContext with a
bounded timeout context, ensuring the git process is canceled when the deadline
expires. Preserve the existing arguments, output handling, and wrapped error
reporting around command.Output.

Source: Linters/SAST tools

scripts/test-documentation.sh (1)

27-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

这 6 行与 scripts/test-releasenotes.sh 第 7-12 行完全重复。

可考虑只在 scripts/test-releasenotes.sh 中保留 changelog 入口检查,由文档脚本调用它,避免两处规则漂移。

🤖 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 `@scripts/test-documentation.sh` around lines 27 - 32, Remove the duplicated
changelog entry and file-presence checks from the documentation test, and have
scripts/test-documentation.sh invoke the existing scripts/test-releasenotes.sh
validation instead. Keep the changelog validation centralized in
test-releasenotes.sh so the two scripts cannot drift.
scripts/releasenotes/main.go (3)

730-737: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

None 分支与 else 分支完全相同。

两个分支都只是 source.Note = &note,要么删除多余分支,要么补上原本打算对 None 做的处理。

♻️ 建议简化
 			note, parseErr := parseReleaseNoteDeclaration(pull.Body)
 			if parseErr != nil {
 				source.Issue = parseErr.Error()
-			} else if note.Category == "None" {
-				source.Note = &note
 			} else {
 				source.Note = &note
 			}
🤖 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 `@scripts/releasenotes/main.go` around lines 730 - 737, 简化处理
parseReleaseNoteDeclaration 结果的条件分支:删除对 note.Category == "None" 的冗余判断,保留一次
source.Note = &note 的赋值,同时维持 parseErr 非空时写入 source.Issue 的现有行为。

976-1005: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

git 调用未绑定 context。

collectAudit 已持有 ctx,但 gitRevisionList/gitCommitDetail 用 exec.Command,无法取消或超时(golangci-lint noctx 也已提示)。建议改为 exec.CommandContext 并透传 ctx。

🤖 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 `@scripts/releasenotes/main.go` around lines 976 - 1005, Update gitRevisionList
and gitCommitDetail to accept the existing context.Context and invoke git
through exec.CommandContext instead of exec.Command. Pass collectAudit’s ctx
through every call while preserving the current revision and commit metadata
behavior and error messages.

Source: Linters/SAST tools


507-510: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

[:7] 魔法切片过于脆弱。

排除 New Contributors 依赖两个数组长度恰好为 8。新增分类时会静默错位(中英映射依赖同一下标)。建议显式定义正文分类切片或用 map 建立中英映射。

Also applies to: 545-552

🤖 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 `@scripts/releasenotes/main.go` around lines 507 - 510, 更新 englishSectionOrder
和 chineseSectionOrder 的正文分类选择逻辑,移除依赖固定长度 7 的魔法切片;显式定义不包含 New Contributors
的分类集合,或通过中英分类映射按名称选择,确保新增分类不会导致中英文顺序错位,并同步调整相关的 order 使用处。
.github/workflows/ci.yml (1)

19-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

classify_changes 与 platform-smoke.yml 中的实现完全重复。

两处 job(含 checkout/setup-go/SHA 计算/workflow_dispatch 兜底)逐行一致,后续修改容易漂移。可抽成可复用 workflow(workflow_call)或复合 action。

🤖 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/ci.yml around lines 19 - 51, Extract the duplicated
change-scope detection flow from the classify_changes job and platform-smoke.yml
into a reusable workflow_call workflow or composite action. Preserve the
existing checkout, setup-go, SHA selection, workflow_dispatch fallback, and
changescope invocation behavior, then update both callers to reuse the shared
implementation and expose the docs_only result.
scripts/test-releasenotes.sh (1)

14-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

硬编码版本列表会导致门禁静默退化。

新版本发布时若忘记在此追加版本号,该版本的双语说明与 plan 就完全不被校验。建议直接遍历 changelog/plans/v*.json 推导版本。

♻️ 建议改法
-for version in 0.1.0 0.1.1 0.2.0; do
-	plan="$repo_root/changelog/plans/v$version.json"
-	test -s "$plan"
+for plan in "$repo_root"/changelog/plans/v*.json; do
+	test -s "$plan"
+	version=$(basename "$plan" .json)
+	version=${version#v}
🤖 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 `@scripts/test-releasenotes.sh` around lines 14 - 16, 将版本校验循环从硬编码的
0.1.0、0.1.1、0.2.0 改为遍历 changelog/plans 下所有匹配 v*.json 的 plan 文件,并从文件名直接使用对应路径执行
test -s,确保新增版本会自动纳入校验。
scripts/releasenotes/main_test.go (1)

189-215: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

httptest handler 内不应用 t.Fatalf 终止流程。

t.Fatalf 只能在测试 goroutine 调用;在 http.HandlerFunc goroutine 中调用会跳过响应写入并终止该协程,导致测试行为不确定。这些 handler 分支建议收集失败信息并在测试 goroutine 调用 t.Fatalf,或改为 t.Errorf + 返回错误状态码。

Also applies to: 376-392, 419-435

[maintainability和code_quality]

🤖 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 `@scripts/releasenotes/main_test.go` around lines 189 - 215, Update the
httptest handlers in the test cases around the visible server handler and the
analogous sections noted by the review so they do not call t.Fatalf from the
handler goroutine. Replace unexpected-path or query-mismatch fatal assertions
with handler-safe error reporting and an error HTTP response, or collect the
failure for the main test goroutine to fail after the request completes;
preserve the existing successful response behavior.
🤖 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/PULL_REQUEST_TEMPLATE.md:
- Around line 18-23: 默认 PR 模板中的占位值会通过
parseReleaseNoteDeclaration,导致未填写内容进入发布说明。更新 release-note 模板使用必然非法的哨兵值,或修改
parseReleaseNoteDeclaration 显式拒绝这些占位文本,并为未替换模板的校验失败补充测试。

In @.github/workflows/ci.yml:
- Around line 72-75: 更新 CI 中 docs-only 分支的校验流程,使 `scripts/test-documentation.sh`
之外也执行 `scripts/test-releasenotes.sh`。确保纯 `changelog/` 变更仍经过双语发布说明与 plan
契约校验,并保留现有非 docs-only 流程的行为,避免依赖被 `docs_only != 'true'` 排除的步骤。

In @.github/workflows/release.yml:
- Around line 86-89: Remove unconditional Go caching from the release workflow’s
setup-go steps, especially the publish job and its contents: write permission.
Update the actions/setup-go configuration in release_notes_audit, build, and
publish to disable cache unless a strictly controlled read-only or
restricted-write strategy is already available.
- Around line 100-111: Replace the Python assert checks in the release
validation script around the plan version, previous_tag, and compare_url checks
with explicit if conditions that report an error and terminate nonzero on
mismatch. Preserve the existing validation rules and previous-tag output
behavior, ensuring they cannot be bypassed when Python runs with optimization
enabled.

In `@changelog/plans/v0.2.0.json`:
- Around line 5-25: Update the v0.2.0 manifest entries to match the schema
consumed by scripts/releasenotes: replace each sources array with a single
source value, split entries that have multiple sources into separate entries,
and add the required unique breaking and source-type fields to every entry.
Preserve the existing release-note content while ensuring prepare/validate can
parse all entries.

In `@docs/maintainers/development.md`:
- Around line 113-116: 更新开发文档中关于 GH_TOKEN 权限的说明:将本机只读的 audit 和 dry-run
明确为使用最小读取权限,保留 audit 所需的仓库与 PR 读取权限;仅为 sync-history --apply、修改 GitHub
description、创建 tag 和发布 Release 等外部写操作要求写权限,并保持 GitHub Actions 审计使用受限的
github.token。

In `@scripts/changescope/main.go`:
- Around line 98-109: Update writeOutput to explicitly check and return the
error from file.Close instead of relying on deferred cleanup that discards it.
Preserve the existing early return, OpenFile error handling, and Fprintf result
while ensuring close failures are propagated to the caller.

In `@scripts/releasenotes/main.go`:
- Around line 239-243: Update the githubClient initialization used by the
release-note audit/sync-history flows to inject an HTTP client with an explicit
finite timeout instead of http.DefaultClient. Apply the same change to the
corresponding second initialization, reusing the project’s existing timeout
configuration or defining one consistent timeout for both clients.
- Around line 309-315: 在 prepare 流程中补充 plan 元数据校验:让 readPreparePlan/preparePlan
解析 version、previous_tag 和 compare_url,并在 validatePreparePlan 或其调用处将其与 config 中的
--version、--previous 及预期 compare URL
比对;任一不匹配都应返回错误,避免继续生成错误版本的说明,同时保持现有读取和校验流程不变。
- Around line 1012-1027: Update writeJSON to check and return any error from
closing the opened file, removing the unchecked defer file.Close() while
preserving stdout behavior and returning encoder errors as before.
- Around line 796-812: 更新 firstMergedPullRequest,不再依赖 /search/issues 的
sort=created asc;分页获取该作者全部已合并 PR,按 merged_at 时间比较并返回实际最早合并的
PR。同步调整覆盖查询参数的测试断言及相关文档,确保描述和实现都以合并时间判定首次贡献。

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 19-51: Extract the duplicated change-scope detection flow from the
classify_changes job and platform-smoke.yml into a reusable workflow_call
workflow or composite action. Preserve the existing checkout, setup-go, SHA
selection, workflow_dispatch fallback, and changescope invocation behavior, then
update both callers to reuse the shared implementation and expose the docs_only
result.

In `@scripts/changescope/main.go`:
- Around line 42-46: Update the git diff invocation in the surrounding
changescope flow to use exec.CommandContext with a bounded timeout context,
ensuring the git process is canceled when the deadline expires. Preserve the
existing arguments, output handling, and wrapped error reporting around
command.Output.

In `@scripts/releasenotes/main_test.go`:
- Around line 189-215: Update the httptest handlers in the test cases around the
visible server handler and the analogous sections noted by the review so they do
not call t.Fatalf from the handler goroutine. Replace unexpected-path or
query-mismatch fatal assertions with handler-safe error reporting and an error
HTTP response, or collect the failure for the main test goroutine to fail after
the request completes; preserve the existing successful response behavior.

In `@scripts/releasenotes/main.go`:
- Around line 730-737: 简化处理 parseReleaseNoteDeclaration 结果的条件分支:删除对
note.Category == "None" 的冗余判断,保留一次 source.Note = &note 的赋值,同时维持 parseErr 非空时写入
source.Issue 的现有行为。
- Around line 976-1005: Update gitRevisionList and gitCommitDetail to accept the
existing context.Context and invoke git through exec.CommandContext instead of
exec.Command. Pass collectAudit’s ctx through every call while preserving the
current revision and commit metadata behavior and error messages.
- Around line 507-510: 更新 englishSectionOrder 和 chineseSectionOrder
的正文分类选择逻辑,移除依赖固定长度 7 的魔法切片;显式定义不包含 New Contributors
的分类集合,或通过中英分类映射按名称选择,确保新增分类不会导致中英文顺序错位,并同步调整相关的 order 使用处。

In `@scripts/test-documentation.sh`:
- Around line 27-32: Remove the duplicated changelog entry and file-presence
checks from the documentation test, and have scripts/test-documentation.sh
invoke the existing scripts/test-releasenotes.sh validation instead. Keep the
changelog validation centralized in test-releasenotes.sh so the two scripts
cannot drift.

In `@scripts/test-releasenotes.sh`:
- Around line 14-16: 将版本校验循环从硬编码的 0.1.0、0.1.1、0.2.0 改为遍历 changelog/plans 下所有匹配
v*.json 的 plan 文件,并从文件名直接使用对应路径执行 test -s,确保新增版本会自动纳入校验。
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 89ec7ac1-b201-4977-9665-84fa052abace

📥 Commits

Reviewing files that changed from the base of the PR and between ce3717b and aa5360b.

📒 Files selected for processing (41)
  • .agents/skills/javdb-cli-commit-message/SKILL.md
  • .agents/skills/javdb-cli-docs/SKILL.md
  • .agents/skills/javdb-cli-release-notes/SKILL.md
  • .agents/skills/javdb-cli-review/SKILL.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/workflows/ci.yml
  • .github/workflows/platform-smoke.yml
  • .github/workflows/release.yml
  • .pre-commit-config.yaml
  • AGENTS.md
  • CHANGELOG.md
  • CHANGELOG.zh-CN.md
  • CONTRIBUTING.md
  • CONTRIBUTING.zh-CN.md
  • README.md
  • README.zh-CN.md
  • changelog/README.md
  • changelog/README.zh-CN.md
  • changelog/plans/v0.1.0.json
  • changelog/plans/v0.1.1.json
  • changelog/plans/v0.2.0.json
  • changelog/unreleased/en.md
  • changelog/unreleased/zh-CN.md
  • changelog/v0.1.0/en.md
  • changelog/v0.1.0/zh-CN.md
  • changelog/v0.1.1/en.md
  • changelog/v0.1.1/zh-CN.md
  • changelog/v0.2.0/en.md
  • changelog/v0.2.0/zh-CN.md
  • docs/maintainers/agents/documentation-guidelines.md
  • docs/maintainers/agents/index.md
  • docs/maintainers/development.md
  • docs/superpowers/specs/2026-07-30-release-notes-system-design.md
  • scripts/changescope/main.go
  • scripts/changescope/main_test.go
  • scripts/internal/releasenotesrender/render.go
  • scripts/releasenotes/main.go
  • scripts/releasenotes/main_test.go
  • scripts/test-documentation.sh
  • scripts/test-releasenotes.sh
  • scripts/test-workflows.sh

Comment thread .github/PULL_REQUEST_TEMPLATE.md
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Comment on lines +5 to +25
"entries": [
{
"category": "Added",
"english": "Add verified self-update support that preserves the Homebrew, go install, or Release-archive installation channel.",
"zh_cn": "新增经校验的自更新能力,并保留 Homebrew、go install 或 Release 压缩包的安装渠道。",
"sources": ["https://github.com/FlanChanXwO/javdb-cli/commit/a51115d"]
},
{
"category": "Fixed",
"english": "Preserve LF source bytes on Windows release runners and pass the validated version into production builds.",
"zh_cn": "修复 Windows 发布 runner 的 LF 源码字节保留问题,并将已校验版本传递给生产构建。",
"sources": [
"https://github.com/FlanChanXwO/javdb-cli/commit/8a7c3a0",
"https://github.com/FlanChanXwO/javdb-cli/commit/3924241"
]
},
{
"category": "Changed",
"english": "Align the repository layout with the public SDK facade and protocol-boundary conventions.",
"zh_cn": "调整仓库布局,使其与公开 SDK facade 和协议边界约定保持一致。",
"sources": ["https://github.com/FlanChanXwO/javdb-cli/commit/5e5b769"]

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

修正 manifest 的 entry schema。

设计契约要求每个 entry 具有唯一 source、breaking 和来源类型;当前文件使用 sources 数组且缺少另外两个必填字段。prepare/validate 将无法按约定解析该 manifest,导致 v0.2.0 发布门禁失败。请按 scripts/releasenotes 的实际 schema 拆分多来源条目并补齐字段。

🤖 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 `@changelog/plans/v0.2.0.json` around lines 5 - 25, Update the v0.2.0 manifest
entries to match the schema consumed by scripts/releasenotes: replace each
sources array with a single source value, split entries that have multiple
sources into separate entries, and add the required unique breaking and
source-type fields to every entry. Preserve the existing release-note content
while ensuring prepare/validate can parse all entries.

Comment thread scripts/changescope/main.go
Comment thread scripts/releasenotes/main.go Outdated
Comment on lines +239 to +243
client: githubClient{
baseURL: *apiBase,
token: os.Getenv(*tokenEnv),
client: http.DefaultClient,
},

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

GitHub 客户端缺少超时设置。

http.DefaultClient 无 Timeout,audit/sync-history 在 GitHub 端挂起时会无限阻塞发布工作流;建议注入带超时的客户端。

🛠️ 建议修复
 		client: githubClient{
 			baseURL: *apiBase,
 			token:   os.Getenv(*tokenEnv),
-			client:  http.DefaultClient,
+			client:  &http.Client{Timeout: 30 * time.Second},
 		},

Also applies to: 898-902

🤖 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 `@scripts/releasenotes/main.go` around lines 239 - 243, Update the githubClient
initialization used by the release-note audit/sync-history flows to inject an
HTTP client with an explicit finite timeout instead of http.DefaultClient. Apply
the same change to the corresponding second initialization, reusing the
project’s existing timeout configuration or defining one consistent timeout for
both clients.

Comment thread scripts/releasenotes/main.go Outdated
Comment thread scripts/releasenotes/main.go Outdated
Comment thread scripts/releasenotes/main.go Outdated
Comment on lines +1012 to +1027
func writeJSON(path string, value any) error {
var destination io.Writer = os.Stdout
var file *os.File
if path != "" {
opened, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil {
return err
}
file = opened
destination = file
defer file.Close()
}
encoder := json.NewEncoder(destination)
encoder.SetIndent("", " ")
return encoder.Encode(value)
}

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 | 🟡 Minor | ⚡ Quick win

写文件时未检查 Close 错误。

audit 报告是 prepare/validate 的输入,defer file.Close() 丢弃的错误可能掩盖写入失败,产生被截断的 JSON(errcheck 亦提示)。

🛡️ 建议修复
-	encoder := json.NewEncoder(destination)
-	encoder.SetIndent("", "  ")
-	return encoder.Encode(value)
+	encoder := json.NewEncoder(destination)
+	encoder.SetIndent("", "  ")
+	if err := encoder.Encode(value); err != nil {
+		return err
+	}
+	if file != nil {
+		return file.Close()
+	}
+	return nil

(同时移除上方的 defer file.Close(),或改为忽略二次关闭错误。)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func writeJSON(path string, value any) error {
var destination io.Writer = os.Stdout
var file *os.File
if path != "" {
opened, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil {
return err
}
file = opened
destination = file
defer file.Close()
}
encoder := json.NewEncoder(destination)
encoder.SetIndent("", " ")
return encoder.Encode(value)
}
func writeJSON(path string, value any) error {
var destination io.Writer = os.Stdout
var file *os.File
if path != "" {
opened, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil {
return err
}
file = opened
destination = file
}
encoder := json.NewEncoder(destination)
encoder.SetIndent("", " ")
if err := encoder.Encode(value); err != nil {
return err
}
if file != nil {
return file.Close()
}
return nil
}
🧰 Tools
🪛 golangci-lint (2.12.2)

[error] 1022-1022: Error return value of file.Close is not checked

(errcheck)

🤖 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 `@scripts/releasenotes/main.go` around lines 1012 - 1027, Update writeJSON to
check and return any error from closing the opened file, removing the unchecked
defer file.Close() while preserving stdout behavior and returning encoder errors
as before.

Source: Linters/SAST tools

FlanChanXwO and others added 5 commits July 31, 2026 00:34
magnets and detail --magnets only needed auth because the CLI forced a
token; the underlying /api/v1/movies/{id}/magnets endpoint works
anonymously. Route both through a new withOptionalAuthClient that uses
the saved default token when present, never fails upfront for missing
auth, and retries once anonymously when the server rejects the token.

Also move the e2e magnets checks out of the authed block, drop the
"needs login" help text, and sync the EN/zh-CN docs and skill guides.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adopt the bilingual EN/中文 structure for the pull-request and issue
templates, Copilot instructions, and CONTRIBUTING guides. Align the
changelog wording so release entries carry inline PR or direct-commit
sources. No behavior change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers the anonymous magnets fallback, the versioned release-notes
workflow, bilingual contribution templates, and repository docs. Every
entry cites its commit sources.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FlanChanXwO FlanChanXwO changed the title feat(release): add versioned release notes workflow Release-notes workflow, anonymous magnets, and bilingual templates Aug 2, 2026

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

🧹 Nitpick comments (7)
scripts/releasenotes/audit.go (2)

335-364: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Git 命令失败时丢失 stderr 内容。

exec.Cmd.Output 只返回 *exec.ExitError,错误信息不包含 git 的 stderr。审计在 CI 中失败时,维护者只能看到 “list commits for … : exit status 128”。建议在包装错误时附加 exitErr.Stderr。

🤖 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 `@scripts/releasenotes/audit.go` around lines 335 - 364, Update gitRevisionList
and gitCommitDetail to preserve git stderr when
exec.CommandContext(...).Output() fails. Detect the returned *exec.ExitError and
append its Stderr content to the existing wrapped errors, while retaining the
current error messages for other error types.

238-262: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

每位作者会拉取全部已合并 PR 详情,请求量较大。

该方法对搜索结果中的每个 PR 都发起一次详情请求。对提交较多的作者,这会产生大量请求并快速消耗 GitHub API 速率配额。审计在发布工作流中运行,速率受限会直接导致发布失败。

建议只在需要判定“首次贡献”时缩小范围,例如先按 created 升序取候选,再仅对最早的一小批 PR 取详情比较 merged_at;或缓存审计结果。若维持当前实现,请在文档中记录预期请求量。

🤖 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 `@scripts/releasenotes/audit.go` around lines 238 - 262, Reduce API usage in
mergedPullRequestsByAuthor by ordering search results by created time and
limiting detail lookups to the smallest candidate set needed to determine each
author’s first contribution; do not call pullRequest for every search result.
Preserve correct merged_at evaluation and return behavior, or document the
expected request volume if the full-detail approach must remain.
scripts/releasenotes/main_test.go (3)

323-334: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

元数据校验的其他分支未覆盖。

该用例只验证版本不匹配。validatePreparePlanMetadata 还有三条拒绝路径:初始发布带非空 previous_tag 或 compare_url、previous_tag 不匹配、compare_url 不匹配。建议用表驱动方式补齐。

🤖 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 `@scripts/releasenotes/main_test.go` around lines 323 - 334, 扩展
TestPrepareRejectsMismatchedPlanMetadata,使用表驱动用例覆盖 validatePreparePlanMetadata
的其余拒绝路径:初始发布包含非空 PreviousTag 或 CompareURL、PreviousTag 不匹配,以及 CompareURL
不匹配;保留现有版本不匹配场景,并分别断言返回错误。

476-485: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

strings.Contains(created.Body, "assets") 无法证明请求不含 assets。

该断言只检查渲染出的正文文本里没有 "assets" 字样。创建载荷是否包含 assets 字段由 githubReleaseWrite 的字段集合决定,与正文无关。这条断言在正文措辞变化时还可能误报失败。

建议改为解析原始请求体 JSON,并断言其键集合不含 asset 相关字段。

🤖 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 `@scripts/releasenotes/main_test.go` around lines 476 - 485, 更新
syncHistoricalRelease 测试中针对 created.Body 的 assets 断言:捕获并解析 githubReleaseWrite
发送的原始请求体 JSON,直接检查顶层键集合不包含 assets 相关字段。保留现有版本、名称和 Draft 的断言,避免通过正文文本推断请求载荷结构。

219-260: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

测试未覆盖分页与 merged_at 比较。

/search/issues 只返回一项,mergedPullRequestsByAuthor 在第一页即结束。firstMergedPullRequest 中按 merged_at 取最早项的比较逻辑因此没有被验证。

建议补充一个用例:第一页返回 100 项、第二页返回剩余项,并让创建顺序与合并顺序不一致。这样可以证明实现按合并时间而不是创建时间判定首次贡献。

🤖 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 `@scripts/releasenotes/main_test.go` around lines 219 - 260,
扩展现有测试服务器对“/search/issues”的模拟,使第一页返回恰好 100 个合并 PR、第二页返回剩余 PR,并验证请求了第二页;安排这些 PR
的创建顺序与 merged_at 顺序不同。更新断言以确认 firstMergedPullRequest 通过
mergedPullRequestsByAuthor 按 merged_at 选择最早合并的 PR,而不是按返回或创建顺序选择。
scripts/test-releasenotes.sh (1)

18-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

plan 元数据校验逻辑与发布工作流重复。

.github/workflows/release.yml 第 100-116 行内嵌了同一段 Python 校验(version、previous_tag、compare_url 与 0.1.0 例外)。两处独立维护,规则一旦变化就会分叉。

建议把该校验抽成一个共享脚本,或在 releasenotes CLI 中提供一个 plan 校验子命令,然后由脚本与工作流共同调用。

🤖 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 `@scripts/test-releasenotes.sh` around lines 18 - 35, 将
scripts/test-releasenotes.sh 中内嵌的 plan 元数据校验逻辑抽取到可复用的共享脚本或 releasenotes CLI
校验子命令中,涵盖 version、previous_tag、compare_url 及 0.1.0 特例;让 test-releasenotes.sh 与
.github/workflows/release.yml 共同调用该实现,删除两处重复校验并确保现有校验结果保持一致。
scripts/releasenotes/prepare.go (1)

215-231: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

变量遮蔽与不确定的错误信息。

第 220 行的 planned 遮蔽了第 195 行的 planned map。两者含义不同,容易在后续修改时误用。
第 229-231 行在 map 上取第一个键后立即返回。map 遍历顺序不确定,同一份数据可能报告不同的贡献者。建议排序后一次性列出全部多余贡献者。

🤖 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 `@scripts/releasenotes/prepare.go` around lines 215 - 231, 在校验新贡献者的逻辑中,避免循环内的
planned 遮蔽外层 planned map,使用能区分单个贡献者的名称。处理 plannedContributors
剩余项时先收集并排序所有登录名,再一次性构造包含全部缺失贡献者的错误信息,确保结果稳定且不遗漏项目。
🤖 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/ISSUE_TEMPLATE/feature-request.yml:
- Line 53: Remove the render: text configuration from the alternatives field in
the issue template, while preserving the existing render settings for fields
that collect logs or commands.

In `@CONTRIBUTING.md`:
- Line 71: Update the release-sensitive checks checklist entry at
CONTRIBUTING.md:71-71 and CONTRIBUTING.zh-CN.md:71-71 to use the
repository-relative paths scripts/test-package-release.sh,
scripts/test-homebrew-formula.sh, scripts/test-workflows.sh,
scripts/test-documentation.sh, and scripts/test-architecture.sh in both locale
files.

In `@internal/cli/authclient.go`:
- Around line 81-85: 更新认证初始化流程,保留 openAuth 和 store.Default
返回的具体错误;仅在明确表示不存在默认账户或 token
为空时继续匿名请求。其他认证存储、解析、读取、权限及文件系统错误必须向调用方返回,确保不会被转化为成功结果,并为这些错误路径补充回归测试。

In `@README.md`:
- Around line 206-207: Update the English README authentication description near
the Magnet, TOP250, and user-list command notes to state that requests fall back
to anonymous access when the saved token is rejected, matching the corresponding
README.zh-CN.md behavior and keeping both locale documents consistent.

In `@scripts/changescope/documentation_paths.go`:
- Around line 16-22: 更新 directoryPrefixes,使其仅匹配 changelog/ 下的 Markdown 内容路径,排除
changelog/plans/;保留其他文档专属路径不变。为 changelog/plans/*.json
增加完整验证测试,确保仅修改这些计划文件时不会被判定为 docs_only。

In `@scripts/releasenotes/audit.go`:
- Around line 43-47: Configure both githubClient construction sites with the
same explicit HTTP timeout: update scripts/releasenotes/audit.go lines 43-47 and
scripts/releasenotes/history.go lines 36-40, replacing http.DefaultClient with a
shared timeout-configured client or constructor and adding the required time
import. Ensure both command entry points use the identical timeout value.
- Line 314: Update the response-body cleanup near response.Body.Close to
explicitly discard the Close return value, satisfying errcheck while preserving
the existing behavior that close failures do not affect the result.

In `@scripts/releasenotes/history.go`:
- Around line 59-77: Handle the ignored return values from both fmt.Fprintf
calls in the historical release flow by explicitly assigning them to blank
identifiers, preserving the existing output messages and control flow in the
Apply checks.

In `@scripts/releasenotes/prepare.go`:
- Around line 89-93: 在 prepare 流程中更新 fmt.Fprintln 调用,显式忽略其返回值以通过
errcheck;同时处理同文件中 file.Close() 的未检查返回值,使用显式结果丢弃方式,保持现有行为不变。
- Around line 368-374: 更新包含 versionMarker 的 replace 分支:不要直接返回原始
body,而应定位该版本的索引行并按当前版本日期及 compare 链接重写后返回。非 replace 场景仍保留现有重复版本错误行为,确保 --replace
后索引与版本说明文件保持一致。

---

Nitpick comments:
In `@scripts/releasenotes/audit.go`:
- Around line 335-364: Update gitRevisionList and gitCommitDetail to preserve
git stderr when exec.CommandContext(...).Output() fails. Detect the returned
*exec.ExitError and append its Stderr content to the existing wrapped errors,
while retaining the current error messages for other error types.
- Around line 238-262: Reduce API usage in mergedPullRequestsByAuthor by
ordering search results by created time and limiting detail lookups to the
smallest candidate set needed to determine each author’s first contribution; do
not call pullRequest for every search result. Preserve correct merged_at
evaluation and return behavior, or document the expected request volume if the
full-detail approach must remain.

In `@scripts/releasenotes/main_test.go`:
- Around line 323-334: 扩展 TestPrepareRejectsMismatchedPlanMetadata,使用表驱动用例覆盖
validatePreparePlanMetadata 的其余拒绝路径:初始发布包含非空 PreviousTag 或
CompareURL、PreviousTag 不匹配,以及 CompareURL 不匹配;保留现有版本不匹配场景,并分别断言返回错误。
- Around line 476-485: 更新 syncHistoricalRelease 测试中针对 created.Body 的 assets
断言:捕获并解析 githubReleaseWrite 发送的原始请求体 JSON,直接检查顶层键集合不包含 assets 相关字段。保留现有版本、名称和
Draft 的断言,避免通过正文文本推断请求载荷结构。
- Around line 219-260: 扩展现有测试服务器对“/search/issues”的模拟,使第一页返回恰好 100 个合并 PR、第二页返回剩余
PR,并验证请求了第二页;安排这些 PR 的创建顺序与 merged_at 顺序不同。更新断言以确认 firstMergedPullRequest 通过
mergedPullRequestsByAuthor 按 merged_at 选择最早合并的 PR,而不是按返回或创建顺序选择。

In `@scripts/releasenotes/prepare.go`:
- Around line 215-231: 在校验新贡献者的逻辑中,避免循环内的 planned 遮蔽外层 planned
map,使用能区分单个贡献者的名称。处理 plannedContributors
剩余项时先收集并排序所有登录名,再一次性构造包含全部缺失贡献者的错误信息,确保结果稳定且不遗漏项目。

In `@scripts/test-releasenotes.sh`:
- Around line 18-35: 将 scripts/test-releasenotes.sh 中内嵌的 plan
元数据校验逻辑抽取到可复用的共享脚本或 releasenotes CLI 校验子命令中,涵盖 version、previous_tag、compare_url
及 0.1.0 特例;让 test-releasenotes.sh 与 .github/workflows/release.yml
共同调用该实现,删除两处重复校验并确保现有校验结果保持一致。
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e4d77d6-5d79-4687-a406-29fba6c38c6f

📥 Commits

Reviewing files that changed from the base of the PR and between aa5360b and 2f98ce9.

📒 Files selected for processing (45)
  • .github/ISSUE_TEMPLATE/bug-report.yml
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/ISSUE_TEMPLATE/feature-request.yml
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/actions/classify-change-scope/action.yml
  • .github/copilot-instructions.md
  • .github/workflows/ci.yml
  • .github/workflows/platform-smoke.yml
  • .github/workflows/release.yml
  • CONTRIBUTING.md
  • CONTRIBUTING.zh-CN.md
  • README.md
  • README.zh-CN.md
  • changelog/README.md
  • changelog/README.zh-CN.md
  • changelog/plans/v0.3.0.json
  • changelog/v0.3.0/en.md
  • changelog/v0.3.0/zh-CN.md
  • docs/en/cli-reference.md
  • docs/maintainers/development.md
  • docs/zh-CN/cli-reference.md
  • e2e/run.sh
  • internal/cli/authclient.go
  • internal/cli/authclient_test.go
  • internal/cli/detail_cmd.go
  • internal/cli/detail_test.go
  • internal/cli/magnets_cmd.go
  • internal/cli/magnets_cmd_test.go
  • internal/javdb/appapi/movie.go
  • javdb/movie.go
  • scripts/changescope/documentation_paths.go
  • scripts/changescope/main.go
  • scripts/changescope/main_test.go
  • scripts/releasenotes/audit.go
  • scripts/releasenotes/history.go
  • scripts/releasenotes/main.go
  • scripts/releasenotes/main_test.go
  • scripts/releasenotes/prepare.go
  • scripts/releasenotes/render.go
  • scripts/releasenotes/validate.go
  • scripts/test-documentation.sh
  • scripts/test-releasenotes.sh
  • scripts/test-workflows.sh
  • skills/javdb-cli/SKILL.md
  • skills/javdb-cli/references/discover.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • changelog/README.zh-CN.md
  • changelog/README.md
  • .github/workflows/ci.yml
  • docs/maintainers/development.md
  • .github/workflows/release.yml
  • .github/workflows/platform-smoke.yml

description: Describe existing commands, workarounds, or other designs you considered.
label: Alternatives considered / 已考虑的替代方案
description: Describe existing commands, workarounds, or other designs you considered. / 请说明已考虑的现有命令、变通方案或其他设计。
render: text

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
set -euo pipefail

echo "== file exists and relevant lines =="
if [ -f .github/ISSUE_TEMPLATE/feature-request.yml ]; then
  nl -ba .github/ISSUE_TEMPLATE/feature-request.yml | sed -n '1,140p'
else
  echo ".github/ISSUE_TEMPLATE/feature-request.yml not found"
fi

echo
echo "== all render fields in issue templates =="
rg -n "render:\s*(text|markdown|code|yaml|json|shell|html)" .github/ISSUE_TEMPLATE || true

Repository: FlanChanXwO/javdb-cli

Length of output: 236


🌐 Web query:

GitHub Forms schema options field render markdown code text behavior

💡 Result:

In GitHub issue form schemas, markdown support within the options of fields (specifically for dropdown and checkboxes elements) is limited to basic formatting [1][2][3]. According to official documentation, for the label attribute within an options array, markdown is supported for bold or italic text formatting and hyperlinks [1][2][3]. It is important to note that this support does not extend to rendering code blocks or more complex markdown elements within those option labels [1][2]. If you require high-fidelity markdown rendering—such as code snippets or complex layouts—you should use a separate markdown element to provide the necessary context, as the markdown element type is explicitly designed to render full markdown, including code blocks, though its content is not submitted with the form [1][2][4]. Summary of behavior: - Dropdown/Checkbox labels: Supported for limited markdown (bold, italics, hyperlinks) [1][2]. - Code blocks: Not supported in option labels [1][2]. - Markdown element type: Supports full markdown (including code blocks) but is for display/context only and is not submitted [1][2][4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== find nl or use awk for numbered view =="
(sed -n '1,140p' .github/ISSUE_TEMPLATE/feature-request.yml | awk '{printf "%6d\t%s\n", NR, $0}') || true

echo
echo "== render fields in issue templates =="
rg -n "render:\s*(text|markdown|code|yaml|json|shell|html)" .github/ISSUE_TEMPLATE || true

Repository: FlanChanXwO/javdb-cli

Length of output: 3207


🌐 Web query:

site:docs.github.com issue form schema textarea render text text area code block text area render option text

💡 Result:

In the context of GitHub issue form schemas, the render key is an attribute used specifically within a textarea element to define how submitted content should be formatted [1][2]. When the render attribute is specified, the input provided in the textarea will be automatically wrapped in a Markdown code block using the language syntax specified by that value [1][2]. For example, setting render: bash will format the input as a bash code block, while render: shell will format it as a shell script block [1][2]. When this attribute is utilized, the textarea UI does not expand for file attachments or Markdown editing, as the primary purpose of the field becomes structured code input [1][2]. Supported values for the render attribute correspond to the programming languages recognized by GitHub [1][2].

Citations:


🌐 Web query:

GitHub issue forms textarea render option text text area render text code block

💡 Result:

In GitHub issue forms, the render attribute for a textarea field allows you to control how the submitted content is formatted [1][2]. When a render value is specified, the input is automatically wrapped in a code block, which eliminates the need for the user to manually enter backticks [3][4]. Key details regarding the render attribute for textarea: - Functionality: If you provide a value to the render attribute, the submitted text will be formatted as a code block [1][2]. - Constraints: When the render key is used, the text area will not expand to allow for file attachments or rich Markdown editing [1][2]. - Values: You can specify a language for the code block (e.g., bash, shell, json, yaml, etc.) to trigger syntax highlighting [1][3][2]. The allowed values correspond to the languages supported by GitHub Linguist [1][2]. - Usage Example: - type: textarea id: logs attributes: label: Relevant log output render: shell In this example, the input provided by the user will be rendered as a shell code block [3][4]. Additionally, you can use render: markdown if you want the submitted text to be treated as Markdown content [5][4].

Citations:


🌐 Web query:

GitHub docs issue forms render: markdown textarea code block

💡 Result:

In GitHub issue forms, you can ensure user input in a textarea is rendered as a code block by using the render key in your YAML configuration [1][2]. When you provide a language value to the render key, the content submitted by the user in that textarea is automatically wrapped in a Markdown code block using that language [1][3]. This eliminates the need for the user to manually type backticks [2]. Example configuration: - type: textarea id: logs attributes: label: Relevant log output description: Please copy and paste any relevant log output. render: shell validations: required: true Important considerations: - If the render key is provided, the textarea will not expand to allow for file attachments or additional Markdown editing by the contributor [1][4]. - The value provided for render must be a language known to GitHub (e.g., shell, bash, json, python) [1][3]. For a complete list of supported languages, you can refer to the languages YAML file in the GitHub Linguist repository [1][4].

Citations:


🌐 Web query:

site:docs.github.com "render" "textarea" "issue forms" "text"

💡 Result:

In GitHub issue forms, the render key is an optional attribute used within a textarea element to automatically format submitted text into a code block [1][2]. When you provide a language or format (such as shell, bash, or markdown) to the render key, the content entered by the user into that textarea will be wrapped in the corresponding Markdown code block syntax upon submission [1][3]. Important considerations when using the render attribute: - Functional limitation: When you include the render key in a textarea, the field will not support file attachments or Markdown editing (e.g., standard text formatting features) [1][4]. - Languages: The value provided to render must be a language recognized by GitHub [1]. You can refer to the GitHub Linguist repository for a full list of supported language identifiers [1]. - Example usage: body: - type: textarea id: logs attributes: label: Relevant log output render: shell validations: required: true In this example, any text entered into the "Relevant log output" field will be automatically formatted as a shell script code block when the issue is created [2][5].

Citations:


不要给 alternatives 添加 render: text。

render 会启用代码块渲染模式,并会禁用 Markdown 编辑和附件扩展。alternatives 用于自然语言说明,不应使用代码块渲染;保留日志或命令字段所需的 render 配置即可。

建议修改
       description: Describe existing commands, workarounds, or other designs you considered. / 请说明已考虑的现有命令、变通方案或其他设计。
-      render: text
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
render: text
🤖 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/ISSUE_TEMPLATE/feature-request.yml at line 53, Remove the render:
text configuration from the alternatives field in the issue template, while
preserving the existing render settings for fields that collect logs or
commands.

Comment thread CONTRIBUTING.md
- [ ] `go test ./... -count=1` passes.
- [ ] `go vet ./...` passes.
- [ ] `sh scripts/build.sh` passes.
- [ ] The release-sensitive checks pass (`scripts/test-package-release.sh`, `test-homebrew-formula.sh`, `test-workflows.sh`, `test-documentation.sh`, `test-architecture.sh`).

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/sh
set -eu

# 检查清单列出的脚本是否存在。
for name in \
  test-package-release.sh \
  test-homebrew-formula.sh \
  test-workflows.sh \
  test-documentation.sh \
  test-architecture.sh
do
  matches="$(fd --type f --hidden --exclude .git --glob "$name" . || true)"
  if [ -z "$matches" ]; then
    printf '缺少脚本: %s\n' "$name" >&2
    exit 1
  fi
done

Repository: FlanChanXwO/javdb-cli

Length of output: 159


🏁 Script executed:

#!/bin/sh
set -eu

printf '列出匹配脚本文件:\n'
fd --type f --hidden --exclude .git '^(test-package-release|test-homebrew-formula|test-workflows|test-documentation|test-architecture)\.sh$' . || true

printf '\n贡献指南第71行:\n'
for f in CONTRIBUTING.md CONTRIBUTING.zh-CN.md; do
  if [ -f "$f" ]; then
    sed -n '65,75p' "$f"
  fi
done

printf '\nworkflow 中脚本调用:\n'
rg -n "scripts/test-(?:package-release|homebrew-formula|workflows|documentation|architecture)\.sh|test-(?:homebrew-formula|workflows|documentation|architecture)\.sh" .github/workflows || true

Repository: FlanChanXwO/javdb-cli

Length of output: 1951


统一 CONTRIBUTING 清单中的发布检查脚本路径。

清单中列出的裸脚本名与实际仓库文件不一致,两个 locale 的条目都需要改为实际路径:scripts/test-package-release.sh、scripts/test-homebrew-formula.sh、scripts/test-workflows.sh、scripts/test-documentation.sh 和 scripts/test-architecture.sh。

📍 Affects 2 files
  • CONTRIBUTING.md#L71-L71 (this comment)
  • CONTRIBUTING.zh-CN.md#L71-L71
🤖 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` at line 71, Update the release-sensitive checks checklist
entry at CONTRIBUTING.md:71-71 and CONTRIBUTING.zh-CN.md:71-71 to use the
repository-relative paths scripts/test-package-release.sh,
scripts/test-homebrew-formula.sh, scripts/test-workflows.sh,
scripts/test-documentation.sh, and scripts/test-architecture.sh in both locale
files.

Source: Learnings

Comment on lines +81 to +85
if _, store, err := openAuth(); err == nil {
if acc, aerr := store.Default(); aerr == nil {
token = acc.Token
}
}

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

不要吞掉 openAuth 和 store.Default 的错误。

当前代码忽略所有认证存储错误。损坏的 auth.json、读取失败或权限失败会改为匿名请求,并可能返回成功结果。

仅将预期的“无默认账户”或空 token 状态视为匿名请求。返回其他认证和文件系统错误。为这些错误添加回归测试。

As per coding guidelines:不得将 authentication、network、JavDB API 或 filesystem 错误隐藏为成功结果。

🤖 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 `@internal/cli/authclient.go` around lines 81 - 85, 更新认证初始化流程,保留 openAuth 和
store.Default 返回的具体错误;仅在明确表示不存在默认账户或 token
为空时继续匿名请求。其他认证存储、解析、读取、权限及文件系统错误必须向调用方返回,确保不会被转化为成功结果,并为这些错误路径补充回归测试。

Source: Coding guidelines

Comment thread README.md
Comment on lines +206 to +207
Magnet commands work anonymously and use the saved token when available.
TOP250 and user-list commands need the default authenticated account.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

同步英文 README 的无效 token 回退说明。

README.md 只说明存在时使用保存的 token。README.zh-CN.md 还说明 token 被拒绝后会回退匿名请求。

在英文文档中加入相同的回退行为说明。否则不同 locale 的用户会得到不同的认证行为预期。

Based on learnings:认证行为变更必须同步更新两个 locale 的 CLI reference、README 和 skills/javdb-cli/。

🤖 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 `@README.md` around lines 206 - 207, Update the English README authentication
description near the Magnet, TOP250, and user-list command notes to state that
requests fall back to anonymous access when the saved token is rejected,
matching the corresponding README.zh-CN.md behavior and keeping both locale
documents consistent.

Source: Learnings

Comment on lines +16 to +22
directoryPrefixes: []string{
"docs/",
"changelog/",
"skills/",
".agents/skills/",
".github/ISSUE_TEMPLATE/",
},

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

不要将 changelog/plans/ 归类为文档专属路径。

changelog/ 会批准 changelog/plans/v*.json。这些 JSON 文件是 release notes 审计和渲染的输入。仅修改计划文件时,docs_only 会跳过完整质量门禁和平台 smoke,但发布输出行为已改变。

请只允许 changelog 的 Markdown 内容路径,并为 changelog/plans/*.json 添加“完整验证”测试。

🤖 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 `@scripts/changescope/documentation_paths.go` around lines 16 - 22, 更新
directoryPrefixes,使其仅匹配 changelog/ 下的 Markdown 内容路径,排除
changelog/plans/;保留其他文档专属路径不变。为 changelog/plans/*.json
增加完整验证测试,确保仅修改这些计划文件时不会被判定为 docs_only。

Comment on lines +43 to +47
client: githubClient{
baseURL: *apiBase,
token: os.Getenv(*tokenEnv),
client: http.DefaultClient,
},

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

GitHub 客户端缺少超时设置。 两处命令入口都用 http.DefaultClient 构造 githubClient。该客户端没有 Timeout。GitHub 端挂起时,请求会无限等待并阻塞发布工作流。根因是构造 githubClient 时没有注入带超时的 *http.Client。

  • scripts/releasenotes/audit.go#L43-L47:把 client: http.DefaultClient 改为带明确超时的客户端,例如 &http.Client{Timeout: 30 * time.Second},并导入 time。
  • scripts/releasenotes/history.go#L36-L40:使用同一个超时配置构造客户端,避免两处取值分叉;建议抽出一个共享的构造函数。
📍 Affects 2 files
  • scripts/releasenotes/audit.go#L43-L47 (this comment)
  • scripts/releasenotes/history.go#L36-L40
🤖 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 `@scripts/releasenotes/audit.go` around lines 43 - 47, Configure both
githubClient construction sites with the same explicit HTTP timeout: update
scripts/releasenotes/audit.go lines 43-47 and scripts/releasenotes/history.go
lines 36-40, replacing http.DefaultClient with a shared timeout-configured
client or constructor and adding the required time import. Ensure both command
entry points use the identical timeout value.

if err != nil {
return err
}
defer response.Body.Close()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

response.Body.Close 的返回值未检查。

golangci-lint 的 errcheck 会报错。读取响应体后关闭失败不影响结果,显式忽略即可。

🛠️ 建议修复
-	defer response.Body.Close()
+	defer func() { _ = response.Body.Close() }()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
defer response.Body.Close()
defer func() { _ = response.Body.Close() }()
🧰 Tools
🪛 golangci-lint (2.12.2)

[error] 314-314: Error return value of response.Body.Close is not checked

(errcheck)

🤖 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 `@scripts/releasenotes/audit.go` at line 314, Update the response-body cleanup
near response.Body.Close to explicitly discard the Close return value,
satisfying errcheck while preserving the existing behavior that close failures
do not affect the result.

Source: Linters/SAST tools

Comment on lines +59 to +77
if !config.Apply {
fmt.Fprintf(os.Stdout, "would create historical Release v%s without assets\n", config.Version)
return nil
}
created := githubRelease{}
if err := config.Client.requestJSON(ctx, http.MethodPost, "/repos/"+config.Repository+"/releases", githubReleaseWrite{
TagName: "v" + config.Version,
Name: "v" + config.Version,
Body: body,
Draft: false,
}, &created); err != nil {
return fmt.Errorf("create historical Release v%s: %w", config.Version, err)
}
release = created
} else {
if !config.Apply {
fmt.Fprintf(os.Stdout, "would update historical Release v%s body; assets remain unchanged\n", config.Version)
return nil
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

未检查 fmt.Fprintf 的返回值。

golangci-lint 的 errcheck 对第 60 行与第 75 行报错。改为 _, _ = fmt.Fprintf(...)。

🧰 Tools
🪛 golangci-lint (2.12.2)

[error] 60-60: Error return value of fmt.Fprintf is not checked

(errcheck)


[error] 75-75: Error return value of fmt.Fprintf is not checked

(errcheck)

🤖 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 `@scripts/releasenotes/history.go` around lines 59 - 77, Handle the ignored
return values from both fmt.Fprintf calls in the historical release flow by
explicitly assigning them to blank identifiers, preserving the existing output
messages and control flow in the Apply checks.

Source: Linters/SAST tools

Comment on lines +89 to +93
if !config.Apply {
for _, path := range sortedFilePaths(files) {
fmt.Fprintln(os.Stdout, path)
}
return nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

未检查 fmt.Fprintln 的返回值。

golangci-lint 的 errcheck 会报错。改为 _, _ = fmt.Fprintln(...)。同文件第 412 行的 file.Close() 也未检查返回值,请一并处理。

🧰 Tools
🪛 golangci-lint (2.12.2)

[error] 91-91: Error return value of fmt.Fprintln is not checked

(errcheck)

🤖 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 `@scripts/releasenotes/prepare.go` around lines 89 - 93, 在 prepare 流程中更新
fmt.Fprintln 调用,显式忽略其返回值以通过 errcheck;同时处理同文件中 file.Close()
的未检查返回值,使用显式结果丢弃方式,保持现有行为不变。

Source: Linters/SAST tools

Comment on lines +368 to +374
versionMarker := "v" + version + "]("
if strings.Contains(content, versionMarker) {
if replace {
return body, nil
}
return nil, fmt.Errorf("changelog index already contains v%s", version)
}

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 | 🟡 Minor | ⚡ Quick win

--replace 时索引行不会被更新。

如果索引已包含该版本且 replace 为 true,函数直接返回原文件内容。此时版本目录下的说明文件会被替换,但索引中的日期与 compare 链接保持旧值。历史回填如果修正了日期或前序标签,索引会与说明文件不一致。

请确认这是期望行为;否则应重写该行而不是跳过。

🤖 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 `@scripts/releasenotes/prepare.go` around lines 368 - 374, 更新包含 versionMarker 的
replace 分支:不要直接返回原始 body,而应定位该版本的索引行并按当前版本日期及 compare 链接重写后返回。非 replace
场景仍保留现有重复版本错误行为,确保 --replace 后索引与版本说明文件保持一致。

config.Dir resolves the auth store via os.UserHomeDir, which reads
USERPROFILE on Windows rather than HOME. The withOptionalAuthClient
tests set only HOME, so on Windows runners they shared the real user
profile, and a seeded token leaked into the anonymous test when the
race run followed the non-race run in the same job. Redirect both
HOME and the Windows home env vars to a per-test temp directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FlanChanXwO
FlanChanXwO merged commit 1565709 into main Aug 2, 2026
13 checks passed
FlanChanXwO added a commit that referenced this pull request Aug 2, 2026
After the squash merge of PR #6, the release range on main is the six
merged pull requests #1-#6, not the original branch commits. Rewrite
the v0.3.0 plan and bilingual notes to cite those PR URLs so the
release audit source coverage matches, and fold the magnets behavior
into PR #6's Added entry.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@FlanChanXwO
FlanChanXwO deleted the codex/release-notes-system branch August 10, 2026 03:00
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