Skip to content

chore(AIAgent): simplify GitHub Issue/PR publishing workflow - #8869

Merged
ArgoZhang merged 3 commits into
mainfrom
ArgoZhang/chore-agent
Nov 27, 2026
Merged

ArgoZhang merged 3 commits into
mainfrom
ArgoZhang/chore-agent

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Link issues

fixes #8868

Summary By Copilot

  • Replace the extended, multi-operation github-issue-pr guide with a concise workflow for publishing an already-pushed branch as a linked Issue and new PR.
  • Clarify branch checks, duplicate detection, template use, and final verification.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Documentation-only change to the agent workflow; no runtime behavior changes.

Verification

  • Manual (required)
  • Automated

Reviewed the committed skill diff against repository guidance. Build and tests were not run; this skill task does not run them.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Streamline the GitHub Issue and PR publishing workflow around creating a new linked Issue and PR from an existing pushed branch.

Enhancements:

  • Simplify the GitHub Issue and PR publishing skill into a focused workflow for creating a linked Issue and new PR from an already-pushed branch.
  • Clarify branch validation, duplicate detection, template usage, Issue linking, and post-creation verification while limiting the workflow to documentation and publishing actions.

Documentation:

  • Replace the extended GitHub Issue/PR publishing guide with concise documentation covering the supported workflow and its constraints.

@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Documentation

Replace the extensive Issue/PR publishing guide with a concise workflow for creating a linked Issue and new PR from an already-pushed branch.

  • .agents/skills/github-issue-pr/SKILL.md L3-16

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

@bb-auto bb-auto Bot added the chore This are tasks or bot action label Nov 27, 2026
@bb-auto bb-auto Bot added this to the v11.1.0 milestone Nov 27, 2026

@bb-auto bb-auto 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.

Auto approved by bb-auto

@bb-auto bb-auto 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.

Auto approved by bb-auto

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8a0754e) to head (b7262bb).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8869   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          664       664           
  Lines        30484     30484           
=========================================
  Hits         30484     30484           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit b7262bb

#8868 chore(AIAgent): simplify GitHub Issue/PR skill workflow · 4 of 4 met

# Requirement Status Notes
1 Verify the already-pushed branch ✅ Met The workflow requires a non-default branch pushed to the target repository or its Fork, with the remote branch matching local HEAD.
2 Review the branch diff ✅ Met Step 2 checks the commits and diff against the default branch before publishing.
3 Create a matching Issue and linked PR ✅ Met The workflow reuses a matching Issue or creates one if none is found, then creates a new PR linked to that Issue.
4 Verify the result ✅ Met Step 5 rereads the Issue and PR to confirm their links, head, base, and Issue association.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 6 issues

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

## Individual Comments

### Comment 1
<location path=".agents/skills/github-issue-pr/SKILL.md" line_range="13" />
<code_context>
-
-PR 创建请求报错后,先按第 2 节在目标仓库查询匹配的 head 和 base,确认尚未创建且故障已排除后再重试。返回已创建、复用或更新的链接。流程受阻时,说明已完成的操作和受阻步骤。
+1. 确认目标仓库及其默认分支,使用 `gh` 检查登录状态。当前分支必须是非默认分支,且已推送到目标仓库或其 Fork;远端分支必须与本地 `HEAD` 一致。未提交的改动不属于 PR,存在影响本次发布的未提交改动时停止。
+2. 只读核对当前分支相对默认分支的提交和差异,确认有改动可发布。搜索是否已有匹配的打开 Issue;有则复用并记录编号,没有则在步骤 3 创建。不要更新已有 Issue。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。检查同一 head 和 base 是否已有打开的 PR;GitHub 不允许对相同 head/base 并存多个打开的 PR,若已存在则停止并说明无法新建,不要改为复用或更新。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
</code_context>
<issue_to_address>
**Unrelated changes enter the PR**

When the branch contains commits or changes unrelated to the publishing task, `ip` accepts any publishable branch difference, and the workflow creates the PR from the whole branch, so unrelated commits and changes are included in the PR.

Limit the published diff to changes for the current task before creating the Issue and PR.
</issue_to_address>

### Comment 2
<location path=".agents/skills/github-issue-pr/SKILL.md" line_range="12-15" />
<code_context>
+1. 确认目标仓库及其默认分支,使用 `gh` 检查登录状态。当前分支必须是非默认分支,且已推送到目标仓库或其 Fork;远端分支必须与本地 `HEAD` 一致。未提交的改动不属于 PR,存在影响本次发布的未提交改动时停止。
</code_context>
<issue_to_address>
**Unreviewed commits enter the PR**

When another actor pushes to the head branch after the workflow checks it, `ir` creates the PR from the live branch name rather than the checked commit, so the PR includes changes that were not part of the reviewed diff or Issue description.

Create the PR from the exact reviewed commit, or stop and repeat the review if the branch tip changes.
</issue_to_address>

### Comment 3
<location path=".agents/skills/github-issue-pr/SKILL.md" line_range="13" />
<code_context>
-
-PR 创建请求报错后,先按第 2 节在目标仓库查询匹配的 head 和 base,确认尚未创建且故障已排除后再重试。返回已创建、复用或更新的链接。流程受阻时,说明已完成的操作和受阻步骤。
+1. 确认目标仓库及其默认分支,使用 `gh` 检查登录状态。当前分支必须是非默认分支,且已推送到目标仓库或其 Fork;远端分支必须与本地 `HEAD` 一致。未提交的改动不属于 PR,存在影响本次发布的未提交改动时停止。
+2. 只读核对当前分支相对默认分支的提交和差异,确认有改动可发布。搜索是否已有匹配的打开 Issue;有则复用并记录编号,没有则在步骤 3 创建。不要更新已有 Issue。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。检查同一 head 和 base 是否已有打开的 PR;GitHub 不允许对相同 head/base 并存多个打开的 PR,若已存在则停止并说明无法新建,不要改为复用或更新。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
</code_context>
<issue_to_address>
**Existing issues block PR creation**

When a matching Issue exists but no matching open PR exists, `ip` stops after finding and reusing the Issue, so the workflow never reaches `ir` to create the linked PR; callers receive only the Issue link.

Continue to PR creation with the reused Issue number instead of stopping at step 2.
</issue_to_address>

### Comment 4
<location path=".agents/skills/github-issue-pr/SKILL.md" line_range="14" />
<code_context>
-PR 创建请求报错后,先按第 2 节在目标仓库查询匹配的 head 和 base,确认尚未创建且故障已排除后再重试。返回已创建、复用或更新的链接。流程受阻时,说明已完成的操作和受阻步骤。
+1. 确认目标仓库及其默认分支,使用 `gh` 检查登录状态。当前分支必须是非默认分支,且已推送到目标仓库或其 Fork;远端分支必须与本地 `HEAD` 一致。未提交的改动不属于 PR,存在影响本次发布的未提交改动时停止。
+2. 只读核对当前分支相对默认分支的提交和差异,确认有改动可发布。搜索是否已有匹配的打开 Issue;有则复用并记录编号,没有则在步骤 3 创建。不要更新已有 Issue。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。检查同一 head 和 base 是否已有打开的 PR;GitHub 不允许对相同 head/base 并存多个打开的 PR,若已存在则停止并说明无法新建,不要改为复用或更新。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
+5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
</code_context>
<issue_to_address>
**Duplicate PR leaves an orphaned issue**

When no matching Issue exists and an open PR already has the same head and base, `iq` creates an Issue before `ir` detects the existing PR and stops, leaving an Issue with no new PR linked to it.

Check for an existing head/base PR before creating an Issue, and stop without creating one when a PR already exists.

Also at `.agents/skills/github-issue-pr/SKILL.md:15`.
</issue_to_address>

