Skip to content

Conversation

fiftin
Copy link
Collaborator

@fiftin fiftin commented Aug 24, 2025

Add a new service-based notification system with a common interface, using token/channel parameters and a new notifications config, while preserving old URL-based methods for backward compatibility.

This change introduces a more secure and modular way to handle notifications by moving away from insecure URL parameters and providing a structured configuration, ensuring existing setups continue to function without modification.


Open in Cursor Open in Web

Copy link

cursor bot commented Aug 24, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@fiftin fiftin marked this pull request as ready for review September 17, 2025 06:13
@fiftin fiftin added this to the 2.17 milestone Sep 17, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

}
}
return t.token != "" && t.chatID != ""
}
Copy link

Choose a reason for hiding this comment

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

Bug: Notifier Enabled Methods Have Unpredictable Side Effects

Several notifier Enabled() methods (Telegram, Slack, Gotify, DingTalk) have side effects. Some mutate internal state from global configuration (Telegram, Gotify), while others rely on global config for their enabled status (Slack, DingTalk). This makes the Enabled() check non-deterministic and prone to race conditions, as fallback configuration is handled outside of initialization.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 125 to +133
if status.IsNotifiable() {
t.sendTelegramAlert()
t.sendSlackAlert()
t.sendRocketChatAlert()
t.sendMicrosoftTeamsAlert()
t.sendDingTalkAlert()
t.sendGotifyAlert()
// Prefer new notification service if configured; otherwise fallback to legacy methods
if t.notificationService != nil && t.notificationService.HasNotifiers() {
author, version := t.alertInfos()
alert := Alert{
Name: t.Template.Name,
Author: author,
Color: t.alertColor("slack"),
Task: alertTask{

Choose a reason for hiding this comment

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

[P1] Respect alert flags and success suppression

The new notification-service path sends an alert unconditionally whenever status.IsNotifiable() is true, but it no longer checks the project/template alert toggle or Template.SuppressSuccessAlerts like the legacy send*Alert functions do. As a result, enabling the unified notifications config will emit Telegram/Slack/etc. messages even when alerts are disabled for the project or when success notifications are explicitly suppressed. The branch should short-circuit when t.alert is false or the template suppresses success notifications before invoking SendAll.

Useful? React with 👍 / 👎.

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.

2 participants