chat_notifier 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 945c1f49cd9931c5e86f1f3597156a1c109255bf90a411075770745c4ed5ce63
4
- data.tar.gz: 8becdc536e0b80a656b99cbf9b5a525763c46e02164816331f424798f6be3dc5
3
+ metadata.gz: 7edc6944f3cf725395443ed30f7aaa41dc8d357d0420c1bf3b6b020e397a01ba
4
+ data.tar.gz: ce30c767667ce563d983df0db9d688f4a22c72e80a8cd45115a2a2b4cb23caf5
5
5
  SHA512:
6
- metadata.gz: 0c1f2d3dde65aef1acfdf4a313d0c312a031acac824bff21f64cfbfa86ff951aaea14da04209e49f7063a05bace6657165378afd84858242d8bdee0e55fd9807
7
- data.tar.gz: 2547ee1bb2ea7a6532ef1b404812b4f9fea61cb38d0e50e1548399d8dee072e1d1da17b8be484a8a22b074f1f8c476099cdc092425339e386324faf268821b5b
6
+ metadata.gz: da79615e96a6d4d7e17c20c4bd58bfb3bf817d0bc8f84bcbb40800bbe16f353d93981c575ebed64cee755c149969714c2d39dcc2c09260e370f596e1e2affc65
7
+ data.tar.gz: 72a2318579a9a3ec0aacd0c352df714dcd8431f39d89d25e299218bc7daee9418077d263155a03d3ebab3fc562ab48dc0c8405b22fbccf314790aa89e0ea5d29
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.1] - 2026-07-27
9
+
10
+ ### Fixed
11
+
12
+ - Status reports sharing a job name fold per run, so any worker's failure fails the job (2e9a81d)
13
+
8
14
  ## [0.4.0] - 2026-07-24
9
15
 
10
16
  ### Added
@@ -22,9 +28,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
22
28
  - Malformed NOTIFY_SLACK_THREAD_GROUP_SIZE falls back to the default (b2d5a6d)
23
29
  - Replies are skipped when the parent response has no ts, instead of posting unthreaded (b2d5a6d)
24
30
  - Notifications no longer fail silently: branch and sha now resolve from CI env or git instead of raising on the app name (8cb8603)
25
-
26
- ## [0.3.0] - 2026-07-24
27
-
28
- ### Added
29
-
30
- - Threaded Slack failure notifications via a Slack bot token (NOTIFY_SLACK_BOT_TOKEN), grouping failing files into batched thread replies (e453cd0)
data/README.md CHANGED
@@ -96,9 +96,15 @@ back to its own thread.
96
96
  Caveats: verbose mode (`NOTIFIER_VERBOSE`) posts plain messages and bypasses
97
97
  episode resolution, and a thread store passed programmatically
98
98
  (`ChatNotifier.call(thread_store: ...)`) takes precedence over
99
- `NOTIFY_THREAD_STORE=none`. A single CI job running both RSpec and Minitest
100
- posts two status reports under the same job identity and only the earliest per
101
- run counts in the digest set `NOTIFY_JOB_NAME` per framework to disambiguate.
99
+ `NOTIFY_THREAD_STORE=none`.
100
+
101
+ Reporting more than once under one job identity is safe. Parallel runners
102
+ (`parallel_tests`, Knapsack) spawn a process per worker, each with its own
103
+ formatter, and a single job running both RSpec and Minitest posts twice.
104
+ Reports sharing a job name are folded per run — failure counts sum and any
105
+ failure fails the job — so the digest keeps one line per job and a worker that
106
+ passed cannot resolve the episode its sibling opened. Set `NOTIFY_JOB_NAME` if
107
+ you would rather they appear as separate lines.
102
108
 
103
109
  ### Debug your Slack setup
104
110
 
@@ -144,9 +144,23 @@ module ChatNotifier
144
144
  latest_id = grouped.keys.max_by { |id| [id.length, id] }
145
145
  # [length, value] orders numeric strings correctly ("9" < "10") and
146
146
  # sorts nil run_ids ("") as the oldest run.
147
- # conversations.replies returns replies oldest-first, so uniq keeps the
148
- # earliest status per job per run; jobs post once per run, so it's fine.
149
- grouped.fetch(latest_id, []).uniq { |report| report["job"] }
147
+ grouped.fetch(latest_id, []).group_by { |report| report["job"] }.map do |job, group|
148
+ fold(job, group)
149
+ end
150
+ end
151
+
152
+ # A job identity can report more than once per run: parallel test runners
153
+ # (parallel_tests, Knapsack) spawn a process per worker, each with its own
154
+ # formatter, all sharing one job name. Any worker failing fails the job, so
155
+ # fold the group rather than keeping whichever arrived first — otherwise a
156
+ # worker that passed silently resolves the episode its sibling just opened.
157
+ # Commutative, so every writer converges on the same digest.
158
+ def fold(job, group)
159
+ {
160
+ "job" => job,
161
+ "status" => (group.any? { |report| report["status"] != "passed" }) ? "failed" : "passed",
162
+ "failures" => group.sum { |report| report["failures"].to_i }
163
+ }
150
164
  end
151
165
  end
152
166
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChatNotifier
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay