Repository navigation
Conversation
There was a problem hiding this comment.
你好——我发现了 1 个问题
面向 AI Agent 的提示
请处理此次代码审查中的评论:
## 单独评论
### 评论 1
<location path=".github/workflows/release.yml" line_range="45-47" />
<code_context>
+ if: >-
+ github.event_name == 'pull_request' &&
+ github.event.action != 'closed' &&
+ (contains(github.event.pull_request.labels.*.name, 'release') ||
+ startsWith(github.event.pull_request.head.ref, 'release-prep/')) &&
+ github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
- outputs:
</code_context>
<issue_to_address>
**小问题:** Release Readiness 作业会对任何头部分支以 `release-prep/` 开头的同仓库 PR 运行,即使该 PR 没有 `release` 标签。这与所述的显式标签触发条件相矛盾,并导致未添加标签的发布准备分支也会接收特定于发布的验证和状态检查。
**触发场景:** 同仓库 PR 使用以 `release-prep/` 开头的头部分支,但尚未添加 `release` 标签时。
**建议修复:** 在作业条件中要求存在 `release` 标签,或移除 `startsWith(github.event.pull_request.head.ref, 'release-prep/')` 这一备选条件。
</issue_to_address>Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/release.yml" line_range="45-47" />
<code_context>
+ if: >-
+ github.event_name == 'pull_request' &&
+ github.event.action != 'closed' &&
+ (contains(github.event.pull_request.labels.*.name, 'release') ||
+ startsWith(github.event.pull_request.head.ref, 'release-prep/')) &&
+ github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
- outputs:
</code_context>
<issue_to_address>
**nitpick:** The Release Readiness job runs for any same-repository PR whose head branch starts with `release-prep/`, even when the PR has no `release` label. This contradicts the stated explicit-label trigger and causes unlabelled release-preparation branches to receive release-specific validation and status checks.
**Triggers:** When a same-repository PR uses a `release-prep/` head branch before the `release` label is added.
**Suggested fix:** Require the `release` label in the job condition, or remove the `startsWith(github.event.pull_request.head.ref, 'release-prep/')` alternative.
</issue_to_address>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #580 +/- ##
=======================================
Coverage 72.93% 72.93%
=======================================
Files 72 72
Lines 6798 6798
Branches 6798 6798
=======================================
Hits 4958 4958
Misses 1546 1546
Partials 294 294 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…rge queue - Drop require_conventional and fail_on_unmatched_commit so a single unconventional commit (e.g. GitHub's Revert button) no longer blocks nightly, beta and stable releases; map `Revert "..."` to `revert:`. - Move Release Readiness into its own workflow that also runs on merge_group, checking the queue entry that lands the release commit. - Fail readiness for release-prep PRs without the release label. - Release only listens for closed PRs; unlabeled closes use a throwaway concurrency group instead of queueing behind release builds. - Wait for the deleted nightly tag to disappear before recreating it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ULwm4FYPWei21gc5bhw1x
- Nightly builds new commits without a bumping change against the next patch version instead of skipping; beta still skips. - Group security-tagged commits after the skip rules so dependency bumps stay out of the changelog. - Prepare closes other open release-prep PRs when the version changes. - Require pkgver for non-dry-run AUR publication. - Document the 7-day build artifact limit for failed-job reruns. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ULwm4FYPWei21gc5bhw1x
Set features_always_bump_minor = false so `auto` derives 0.7.x from features on main; starting 0.8 requires an explicit `minor` selection or a breaking change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ULwm4FYPWei21gc5bhw1x
- PRERELEASE_BRANCH (default main) selects where beta and nightly come from; scheduled nightly builds that branch's head and manual prereleases from other branches fail fast. Stable stays on main. - Prerelease notes use the latest reachable stable tag as an explicit range, so a dev branch that merges main does not repeat published fixes. - Stable releases no longer move the Homebrew maa-cli-beta formula back. - Run CI and markdown lint on dev-* branches. - Document the dev branch model and how it merges back into main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ULwm4FYPWei21gc5bhw1x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Loong · project thread
Stable 发布现在由带
release标签的同仓库 PR 合入main明确触发。版本和 changelog 在 PR 中一起审核,普通版本 bump 不再触发发布;已单独更新版本时,可以创建只更新 changelog 的 release PR。Beta/Nightly 改为从PRERELEASE_BRANCH指定的分支发布(默认main),这样main只发 stable,大改动(如 0.8)在 dev 分支上出 beta。Stable
Prepare Stable Release,支持auto、patch、minor、major和指定版本,使用 git-cliff 2.13.1 推导版本和生成 changelog。重新运行时会关闭其他未合并的release-prep/*PR 并删除其分支。Release Readinessworkflow,在pull_request和merge_group上运行:带标签的 PR 只能改CHANGELOG.md、Cargo.lock、crates/maa-cli/Cargo.toml,且 changelog 必须是最新的;release-prep/*分支没有release标签时直接失败(合并后不会发布);merge queue 中按实际合并结果再检查一次,避免队列里前面的 PR 让 changelog 过期。release.yml只监听pull_request: closed,未合并或无标签的关闭事件使用独立 concurrency 组,不再占用release-state队列。feat只 bump patch(features_always_bump_minor = false),新 minor 需要显式选择或 breaking change。require_conventional/fail_on_unmatched_commit,非约定式提交不会再卡住所有发布通道;GitHub Revert 按钮生成的Revert "..."映射为revert:;Security 分组放在 skip 规则之后,dependabot 不再进入 Security。Beta / Alpha (Nightly)
MAA_VERSION注入版本,不修改源码分支的 Cargo.toml、Cargo.lock 或 changelog。编号由已发布索引维护;Beta tag 或 Nightly 发布超前于索引时,先恢复索引再分配序号。PRERELEASE_BRANCH:定时 Nightly 和手动 Beta/Alpha 都从该分支取源码(scheduled run 只在默认分支触发,所以由 workflow 主动 checkout 该分支);从其他分支手动运行会直接失败。上一个 stable tag..HEAD区间生成,避免 dev 分支合并 main 后把已发布提交算进来。发布产物与下游
version分支,拒绝 tag 冲突及旧发布覆盖较新索引。pkgver。maa-cli-beta只在 stable 比当前 beta 新时才跟进,不会被回退。dev-*分支上运行。DEVELOPMENT.md补充了流程、恢复方法和分支模型(dev 分支定期合并 main,最终以 merge commit 合回 main)。验证
cargo +nightly fmt、cargo clippy -p xtask --all-targets --locked -- -D warnings和cargo test -p xtask --locked通过,xtask 共 22 项测试。test-release-files.sh、test-release-recovery.sh及 ShellCheck 通过,覆盖 changelog-only PR、过期说明刷新、Readiness 的 PR / merge queue 场景、非约定式与 Revert 提交、pre-1.0 feat、dev 分支预发布说明、Nightly 索引滞后与恢复、tag 删除等待、Homebrew beta 不回退、旧下游任务重试和手动 WinGet tag 错配。auto选出 0.7.6,Prepare/check 在普通 merge 和 squash 两种合入方式下都通过。concurrency.queue字段诊断后通过。尚未运行真实 GitHub Actions 发布。
合并前后需要的仓库设置
Allow GitHub Actions to create and approve pull requests。Release Readiness加入main的 required checks(merge queue 才会在队列里运行它)。PRERELEASE_BRANCH(例如dev-0.8)。pull_request.closed的merge_commit_sha指向 main 上的最终提交;brew info返回的 beta 版本格式符合预期。🤖 Generated with Claude Code
https://claude.ai/code/session_012ULwm4FYPWei21gc5bhw1x