Skip to content

ci: 添加默认assign review#1162

Merged
MistEO merged 5 commits intov2from
fix/i18n
Mar 9, 2026
Merged

ci: 添加默认assign review#1162
MistEO merged 5 commits intov2from
fix/i18n

Conversation

@overflow65537
Copy link
Member

@overflow65537 overflow65537 commented Mar 9, 2026

Summary by Sourcery

为 i18n 同步工作流的拉取请求添加自动分配审阅者的支持。

增强功能:

  • 在手动触发 i18n 同步工作流时,允许指定一个可选的审阅者用户名,并配置一个默认审阅者。
  • 在创建或检测到已有的 i18n 同步拉取请求时,自动向配置的审阅者发出审阅请求。
Original summary in English

Summary by Sourcery

Add automatic reviewer assignment support to the i18n sync workflow pull requests.

Enhancements:

  • Allow specifying an optional reviewer username when manually dispatching the i18n sync workflow, with a default reviewer configured.
  • Automatically request a PR review from the configured reviewer when creating or detecting existing i18n sync pull requests.
Original summary in English

Summary by Sourcery

为 i18n 同步工作流的拉取请求添加自动分配审阅者的支持。

增强功能:

  • 在手动触发 i18n 同步工作流时,允许指定一个可选的审阅者用户名,并配置一个默认审阅者。
  • 在创建或检测到已有的 i18n 同步拉取请求时,自动向配置的审阅者发出审阅请求。
Original summary in English

Summary by Sourcery

Add automatic reviewer assignment support to the i18n sync workflow pull requests.

Enhancements:

  • Allow specifying an optional reviewer username when manually dispatching the i18n sync workflow, with a default reviewer configured.
  • Automatically request a PR review from the configured reviewer when creating or detecting existing i18n sync pull requests.

@overflow65537 overflow65537 changed the title fix:修复无法处理一个文本有多个翻译id的情况 perf:添加默认assign review Mar 9, 2026
@overflow65537 overflow65537 marked this pull request as ready for review March 9, 2026 14:16
Copilot AI review requested due to automatic review settings March 9, 2026 14:16
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我发现了 1 个问题

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/i18n-sync.yml" line_range="6-9" />
<code_context>
 env:
   I18N_SYNC_BRANCH: "chore/i18n-auto-sync"
   PR_TITLE: "chore: auto sync OCR i18n expected"
+  DEFAULT_PR_REVIEWER: "overflow65537"

 jobs:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** reviewer 的默认值在 input 和 env 中都被设置了一遍,随着时间推移可能会产生偏差。

当前默认值(`"overflow65537"`)同时被硬编码在 `workflow_dispatch.inputs.reviewer.default``env.DEFAULT_PR_REVIEWER` 中,这有可能导致两者出现不一致,从而在手动运行和定时运行之间产生不同的行为。建议只保留一个单一可信来源(例如仅使用 `DEFAULT_PR_REVIEWER`):要么移除 input 的默认值,要么从共享配置中派生该值,而不是重复写这一字符串。

```suggestion
      reviewer:
        description: "自动请求评审的 GitHub 用户名(可留空)"
        required: false
```
</issue_to_address>

Sourcery 对开源项目是免费的——如果你觉得我们的代码评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审质量。
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/i18n-sync.yml" line_range="6-9" />
<code_context>
 env:
   I18N_SYNC_BRANCH: "chore/i18n-auto-sync"
   PR_TITLE: "chore: auto sync OCR i18n expected"
+  DEFAULT_PR_REVIEWER: "overflow65537"

 jobs:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** The reviewer default is duplicated in both the input and env, which can drift over time.

The default value (`"overflow65537"`) is now hard-coded both in `workflow_dispatch.inputs.reviewer.default` and `env.DEFAULT_PR_REVIEWER`, which risks them drifting apart and causing different behavior between manual and scheduled runs. Prefer a single source of truth (e.g., only `DEFAULT_PR_REVIEWER`) by either removing the input default or deriving it from a shared configuration instead of duplicating the string.

```suggestion
      reviewer:
        description: "自动请求评审的 GitHub 用户名(可留空)"
        required: false
```
</issue_to_address>

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

本 PR 调整 i18n-sync 的 GitHub Actions 工作流,在自动创建/复用同步 PR 时支持默认请求指定 reviewer,从而减少人工分配评审的步骤。

Changes:

  • workflow_dispatch 增加 reviewer 输入参数,并提供默认值
  • 创建 PR 时通过 gh pr create --reviewer 自动请求评审;若 PR 已存在则用 gh pr edit --add-reviewer 追加 reviewer

overflow65537 and others added 2 commits March 9, 2026 23:06
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MistEO MistEO changed the title perf:添加默认assign review ci: 添加默认assign review Mar 9, 2026
@MistEO MistEO merged commit 9aca7db into v2 Mar 9, 2026
1 check passed
@MistEO MistEO deleted the fix/i18n branch March 9, 2026 15:50
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.

3 participants