Skip to content

fix: TriggerNotify 按 CLA 类型触发,不再同时触发企业和个人两边#484

Open
JavaPythonAIForBAT wants to merge 1 commit into
reviewfrom
fix/trigger-notify-by-type
Open

fix: TriggerNotify 按 CLA 类型触发,不再同时触发企业和个人两边#484
JavaPythonAIForBAT wants to merge 1 commit into
reviewfrom
fix/trigger-notify-by-type

Conversation

@JavaPythonAIForBAT

Copy link
Copy Markdown
Contributor

Summary

  • 个人 CLA 更新时不再标记企业签署为待通知,也不再触发企业扫描
  • 企业 CLA 更新时只触发企业扫描,不触发个人扫描

问题

TriggerNotify() 无条件同时触发企业和个人两个扫描器,更新个人 CLA 时也给所有企业发邮件。

修复

  • TriggerNotify(t) 加类型参数,按需触发
  • Update 中 SetPendingCLAForLink 仅企业 CLA 更新时标记

改动

2 files: signing/app/cla.go, signing/watch/notify_corp_admin.go

- TriggerNotify(t) 只触发对应 CLA 类型的扫描器
- Update 中 SetPendingCLAForLink 仅企业 CLA 更新时标记
- 个人 CLA 更新 → 只通知个人,不标记企业
- 企业 CLA 更新 → 只通知企业,不触发个人扫描
@opensourceways-bot

Copy link
Copy Markdown

Welcome To opensourceways Community

Hey @JavaPythonAIForBAT , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: infratructure ,
and any of the maintainers: @GeorgeCao-hw, @TangJia025, @pkking, @zhongjun2 ,
and any of the committers: @JavaPythonAIForBAT, @Zherphy, @tfhddd, @zhongjun2 .

@opensourceways-bot

Copy link
Copy Markdown

CLA Signature Guide

@JavaPythonAIForBAT , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
374d7e36 fix: TriggerNotify 按 CLA 类��... the CLA service call failed! please comment /check-cla once again.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

@opensourceways-bot

Copy link
Copy Markdown

Linking Issue Notice

@JavaPythonAIForBAT , the pull request must be linked to at least one issue.
If an issue has already been linked, but the needs-issue label remains, you can remove the label by commenting /check-issue .

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the CLA update process to conditionally set pending CLAs and trigger notifications based on the CLA type (individual vs. corporate). Specifically, TriggerNotify now accepts a CLAType parameter to selectively trigger the corresponding notification scanner. The review feedback recommends simplifying the notification logic in TriggerNotify using an if-else structure and adding a defensive check to handle cases where the CLA type might be nil to prevent unintended corporate notifications.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +50 to 61
if !dp.IsCLATypeIndividual(t) {
select {
case notifyAdminWatchInstance.corpTrigger <- struct{}{}:
default:
}
}
select {
case notifyAdminWatchInstance.individualTrigger <- struct{}{}:
default:
if dp.IsCLATypeIndividual(t) {
select {
case notifyAdminWatchInstance.individualTrigger <- struct{}{}:
default:
}
}

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.

medium

The current implementation evaluates dp.IsCLATypeIndividual(t) twice and lacks a safety check for when t is nil. If t is nil, it would unexpectedly trigger the corporate notification scanner because !dp.IsCLATypeIndividual(t) evaluates to true.

We can simplify this logic using an if-else structure and add a defensive check to ensure t is not nil before proceeding.

	if t == nil {
		return
	}
	if dp.IsCLATypeIndividual(t) {
		select {
		case notifyAdminWatchInstance.individualTrigger <- struct{}{}:
		default:
		}
	} else {
		select {
		case notifyAdminWatchInstance.corpTrigger <- struct{}{}:
		default:
		}
	}

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
漏洞扫描
Check代码检查
开源license合规扫描
开发阶段设计文档检查
流水线链接 点击跳转查看日志

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants