Skip to content

fix: persist Slack thread_ts across controller restarts#461

Open
Ofir408 wants to merge 1 commit into
argoproj:masterfrom
Ofir408:fix/slack-thread-ts-persistence
Open

fix: persist Slack thread_ts across controller restarts#461
Ofir408 wants to merge 1 commit into
argoproj:masterfrom
Ofir408:fix/slack-thread-ts-persistence

Conversation

@Ofir408

@Ofir408 Ofir408 commented Jul 2, 2026

Copy link
Copy Markdown

Slack thread continuity (groupingKey -> thread_ts) previously lived only in an in-memory map, so a controller restart or leader-election failover reset it and grouped notifications started a new top-level thread instead of replying to the existing one.

Adds AnnotatingNotificationService, an optional NotificationService extension that returns annotations the caller should persist onto the target resource. The Slack service implements it, seeding/exporting its thread state via Destination.Annotations instead of a package-global in-memory map. The controller wires the resource's annotations in before sending and merges the returned annotations back in when persisting state, the same way NotificationsState already does for delivery dedup.

Fixes argoproj/argo-rollouts#4809

@Ofir408 Ofir408 force-pushed the fix/slack-thread-ts-persistence branch from 22669b9 to 6d1db53 Compare July 2, 2026 17:35
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.60%. Comparing base (da04400) to head (e92a2e7).
⚠️ Report is 37 commits behind head on master.

Files with missing lines Patch % Lines
pkg/mocks/api.go 0.00% 9 Missing ⚠️
pkg/controller/controller.go 46.66% 4 Missing and 4 partials ⚠️
pkg/services/slack.go 66.66% 4 Missing and 1 partial ⚠️
pkg/api/api.go 50.00% 3 Missing and 1 partial ⚠️
pkg/util/slack/client.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #461      +/-   ##
==========================================
+ Coverage   55.41%   57.60%   +2.18%     
==========================================
  Files          46       49       +3     
  Lines        4125     3840     -285     
==========================================
- Hits         2286     2212      -74     
+ Misses       1511     1263     -248     
- Partials      328      365      +37     

☔ 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.

@Ofir408 Ofir408 force-pushed the fix/slack-thread-ts-persistence branch 2 times, most recently from 0346831 to bde11fb Compare July 2, 2026 17:44
Slack thread continuity (groupingKey -> thread_ts) previously lived only
in an in-memory map, so a controller restart or leader-election failover
reset it and grouped notifications started a new top-level thread instead
of replying to the existing one.

Adds AnnotatingNotificationService, an optional NotificationService
extension that returns annotations the caller should persist onto the
target resource. The Slack service implements it, seeding/exporting its
thread state via Destination.Annotations instead of a package-global
in-memory map. The controller wires the resource's annotations in before
sending and merges the returned annotations back in when persisting
state, the same way NotificationsState already does for delivery dedup.

Fixes argoproj/argo-rollouts#4809

Signed-off-by: Ofir Ben Shoham <ofir_benshoham@intuit.com>
@Ofir408 Ofir408 force-pushed the fix/slack-thread-ts-persistence branch from bde11fb to e92a2e7 Compare July 2, 2026 17:49
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.

Slack groupingKey thread_ts not persisted - threading breaks after controller restart or leader change

1 participant