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.

feat(tasks): let the golden bake target a non-default alias (#106236)

Tom Owers26bb253e625b
diff --git a/.github/workflows/cd-tasks-golden-snapshot.yml b/.github/workflows/cd-tasks-golden-snapshot.yml
index edfb91ad312b..d8e9ec2cf9ef 100644
--- a/.github/workflows/cd-tasks-golden-snapshot.yml
+++ b/.github/workflows/cd-tasks-golden-snapshot.yml
@@ -59,6 +59,10 @@ on:
description: 'Boot memory (MiB) for a pluggable-memory golden — boots this small and hot-adds up to the cap. Blank = fixed-size golden (today).'
required: false
default: ''
+ target_alias:
+ description: 'Live alias to promote the baked snapshot into. Blank = posthog-tasks-default (the golden every task box uses). Set posthog-tasks-hotplug to publish a pluggable-memory golden alongside the default, selected per team by the tasks-hogland-hotplug-golden flag.'
+ required: false
+ default: ''
schedule:
# Daily, minute offset off :00 — GitHub's scheduler is contended at the
# top of the hour and may drop those runs. No-op until armed (job `if`).
@@ -648,11 +652,15 @@ jobs:
# Promote: re-point the live alias at the candidate's snapshot id. A
# single alias PUT — atomic from any restoring caller's perspective.
- - name: Promote candidate to default
+ - name: Promote candidate to the live alias
id: promote
if: env.skip != 'true'
env:
CLUSTER: ${{ matrix.cluster }}
+ # Blank -> the default golden every box restores from. A pluggable
+ # bake sets this to a separate alias (e.g. posthog-tasks-hotplug) so
+ # it never touches the default; the hotplug flag selects it per team.
+ TARGET_ALIAS: ${{ inputs.target_alias || 'posthog-tasks-default' }}
run: |
set -euo pipefail
SNAP_ID=$(hogland snapshot resolve posthog-tasks-candidate | jq -r .snapshot_id)
@@ -660,7 +668,7 @@ jobs:
# clean 409), so a transient collision must not fail the promote.
promoted=0
for attempt in 1 2 3 4 5; do
- if hogland snapshot alias "$SNAP_ID" posthog-tasks-default; then
+ if hogland snapshot alias "$SNAP_ID" "$TARGET_ALIAS"; then
promoted=1
break
fi
@@ -668,7 +676,7 @@ jobs:
sleep $((attempt * 5))
done
if [[ "$promoted" != "1" ]]; then
- echo "::error::failed to repoint posthog-tasks-default after 5 attempts"
+ echo "::error::failed to repoint $TARGET_ALIAS after 5 attempts"
exit 1
fi
# Confirm the live alias now resolves to our snapshot. This
@@ -676,9 +684,9 @@ jobs:
# catches a lost or overwritten alias write on THIS cluster — it
# does not prove the bake ran against the intended cluster (both
# the PUT and this read use the same matrix HOG_HOST).
- resolved=$(hogland snapshot resolve posthog-tasks-default | jq -r .snapshot_id)
+ resolved=$(hogland snapshot resolve "$TARGET_ALIAS" | jq -r .snapshot_id)
if [[ "$resolved" != "$SNAP_ID" ]]; then
- echo "::error::posthog-tasks-default in cluster ${CLUSTER} resolves to ${resolved}, expected ${SNAP_ID}"
+ echo "::error::$TARGET_ALIAS in cluster ${CLUSTER} resolves to ${resolved}, expected ${SNAP_ID}"
exit 1
fi
echo "snapshot_id=$SNAP_ID" >> "$GITHUB_OUTPUT"