@@ -176,20 +176,17 @@ jobs:
176176 yarn workspace batch-poster-monitor build
177177 yarn workspace retryable-monitor build
178178
179- # Run each monitor and extract summary output (from summary header to end )
179+ # Run each monitor with --enableAlerting (NODE_ENV=CI outputs slack messages without posting )
180180 echo "=== ASSERTION MONITOR ===" > ../target-output.txt
181- timeout 180s yarn workspace assertion-monitor dev --configPath=../../config.ci.json 2>&1 | \
182- sed -n '/Assertion Monitor Alert Summary/,$p; /Monitoring complete/p' >> ../target-output.txt || true
181+ NODE_ENV=CI timeout 300s yarn workspace assertion-monitor dev --configPath=../../config.ci.json --enableAlerting >> ../target-output.txt 2>&1 || true
183182
184183 echo "" >> ../target-output.txt
185184 echo "=== BATCH POSTER MONITOR ===" >> ../target-output.txt
186- timeout 180s yarn workspace batch-poster-monitor dev --configPath=../../config.ci.json 2>&1 | \
187- sed -n '/Batch poster monitor summary/,$p' >> ../target-output.txt || true
185+ NODE_ENV=CI timeout 300s yarn workspace batch-poster-monitor dev --configPath=../../config.ci.json --enableAlerting >> ../target-output.txt 2>&1 || true
188186
189187 echo "" >> ../target-output.txt
190188 echo "=== RETRYABLE MONITOR ===" >> ../target-output.txt
191- timeout 180s yarn workspace retryable-monitor dev --configPath=../../config.ci.json 2>&1 | \
192- sed -n '/No retryables found/p; /retryables requiring action/,$p' >> ../target-output.txt || true
189+ NODE_ENV=CI timeout 300s yarn workspace retryable-monitor dev --configPath=../../config.ci.json --enableAlerting >> ../target-output.txt 2>&1 || true
193190 continue-on-error : true
194191
195192 - name : Run monitors on PR branch
@@ -202,20 +199,17 @@ jobs:
202199 yarn workspace batch-poster-monitor build
203200 yarn workspace retryable-monitor build
204201
205- # Run each monitor and extract summary output (from summary header to end )
202+ # Run each monitor with --enableAlerting (NODE_ENV=CI outputs slack messages without posting )
206203 echo "=== ASSERTION MONITOR ===" > ../pr-output.txt
207- timeout 180s yarn workspace assertion-monitor dev --configPath=../../config.ci.json 2>&1 | \
208- sed -n '/Assertion Monitor Alert Summary/,$p; /Monitoring complete/p' >> ../pr-output.txt || true
204+ NODE_ENV=CI timeout 300s yarn workspace assertion-monitor dev --configPath=../../config.ci.json --enableAlerting >> ../pr-output.txt 2>&1 || true
209205
210206 echo "" >> ../pr-output.txt
211207 echo "=== BATCH POSTER MONITOR ===" >> ../pr-output.txt
212- timeout 180s yarn workspace batch-poster-monitor dev --configPath=../../config.ci.json 2>&1 | \
213- sed -n '/Batch poster monitor summary/,$p' >> ../pr-output.txt || true
208+ NODE_ENV=CI timeout 300s yarn workspace batch-poster-monitor dev --configPath=../../config.ci.json --enableAlerting >> ../pr-output.txt 2>&1 || true
214209
215210 echo "" >> ../pr-output.txt
216211 echo "=== RETRYABLE MONITOR ===" >> ../pr-output.txt
217- timeout 180s yarn workspace retryable-monitor dev --configPath=../../config.ci.json 2>&1 | \
218- sed -n '/No retryables found/p; /retryables requiring action/,$p' >> ../pr-output.txt || true
212+ NODE_ENV=CI timeout 300s yarn workspace retryable-monitor dev --configPath=../../config.ci.json --enableAlerting >> ../pr-output.txt 2>&1 || true
219213 continue-on-error : true
220214
221215 - name : Show captured output
@@ -226,34 +220,74 @@ jobs:
226220 echo "=== PR BRANCH OUTPUT ==="
227221 cat pr-output.txt
228222
223+ - name : Extract Slack messages
224+ run : |
225+ # Extract content between [SLACK_MESSAGE_START] and [SLACK_MESSAGE_END] markers
226+ extract_slack_messages() {
227+ sed -n '/\[SLACK_MESSAGE_START\]/,/\[SLACK_MESSAGE_END\]/p' | grep -v '\[SLACK_MESSAGE_'
228+ }
229+
230+ cat target-output.txt | extract_slack_messages > target-slack.txt || true
231+ cat pr-output.txt | extract_slack_messages > pr-slack.txt || true
232+
233+ echo "=== TARGET SLACK MESSAGES ==="
234+ cat target-slack.txt
235+ echo ""
236+ echo "=== PR SLACK MESSAGES ==="
237+ cat pr-slack.txt
238+
229239 - name : Normalize outputs and generate diff
230240 run : |
231241 # Normalize dynamic values (block numbers, addresses) for comparison
232242 normalize() {
233243 sed -E 's/[0-9]{7,}/BLOCK_NUM/g; s/[0-9]+n\b/BIGINT/g; s/0x[a-fA-F0-9]{40}/ADDR/g'
234244 }
235245
246+ # Normalize full output
236247 cat target-output.txt | normalize > target-normalized.txt
237248 cat pr-output.txt | normalize > pr-normalized.txt
238249
239- # Generate unified diff (ignore exit code since diff returns 1 when files differ)
250+ # Normalize slack messages
251+ cat target-slack.txt | normalize > target-slack-normalized.txt
252+ cat pr-slack.txt | normalize > pr-slack-normalized.txt
253+
254+ # Generate unified diffs (ignore exit code since diff returns 1 when files differ)
240255 diff -u target-normalized.txt pr-normalized.txt > output-diff.txt || true
256+ diff -u target-slack-normalized.txt pr-slack-normalized.txt > slack-diff.txt || true
241257
242258 - name : Post comment
243259 uses : actions/github-script@v7
244260 with :
245261 script : |
246262 const fs = require('fs');
247263
248- const diffOutput = fs.existsSync('output-diff.txt')
264+ const outputDiff = fs.existsSync('output-diff.txt')
249265 ? fs.readFileSync('output-diff.txt', 'utf8').trim()
250266 : '';
251267
252- const hasChanges = diffOutput.length > 0;
268+ const slackDiff = fs.existsSync('slack-diff.txt')
269+ ? fs.readFileSync('slack-diff.txt', 'utf8').trim()
270+ : '';
271+
272+ const hasOutputChanges = outputDiff.length > 0;
273+ const hasSlackChanges = slackDiff.length > 0;
253274
254275 let body = '';
255- if (hasChanges) {
256- body = '### ⚠️ Monitor Output Changes\n\n```diff\n' + diffOutput + '\n```';
276+
277+ if (hasOutputChanges || hasSlackChanges) {
278+ body = '### ⚠️ Monitor Output Changes\n\n';
279+
280+ if (hasSlackChanges) {
281+ body += '#### Slack Message Changes\n```diff\n' + slackDiff + '\n```\n\n';
282+ } else {
283+ body += '#### ✅ Slack Messages: No Changes\n\n';
284+ }
285+
286+ if (hasOutputChanges) {
287+ body += '<details>\n<summary>Full Output Changes</summary>\n\n```diff\n' + outputDiff + '\n```\n</details>';
288+ } else {
289+ body += '#### ✅ Full Output: No Changes';
290+ }
257291 } else {
258292 body = '### ✅ Monitor Output: No Changes';
259293 }
0 commit comments