Repository navigation
test(workflows): cover the team sending budget on the in-process SES fake - #127175
Conversation
Send test email through a local SES fake, so the send outcome matrix runs against real SDK requests without mocking SES.
|
😎 Stack merged successfully - details. |
🤖 CI report✅ Trunk lane — non-backend laneThis PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes. ✅ Duplication (Python) — cleanNew Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying. ✅ Duplication (TypeScript) — cleanNew TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying. |
There was a problem hiding this comment.
PostHog Review · Standard · reviewed d44f049: 1 Should fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
HostHog preview —
|
- Use the production Redis pool and drop the TestRedisV2 copy. - Cap and pacing cases assert their own log reason and a drained bucket, so a limiter outage cannot pass for a denial. - Rows carry their own setup and expected values; tests with two flows are split. - Titles name the behavior only, without matrix numbers or fork references. - Drop the harness self-test and the duplicate SES throttle row. - Keep the handbook to how to run the suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SES suite runs in the default Jest set, but the fake sits behind the compose `ses` profile. A run without it now fails with the command that starts it, instead of an error that reads like a regression. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RedisV2 has no close, so a pool per test left one connection per test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Risk: No findings This change adds test coverage only: new cases in email.service.test.ts for email status records (UUIDT vs keyed ids, created_at derivation), the signed message-created tracking header, and the team sending budget on the in-process SES fake. No production code, configuration, or trust boundary is modified, so there is no new security risk. Sentinel reviewed |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EmailService now takes a required WorkflowsActivationReporter (#127135). The local SES suite built the service without it and stopped compiling after the master merge. It passes a stub, as the email service suite does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ocess SES fake Master's email service suite now sends through the real SESv2 client to an in-process SES fake (#132730) and already covers most of this outcome matrix. Add the cases it lacks there: shadow mode charges the team budget and sends past an empty one, every to, cc and bcc copy is charged and a send with more copies than the budget takes all of it and still sends, and a send that a team suspension, a workflow pause or the suppression list skips spends neither the workflow pacing nor the team budget. Drop the Docker SES fake, its CI step, compose service, package scripts and handbook line, which only served the separate suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g budget Assert that each skipped send records its own gate's metric with no error, and that the shadow test starts from a full budget, so a send that stops early for another reason cannot pass as a gate skip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 Claude Opus 5.5 responding on behalf of Michael Decisions from the takeover of this PR onto current master:
|
|
@PostHog review |
|
@Silthus PostHog Review is reviewing this pull request. |
A new stamphog review started for this PR — the fresh verdict replaces this approval.
There was a problem hiding this comment.
Approved.
Contained test-only additions with no production behavior changes or substantive unresolved concerns. The owning-team author also has a clean current-head review.
- PostHog Review (Standard) reviewed the current head: no findings.
- posthog[bot] reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 0L, 0F substantive, 114L/1F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T0 auto-approve: T0-deterministic (114L, 1F, single-area, test) |
| stamphog 2.8.0 | .stamphog/policy.yml @ 3014dd5 · reviewed head 3014dd5 |
|
/trunk merge |
Deploy status
This table shows the |
Problem
Moved from #112820, a fork PR, so backend CI runs.
Note
🔵 Merge risk: low · two-way door
email.service.test.ts, and the Node test jobs run them.nodejs/src/cdp/services/messaging/, a test file only)Changes
pnpmscript flags and handbook line. chore(cdp): drive email service tests through a faithful SES fake #132730 landed a real-SDK fake in process, and master's suite now covers the rest of the old matrix: providers, SES throttles and failures, pacing and team cap reschedules, suppression and suspension, and the engagement read after a send.How did you test this code?
Test rationale: seam
EmailService.executeSendEmail, with real PostgreSQL rows, real Redis buckets and the in-process SES fake. Each case reads the budget only through later sends (sendsLeftInTheTeamBudget), never through bucket keys.email.service.test.tsfile passes (284 tests).Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: T3 Code / Codex, GPT-6.1 Sol (the first outcome matrix); T3 Code / Claude Code, Claude Opus 5.5 (the move upstream, and the rework onto the in-process fake)
Skills:
takeover,modernize-pr,tdd,writing-pr-descriptions,merge-risk,qa-swarmMore context for AI agents
Involvement: one qa-swarm panel round (review and fresh-eyes lanes), PostHog Review; no proof owed.
🤖 Generated with Claude Code