Skip to content

fix(workflows): report a test send with no recipient as skipped - #127281

Merged
trunk-io[bot] merged 2 commits into
masterfrom
fix/cdp-email-missing-recipient-result
Nov 4, 2026
Merged

trunk-io[bot] merged 2 commits into
masterfrom
fix/cdp-email-missing-recipient-result

Conversation

@Silthus

@Silthus Silthus commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • Workflow authors who test an email step with an empty recipient see a green "Success" banner, though nothing was sent.
  • #127189 added a yellow skip banner, but the worker never reports this skip.

Note

🔵 Merge risk: low · two-way door (merge-risk rubric)

  • Sending, metrics and billing ignore the new field. The worst case is a wrong test banner.
  • Revert: git revert the merge commit.

Changes

  • A test send to an empty recipient now shows the yellow "Skipping send" banner.
  • The worker's missing-recipient skip now returns emailSendResult, like the other skip branches.
Before After
Before: green Success banner for a send that never happened Yellow banner: Skipping send: the recipient has no email address

How did you test this code?

Local stack at ee1f371, invented data:

  • The test endpoint returns the skip result (raw below). Master returns none.
  • A filled recipient still delivers.
  • A real empty-recipient run matches master.
  • Not checked: production.

Test rationale: the empty-recipient it.each now asserts emailSendResult, which fails on master.

Raw test endpoint response at ee1f371 (trimmed)
POST /api/projects/1/hog_flows/<id>/invocations/   person without billing_email
{"nextActionId":"exit_node","status":"success","errors":[], ...,
 "emailSendResult":{"status":"skipped","reason":"Skipping send: the recipient has no email address. Add a filter so only people with an email address reach this step."}}

Same request on master: no emailSendResult key.

POST /api/projects/1/hog_flows/<id>/run/   real run, no person
app_metrics2: email_missing_recipient 1, email_queued 1, succeeded 3   (same on master)
hog_invocation_results: succeeded                                      (same on master)

Release status

  • No feature flag controls this change

Docs update

  • None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Opus 5.5

Skills: /writing-tests, /writing-pr-descriptions

More context for AI agents

🤖 Generated with Claude Code

…result

Every other skip branch sets emailSendResult, so test send surfaces can tell the user nothing went out. The missing-recipient branch did not, and the workflow step test panel showed Success.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

✅ Trunk lane — non-backend lane

This 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) — clean

New 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) — clean

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

@hosthog

hosthog Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

HostHog preview — posthog-desktop-web

The previews for this PR have been torn down and no longer serve.

@Silthus Silthus changed the title fix(cdp): report a send skipped for a missing recipient fix(workflows): report a test send with no recipient as skipped Nov 2, 2026
@Silthus
Silthus marked this pull request as ready for review November 2, 2026 15:04
@parameterai

parameterai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Risk: No findings

The PR makes the worker's missing-recipient skip path in EmailService report an emailSendResult (status skipped) so the test-send UI shows the yellow skip banner, matching the suspension, workflow-pause, and suppression skip branches. The reason string is a fixed constant, the existing skipped flag and metrics are untouched, and the value only flows to the invoking team's own API response — no security risk introduced.

Sentinel reviewed ee1f371 · Review settings

@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team November 2, 2026 15:05
@Silthus Silthus added the stamphog Request AI approval (no full review) label Nov 4, 2026

@stamphog stamphog Bot 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.

Approved.

The response change enters API territory, with assurance supplied by owning-team authorship and a targeted test assertion. No unresolved review concerns or other refusal grounds were found.

Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
size ✓ 6L, 1F substantive, 10L/2F incl. docs/generated/snapshots — within ceiling
tier ✓ T1-agent / T1a-trivial (10L, 2F, single-area, fix)
stamphog 2.7.0 .stamphog/policy.yml @ ee1f371 · reviewed head ee1f371

@Silthus

Silthus commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/trunk merge

@trunk-io
trunk-io Bot merged commit 7496111 into master Nov 4, 2026
342 checks passed
@trunk-io
trunk-io Bot deleted the fix/cdp-email-missing-recipient-result branch November 4, 2026 08:29
@deployment-status-posthog

deployment-status-posthog Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-11-04 08:54 UTC Run
prod-us ✅ Deployed 2026-11-04 09:09 UTC Run
prod-eu ✅ Deployed 2026-11-04 09:09 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant