Skip to content

test: cover the dead-letter alert size cap - #5535

Merged
themarolt merged 1 commit into
mainfrom
test/issue-1238-dead-letter-size-cap
Dec 6, 2026
Merged

themarolt merged 1 commit into
mainfrom
test/issue-1238-dead-letter-size-cap

Conversation

@themarolt

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5534, from its review: a regression test for the size cap of the dead-letter alert. With long unit lines the message hits its character budget before the 20-line cap; only the units it lists are marked as alerted, and the rest are named on the next run.

Changes

  • Test with 10 units whose lines exceed the section budget: the first run alerts and marks only the listed units, the second run names the next one.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

Related issue

Refs linuxfoundation/lfx-cdp-insights-ops#1238

@themarolt
themarolt requested review from a team and lfx-one as code owners December 6, 2026 19:48
Copilot AI balanced review requested due to automatic review settings December 6, 2026 19:48
@cursor

cursor Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only change; no production behavior is modified.

Overview
Adds a regression test for when dead-letter Slack alerts hit the section character budget (MAX_SECTION_CHARS) before the existing 20-unit line cap.

The scenario uses 10 units with very long channelName and lastErrorMessage fields so fewer than all units fit in one message. The test asserts the first run alerts only the units actually listed (with a … and N more trailer), marks only those IDs in the alert store, and a second run picks up the remaining units by name.

Reviewed by Cursor Bugbot for commit 4cc0645. Bugbot is set up for automated code reviews on this repo. Configure here.

@lfx-one

lfx-one commented Dec 6, 2026 •

Copy link
Copy Markdown

@themarolt I'm starting review 1 of this pull request now (started 2026-12-06 19:48 UTC using review agent v0.1.37). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by re-review, to start another. For help with the review agent, see https://github.com/linuxfoundation/lfx-review-agent/issues.


Hi Uros Marolt, thanks for the quick follow-up test.

Summary

This pull request adds one regression test for the dead-letter alert's character budget. It checks that only the units that fit in the first message are marked as alerted, and that the next run names the rest. The change is test-only, and I found no issues.

Decision

✅ Approved

Details

Overall impression: A single test in syncUnitDeadLetter.test.ts with 19 added lines. I traced it against buildAlert, countFittingLines and capLines. Each unit line is about 800 characters, so the 2,780-character budget fits only a few of the 10 units. That makes the alerted > 0 and alerted < 10 assertions hold. The trailer text, the per-unit store check and the second run's first listed unit (u<first.alerted>) all match the code. The test uses synthetic data and does not hard-code the budget, so it won't break if the constant changes.

Other reviewers and CI checks: Cursor Bugbot's summary agrees this is a low-risk, test-only change. The only required check, DCO, passed on 4cc0645.

Rule files: read AGENTS.md, .claude/rules/commit-workflow.md, .claude/rules/skill-guidance.md, .claude/rules/adr-format.md, CONTRIBUTING.md; skipped none

Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues

@greptile-apps

greptile-apps Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Low impact] This test-only change appears safe to merge.

Summary

Adds a regression test for dead-letter alerts that reach the character limit before the line limit.

  • Dead-letter alert tests cover units cut off by the size cap.

Reviews (1) · Last reviewed commit: "test: cover the dead-letter alert size c..." · Reviewed by Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues with the added dead-letter alert size-cap regression coverage.

No open issues 🎉

What changed in this PR

Adds regression coverage for the dead-letter alert’s character budget, complementing the line-cap coverage from #5534.

Changes:

  • Uses 10 units with long lines to trigger the size cap.
  • Checks that only listed units are marked as alerted and the next run names the next pending unit.
File Description
services/​apps/​cron_service/​src/​jobs/​syncUnitDeadLetter.test.ts Adds a two-run regression test for size-capped alerts.

Review effort: Balanced

@lfx-one lfx-one left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test-only change that adds a regression test for the dead-letter alert's character budget. I traced it against syncUnitDeadLetter.ts and octolensMappingHealth.ts and found no issues, so I'm approving.

@themarolt
themarolt merged commit 9806183 into main Dec 6, 2026
15 checks passed
@themarolt
themarolt deleted the test/issue-1238-dead-letter-size-cap branch December 6, 2026 20:22
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.

3 participants