Repository navigation
feat(email): map every transactional template to its workflows template - #122502
Conversation
🤖 CI report
|
| First copy | Second copy | Lines | Tokens |
|---|---|---|---|
posthog/tasks/alerts/detectors/statistical/mad.py:104 |
posthog/tasks/alerts/detectors/statistical/zscore.py:138 |
18 | 82 |
⚠️ Duplication (TypeScript) — 2 new duplicated blocks (worst 138 tokens)
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.
| First copy | Second copy | Lines | Tokens |
|---|---|---|---|
products/warehouse_suggestions/frontend/components/MaterializeSuggestionRow.tsx:31 |
products/warehouse_suggestions/frontend/components/UnmaterializeSuggestionRow.tsx:36 |
32 | 138 |
products/replay_vision/frontend/replay_scanners/replayScannersLogic.ts:630 |
products/replay_vision/frontend/replay_scanners/watchFeedLogic.ts:505 |
11 | 102 |
✅ Comment density — 3% of added code lines are comments (1 of 38)
This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out.
Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See .agents/skills/writing-code-comments/SKILL.md for the house rules.
Files with the most added comment lines:
| File | Comment lines | Added lines |
|---|---|---|
posthog/test/test_email.py |
1 | 3 |
This check does not block merging. It updates on every push and clears when the share drops.
|
Risk: No findings This increment routes the Workflows template pin through the settings checks in get_workflows_template_id instead of bypassing them, so a pinned retry only skips the feature flag. The change tightens behavior; the only new edge (Customer.io fallback when the Workflows API key is removed between attempts) is operator-triggered, documented, and tested as intended. Sentinel reviewed |
|
a-lider
left a comment
There was a problem hiding this comment.
All these templates are identical to cio, right?
I checked only the invite and password reset ones
|
😎 Merged successfully - details. |
Adds the Workflows message template id for all 36 Customer.io transactional templates, so each one can move through the transactional-emails-via-workflows flag without a deploy. Adds a check that every Workflows map key names a Customer.io template. Generated-By: PostHog Desktop Task-Id: a5c9c2a4-4563-4d98-a4b6-ef13d86f4473
6af879b to
2e8b19e
Compare
|
/depot retry |
|
/trunk merge |
Problem
WORKFLOWS_TEMPLATE_ID_MAP, and it mapspassword_resetalone.Changes
CUSTOMER_IO_TEMPLATE_ID_MAPnow has its Workflows template id, so any of them can move with a flag rule and no deploy.transactional-emails-via-workflowsmatches it.test_email.pygains one assertion: every Workflows key must name a Customer.io template. A mistyped key would otherwise never match a send and leave that template on Customer.io without any error.Note
The templates read
variables.*and the recipient address from the send. They rely on the HTML unescaping that #122019 adds, so this PR needs to land after it.How did you test this code?
Test rationale: the new assertion catches a key in
WORKFLOWS_TEMPLATE_ID_MAPthat names no template, which routes nothing and fails silently. It extendstest_all_http_templates_are_registered_in_customer_io_map, the existing guard for the same map-registration invariant, rather than adding a test.posthog/test/test_email.pyin a cloud sandbox against the base branch plus this commit.Release status
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: PostHog Desktop (Claude Code), claude-opus-5-5
gh stack, as requested./designing-email-templates,/writing-tests,/writing-pr-descriptions.gh pr list --search "WORKFLOWS_TEMPLATE_ID_MAP"found only feat(email): send transactional emails through workflows behind a flag #122019.Created with PostHog Desktop
🤖 Generated with Claude Code