Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/ci-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ jobs:
# Anything here invalidates jest's view of the module graph, or changes
# the native addons every suite links, so no narrowed run can be trusted.
node_full:
- 'docker-compose.base.yml'
- 'docker-compose.dev.yml'
# readFileSync, so jest cannot reach the parity test through --findRelatedTests.
- 'products/cdp/backend/filter_globals.json'
- 'common/hogvm/typescript/src/**'
Expand Down Expand Up @@ -583,13 +585,19 @@ jobs:
install-command: pnpm --filter=@posthog/nodejs... install --frozen-lockfile
token: ${{ steps.setup-gh-token.outputs.token || github.token }}

- name: Wait for Clickhouse, Redis, Kafka, DynamoDB, SeaweedFS
- name: Wait for Clickhouse, Redis, Kafka, DynamoDB, SeaweedFS, SES
# seaweedfs backs the blob-store integration tests; the profile-scoped
# stack launch above never starts it (it sits in the replay/agents
# profiles), so start it explicitly here — no profiles overlay in play.
# objectstorage starts by default but is listed so --wait blocks on its
# bootstrap sentinel: it returns InvalidAccessKeyId until that finishes.
run: docker compose -f docker-compose.dev.yml up kafka redis7 valkey-cluster clickhouse maildev dynamodb objectstorage seaweedfs -d --wait
run: |
services=(kafka redis7 valkey-cluster clickhouse maildev dynamodb objectstorage seaweedfs)
# The workflow also runs on unrebased branches whose compose file has no SES service.
if docker compose -f docker-compose.dev.yml --profile ses config --services | grep -qx ses; then
services+=(ses)
fi
docker compose -f docker-compose.dev.yml up "${services[@]}" -d --wait

- name: Create Kafka topics
run: docker compose -f docker-compose.dev.yml up kafka-init
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,21 @@ services:
profiles: ['batch-exports']
command: azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --location /data

ses:
image: ghcr.io/domdomegg/aws-ses-v2-local:2.10.2@sha256:1c0db32e27b52d7ac7c16048e074ffc176c9aa7f117e63babd0d911c5ef8330f
restart: on-failure
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://127.0.0.1:8005/health-check').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))",
]
interval: 3s
timeout: 1s
retries: 10

maildev:
image: maildev/maildev:2.0.5
restart: on-failure
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,14 @@ services:
ports:
- '10000:10000'

ses:
profiles: [ses]
extends:
file: docker-compose.base.yml
service: ses
ports:
- '127.0.0.1:4566:8005'

maildev:
extends:
file: docker-compose.base.yml
Expand Down
4 changes: 4 additions & 0 deletions docs/published/handbook/engineering/developing-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ This allows you to easily confirm that emails are being sent and formatted corre

Emails sent via SMTP are stored in HTML files in `posthog/templates/*/*.html`. They use Django Template Language (DTL).

Workflow SES tests use the pinned `aws-ses-v2-local` compose service at `http://127.0.0.1:4566`, which also exposes its inbox at `/store`. With the rest of the dev stack running, start this optional service with `docker compose -f docker-compose.dev.yml up ses -d --wait` and run `hogli test nodejs/src/cdp/services/messaging/email.service.ses.test.ts`.

The `LocalSes` test helper gives each test its own HTTP proxy for request capture and persistent SESv2 errors. It reads only the message IDs that proxy delivered, without clearing the shared inbox. Tests use invented AWS credentials and distinguish SDK HTTP attempts from retries of the workflow invocation. The inbox schema and delivery assertions check the fake's contract when its image changes; the fake does not validate AWS tenant or configuration-set provisioning.

## Extra: Integrating with slack

You can connect to a real slack workspace in your local development setup by adding the required slack environment variables to your `.env` file.
Expand Down
Loading
Loading