Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

ci: deploy signup-enrichment temporal worker on relevant master builds (#71269)

Matt Brookerfe9f75e2c9ae
diff --git a/.github/workflows/container-images-cd.yml b/.github/workflows/container-images-cd.yml
index af3c1c4dc0ed..066d25fde8a8 100644
--- a/.github/workflows/container-images-cd.yml
+++ b/.github/workflows/container-images-cd.yml
@@ -357,6 +357,15 @@ jobs:
echo "changed=false" >> $GITHUB_OUTPUT
fi
+ - name: Check for changes that affect signup enrichment temporal worker
+ id: check_changes_signup_enrichment_temporal_worker
+ run: |
+ if git diff --name-only HEAD^ HEAD | grep -qE '^posthog/temporal/signup_enrichment/|^products/growth/backend/|^ee/billing/salesforce_enrichment/|^posthog/temporal/common|^posthog/management/commands/start_temporal_worker.py$|^pyproject.toml$|^bin/temporal-django-worker$|^posthog/clickhouse/migrations/'; then
+ echo "changed=true" >> $GITHUB_OUTPUT
+ else
+ echo "changed=false" >> $GITHUB_OUTPUT
+ fi
+
- name: Check for changes that affect billing temporal worker
id: check_changes_billing_temporal_worker
run: |
@@ -645,6 +654,27 @@ jobs:
"timestamp": "${{ github.event.head_commit.timestamp }}"
}
+ - name: Trigger Signup Enrichment Temporal Worker Cloud deployment
+ if: steps.check_changes_signup_enrichment_temporal_worker.outputs.changed == 'true'
+ uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
+ with:
+ token: ${{ steps.deployer.outputs.token }}
+ repository: PostHog/charts
+ event-type: commit_state_update
+ client-payload: |
+ {
+ "values": {
+ "image": {
+ "sha": "${{ github.sha }}@${{ steps.build_retry.outputs.digest || steps.build.outputs.digest }}"
+ }
+ },
+ "release": "temporal-worker-signup-enrichment",
+ "commit": ${{ toJson(github.event.head_commit) }},
+ "repository": ${{ toJson(github.repository) }},
+ "labels": ${{ steps.labels.outputs.labels }},
+ "timestamp": "${{ github.event.head_commit.timestamp }}"
+ }
+
- name: Check for changes that affect temporal workers
uses: ./.github/actions/paths-filter
id: check_temporal_worker_changes
diff --git a/posthog/temporal/README.md b/posthog/temporal/README.md
index 10e752c1d74e..6b45534d3ac3 100644
--- a/posthog/temporal/README.md
+++ b/posthog/temporal/README.md
@@ -440,9 +440,13 @@ Once the workers are deployed, they will be able to run your workflows and activ
### Trigger deployments for workers
-Some changes in our CI/CD pipeline will be required to ensure your changes are triggering deployments to your Temporal workers. First, when a new deployment of Temporal workers is created, you may want to trigger the deployment on merges to this repository's `master` branch. For that, edit the `container-images-cd.yaml` GitHub workflow and add a new trigger step.
+This step is not optional, and it is not a follow-up: the charts deployment's image pointer (`state/<worker>.yaml` in the charts repo) is hand-seeded when the fleet is created and is only ever updated by the trigger step in this repository's `container-images-cd.yml` workflow. Without a trigger step your fleet stays pinned at its seed digest forever — and if the seed was taken before your feature merged, you ship a fleet running an image that does not contain your code. A worker started with a task queue that has no registered workflows in its image crash-loops on `ValueError: At least one activity, Nexus service, or workflow must be specified`. Land the trigger step before (or with) the charts fleet PR, and make sure the seed digest postdates your feature's merge commit.
-Moreover, notice that in the workflow every trigger step comes after a check step. This step ensures that only certain module changes trigger a worker re-deployment, and not every single change. This is done because restarting workers can be disruptive to workflows running in it, so as a general rule try to minimize the changes that will trigger a re-deployment of workers. You will probably only need the common temporal modules + your product specific modules in the check.
+To add one, edit the `container-images-cd.yml` GitHub workflow and copy an existing narrow worker's check + trigger step pair (the `release` name must match the charts state-file key).
+
+Notice that every trigger step comes after a check step. This step ensures that only certain module changes trigger a worker re-deployment, and not every single change. This is done because restarting workers can be disruptive to workflows running in it, so as a general rule try to minimize the changes that will trigger a re-deployment of workers. You will probably only need the common temporal modules + your product specific modules in the check — including modules your code imports from elsewhere in the repo (grep your entrypoint's imports).
+
+After the first deployment, verify by execution, not by dashboard health: temporal worker deployments disable liveness/readiness probes, so a crash-looping fleet still shows Healthy in ArgoCD, and Python startup tracebacks reach the logs pipeline at info severity (no error-level signal). Check the fleet's logs (`service.name = <worker>`) for the startup banner repeating every few minutes, and confirm one real workflow completed end to end.
> [!NOTE]
> Temporal workers stop polling for new tasks when a shutdown is initiated, and the deployments can configure a timeout for the shutdown, which can give time for all workflows currently running to finish. Configuring this correctly can minimize the disruption caused by triggering new deployments, but it can be hard to find the right timeout that ensures everything has time to finish without waiting forever.