### Comment 5
<location path=".agents/skills/github-issue-pr/SKILL.md" line_range="13-14" />
<code_context>
-
-PR 创建请求报错后,先按第 2 节在目标仓库查询匹配的 head 和 base,确认尚未创建且故障已排除后再重试。返回已创建、复用或更新的链接。流程受阻时,说明已完成的操作和受阻步骤。
+1. 确认目标仓库及其默认分支,使用 `gh` 检查登录状态。当前分支必须是非默认分支,且已推送到目标仓库或其 Fork;远端分支必须与本地 `HEAD` 一致。未提交的改动不属于 PR,存在影响本次发布的未提交改动时停止。
+2. 只读核对当前分支相对默认分支的提交和差异,确认有改动可发布。搜索是否已有匹配的打开 Issue;有则复用并记录编号,没有则在步骤 3 创建。不要更新已有 Issue。
+3. 读取 [Issue 表单](../../../.github/ISSUE_TEMPLATE/)、[PR 模板](../../../.github/pull_request_template.md)及 `.github/PULL_REQUEST_TEMPLATE/` 中的适用模板,参考近期同类 Issue 和 PR 的惯例。需要新建 Issue 时,根据实际差异创建,使用 `gh issue create --repo <目标仓库>`。
+4. 每次都创建新的 PR,不复用或更新已有 PR。检查同一 head 和 base 是否已有打开的 PR;GitHub 不允许对相同 head/base 并存多个打开的 PR,若已存在则停止并说明无法新建,不要改为复用或更新。使用 `gh pr create --repo <目标仓库>`,以当前远端分支为 head、默认分支为 base。分支名可能包含 `/`,始终将完整分支名作为一个值传递;Fork 的 head 格式为 `<owner>:<完整分支名>`,冒号用于分隔仓库所有者与分支名,不要按斜杠拆分分支名。保留 PR 模板的标题、注释、清单和顺序,在 `Link issues` 中填写 `fixes #<编号>`;跨仓库 Issue 使用 `fixes <owner>/<repo>#<编号>`。按实际改动和已知验证结果填写正文,不勾选未完成的项目。
+5. 回读 Issue 和 PR,确认链接、head、base 和 Issue 关联并返回链接。创建请求报错时先查询远端,确认未创建后才能重试;状态无法确认时如实报告。
</code_context>
<issue_to_address>
**Concurrent runs create duplicate issues**

When two runs publish the same branch and both pass the duplicate checks before either creates an Issue, both runs create an Issue, but only one PR can be opened for that head/base pair, leaving a duplicate Issue and a run without its intended linked PR.

Serialize publishing runs for the same head/base pair and recheck for an Issue or PR immediately before creating either.
</issue_to_address>

### Comment 6
<location path=".agents/skills/github-issue-pr/SKILL.md" line_range="10" />
<code_context>
+遵守根 [AGENTS.md](../../../AGENTS.md) 和 [提交与 PR 指南](../../../docs/agents/pr-guide.md)。直接调用本 skill 即授权为当前分支复用或创建 Issue,并创建关联的新 PR。

-## 确认任务范围
+本 skill 只创建 Issue 和 PR,不修改代码或现有 Issue、PR,不创建或切换分支,不提交、推送、合并,也不运行构建或测试。无法直接创建时停止并说明原因。

-- 直接调用本 skill 且未指定其他 Issue 或 PR 操作时,按当前分支相对目标仓库默认分支的待发布差异,先创建新 Issue,再创建指向默认分支并关联该 Issue 的新 PR。直接调用即授权完成这套发布流程。
</code_context>
<issue_to_address>
**Existing updates have no supported workflow**

When a caller requests an update to an existing Issue or PR, the skill forbids modifying existing Issues and PRs, so it cannot fulfill update requests even though `AGENTS.md:58` and `docs/agents/pr-guide.md:13` direct those requests to this skill as the repository workflow.

Update the guidance to route existing-Issue/PR updates to a separate workflow, or restore update support in this skill.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 6 findings to address first, and if the workflow creates an Issue or PR with incorrect content or against the wrong target, that content is published on GitHub and may trigger notifications; reverting this skill change does not remove what was already created. The records can be corrected or closed, but the publication itself cannot be fully taken back.

Blocking findings: .agents/skills/github-issue-pr/SKILL.md:13, .agents/skills/github-issue-pr/SKILL.md:15, .agents/skills/github-issue-pr/SKILL.md:13, .agents/skills/github-issue-pr/SKILL.md:14, .agents/skills/github-issue-pr/SKILL.md:14, and 1 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .agents/skills/github-issue-pr/SKILL.md Resolved
Comment thread .agents/skills/github-issue-pr/SKILL.md Resolved
Comment thread .agents/skills/github-issue-pr/SKILL.md Resolved
Comment thread .agents/skills/github-issue-pr/SKILL.md Resolved
Comment thread .agents/skills/github-issue-pr/SKILL.md Resolved
Comment thread .agents/skills/github-issue-pr/SKILL.md Resolved

@bb-auto bb-auto 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.

Auto approved by bb-auto

@ArgoZhang
ArgoZhang merged commit c628714 into main Nov 27, 2026
7 checks passed
@ArgoZhang
ArgoZhang deleted the ArgoZhang/chore-agent branch November 27, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore This are tasks or bot action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(AIAgent): simplify GitHub Issue/PR skill workflow

1 participant