argoproj / argoproj/notifications-engine

Allow templating Slack NotifyBroadcast

Open
#338 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
334
Forks
217
PR merge metrics
No merged PRs in 30d

Description

I've got a slack notification that I send that alerts me to argocd events, and I'm using grouping keys to thread related notifications.

However, I only want to use `notifyBroadcast` under certain circumstances.

Currently, you cannot use any templating on that field: I can't do, for example:

```
template.app-health-degraded-every: |
slack:
notifyBroadcast: {{ if .isProduction }}true{{ else }}false{{ end }}
deliveryPolicy: PostAndUpdate
```

I have to provide a concrete `true` or `false`.

I recognize that there's likely some string vs bool typing issues here, but it would be really great if we could [add some text templating](https://github.com/argoproj/notifications-engine/blob/261728a36e8357dfa7c258f7e1c4e3e763711ee1/pkg/services/slack.go#L32-L45) to include notifyBroadcast. (And maybe deliveryPolicy?)

I'm also happy to have this be accomplished in any other way (perhaps a new field `notifyBroadcastExpr` where you can provide an expr test, similar to how the triggers are executed?), as long as I can re-use a template but change these settings.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with pkg/services/slack.go at lines 32-45, where Slack notification settings such as notifyBroadcast are handled. Trace how template values are parsed and typed, then determine the supported approach for conditional settings. Done means a reusable template can conditionally control notifyBroadcast, with coverage for both true and false outcomes if existing tests are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.