Skip to content

fix: avoid spamming a bunch of people while commenting - #9

Merged
BLumia merged 1 commit into
masterfrom
no-tagging-while-commenting
Jul 30, 2026
Merged

fix: avoid spamming a bunch of people while commenting#9
BLumia merged 1 commit into
masterfrom
no-tagging-while-commenting

Conversation

@BLumia

@BLumia BLumia commented Jul 30, 2026

Copy link
Copy Markdown
Member

在 CLA 检查到有未签署的人员时,默认行为会 at 所被检查的用户,这对于较大的PR而言会使所有 commit 有被涵盖的用户都被 at,对很多场景而言是不必要的。实际而言,可以只呈现名单,由提交与合入人员自行决策是否要找对应人员签署 CLA。

关联 linuxdeepin/treeland#1215 (comment)

Log:

Summary by Sourcery

Bug Fixes:

  • Stop automatically @-mentioning signed and unsigned committers in CLA check comments to avoid notifying all contributors on large PRs.

在 CLA 检查到有未签署的人员时,默认行为会 at 所被检查的用户,这对于较大的PR而言会使所有 commit 有被涵盖的用户都被 at,对很多场景而言是不必要的。实际而言,可以只呈现名单,由提交与合入人员自行决策是否要找对应人员签署 CLA。

关联 linuxdeepin/treeland#1215 (comment)

Log:
@BLumia
BLumia requested review from tsic404 and zccrs July 30, 2026 02:36
@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts CLA comment generation to list committers by name without GitHub mentions, preventing mass notifications while preserving signed/unsigned status information.

Flow diagram for updated CLA comment generation (no GitHub mentions)

flowchart TD
    A[Start CLA comment generation] --> B[Check committersCount > 1]
    B --> C[committerMap.signed and committerMap.notSigned exist]
    C --> D[Append summary: signed vs total committers]
    D --> E[For each signedCommitter: append name with :white_check_mark:]
    D --> F[For each unsignedCommitter: append name with :x:]
    E --> G[Append retrigger instruction]
    F --> G[Append retrigger instruction]
    G --> H[Return comment text]

    subgraph Legend
        L1[Names are listed as plain text]
        L2[No @mentions are used]
    end
Loading

File-Level Changes

Change Details Files
Stop @-mentioning committers in the autogenerated CLA status comment to avoid spamming users.
  • In the CLA summary section, render signed committers as plain names instead of '@name' mentions.
  • Render unsigned committers as plain names instead of '@name' mentions while keeping the ❌ indicator.
  • Preserve the existing structure of the CLA summary text, including counts, icons, and retrigger instructions.
src/pullrequest/pullRequestCommentContent.ts

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

@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 - I've left some high level feedback:

  • By removing the @ prefix you also lose clickable links to user profiles; if preserving quick access to contributor accounts is important, consider making the mention behavior configurable or only suppressing @-mentions for large PRs.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- By removing the @ prefix you also lose clickable links to user profiles; if preserving quick access to contributor accounts is important, consider making the mention behavior configurable or only suppressing @-mentions for large PRs.

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.

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:85分

■ 【总体评价】

代码修改了PR评论中的提及逻辑并补充了文件末尾换行符,但移除@符号导致用户无法收到通知
语法逻辑因功能失效扣10分,代码质量因轻微瑕疵扣5分,无安全漏洞

■ 【详细分析】

  • 1.语法逻辑(存在错误)✕

src/pullrequest/pullRequestCommentContent.ts 文件的第90行和第93行,移除了 GitHub/GitLab 用户的 @ 提及符号。原本通过 @${signedCommitter.name}@${unsignedCommitter.name} 可以触发平台的通知机制,修改后变为纯文本展示,导致相关提交者无法收到 CLA 签署状态的通知。
潜在问题:签署或未签署 CLA 的提交者无法及时收到 PR 评论提醒,可能导致 CLA 签署流程阻塞
建议:恢复代码中的 @ 符号以确保提及通知功能正常运作

  • 2.代码质量(一般)✓

修改在文件末尾补充了换行符(第107行),符合 POSIX 文本文件标准规范,提升了代码质量。但整体修改引入了功能性退化。
潜在问题:无
建议:在恢复 @ 符号的同时保留文件末尾的换行符

  • 3.代码性能(无性能问题)✓

字符串拼接逻辑未发生改变,仅减少了 @ 字符的拼接,对性能无负面影响。
建议:无需优化

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及字符串常量的调整,未引入外部输入处理或危险函数调用,不存在安全风险。

  • 建议:无需修复

■ 【改进建议代码示例】

diff --git a/src/pullrequest/pullRequestCommentContent.ts b/src/pullrequest/pullRequestCommentContent.ts
index 09f3f410..fb49e860 100644
--- a/src/pullrequest/pullRequestCommentContent.ts
+++ b/src/pullrequest/pullRequestCommentContent.ts
@@ -88,9 +88,9 @@ ${input.getCustomPrSignComment() || "I have read the CLA Document and I hereby s
 
     if (committersCount > 1 && committerMap && committerMap.signed && committerMap.notSigned) {
         text += `**${committerMap.signed.length}** out of **${committerMap.signed.length + committerMap.notSigned.length}** committers have signed the CLA.`
-        committerMap.signed.forEach(signedCommitter => { text += `<br/>:white_check_mark: ${signedCommitter.name}` })
+        committerMap.signed.forEach(signedCommitter => { text += `<br/>:white_check_mark: @${signedCommitter.name}` })
         committerMap.notSigned.forEach(unsignedCommitter => {
-            text += `<br/>:x: ${unsignedCommitter.name}`
+            text += `<br/>:x: @${unsignedCommitter.name}`
         })
         text += '<br/>'
     }

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, tsic404

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@BLumia
BLumia merged commit 9e10ca6 into master Jul 30, 2026
7 of 9 checks passed
@BLumia
BLumia deleted the no-tagging-while-commenting branch July 30, 2026 03:34
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