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.

chore(tasks): gate the sandbox agent bump on the base image smoke (#106497)

Alessandro Pogliaghi4c2389adc203
diff --git a/.github/workflows/cd-sandbox-base-image.yml b/.github/workflows/cd-sandbox-base-image.yml
index e86599677b21..34eccf00150b 100644
--- a/.github/workflows/cd-sandbox-base-image.yml
+++ b/.github/workflows/cd-sandbox-base-image.yml
@@ -321,6 +321,7 @@ jobs:
packages: write # allow push to ghcr.io
outputs:
promoted: ${{ steps.promote.outcome }}
+ base_smoke: ${{ steps.smoke.outcome }}
steps:
- name: Check out
@@ -394,7 +395,8 @@ jobs:
platforms: linux/arm64,linux/amd64
- name: Smoke the installed agent on both architectures
- if: github.event_name == 'pull_request' || vars.CD_DEPLOY_ENABLED == 'true'
+ id: smoke
+ if: ${{ !cancelled() && steps.build.outcome == 'success' && (github.event_name == 'pull_request' || vars.CD_DEPLOY_ENABLED == 'true') }}
env:
IMAGE: ghcr.io/posthog/posthog-sandbox-base:${{ github.sha }}
run: |
@@ -415,7 +417,7 @@ jobs:
- name: Promote the smoked base image to :master
id: promote
- if: github.ref == 'refs/heads/master' && vars.CD_DEPLOY_ENABLED == 'true'
+ if: ${{ !cancelled() && steps.smoke.outcome == 'success' && github.ref == 'refs/heads/master' && vars.CD_DEPLOY_ENABLED == 'true' }}
env:
IMAGE: ghcr.io/posthog/posthog-sandbox-base
run: |
@@ -579,6 +581,24 @@ jobs:
unfurl_links: false
text: "${{ steps.message.outputs.text }}"
+ sandbox_base_smoke_check:
+ needs: [build_skills, sandbox_base_build]
+ name: Sandbox Base Image Smoke
+ runs-on: ubuntu-24.04
+ timeout-minutes: 5
+ if: ${{ !cancelled() && (needs.build_skills.result != 'skipped' || needs.sandbox_base_build.result != 'skipped') && (github.event_name == 'pull_request' || vars.CD_DEPLOY_ENABLED == 'true') }}
+ permissions: {}
+ steps:
+ - name: Check the base image build and agent smoke
+ env:
+ SMOKE: ${{ needs.sandbox_base_build.outputs.base_smoke }}
+ run: |
+ if [ "$SMOKE" != "success" ]; then
+ echo "::error::The base image agent smoke concluded ${SMOKE:-without a result}."
+ exit 1
+ fi
+ echo "The base image built and its agent smoke passed."
+
# Single required status check for branch protection. Add future sandbox
# image jobs to `needs` here rather than reconfiguring GitHub.
# NOT registered as required yet: the trigger-level pull_request paths
diff --git a/.github/workflows/update-sandbox-agent-version.yml b/.github/workflows/update-sandbox-agent-version.yml
index d48eb807d47a..1f1db8604d63 100644
--- a/.github/workflows/update-sandbox-agent-version.yml
+++ b/.github/workflows/update-sandbox-agent-version.yml
@@ -351,7 +351,7 @@ jobs:
uses: ./.github/actions/wait-for-check
with:
token: ${{ steps.app-token.outputs.token }}
- checkName: Sandbox Base Image Pass
+ checkName: Sandbox Base Image Smoke
ref: ${{ steps.commit.outputs.commit-hash }}
timeoutSeconds: '4500'
intervalSeconds: '30'
@@ -363,7 +363,7 @@ jobs:
SHA: ${{ steps.commit.outputs.commit-hash }}
PR: ${{ steps.pr.outputs.number }}
run: |
- echo "::error::Sandbox Base Image Pass concluded $CONCLUSION on $SHA, so PR #$PR waits for a person"
+ echo "::error::Sandbox Base Image Smoke concluded $CONCLUSION on $SHA, so PR #$PR waits for a person"
exit 1
- name: Smoke the agent on the Go ai-gateway
@@ -476,7 +476,7 @@ jobs:
if [ "$ENQUEUE" = "success" ]; then
text=":white_check_mark: The image built from ${pr} passed the smoke on amd64 and arm64 and on the Go ai-gateway. Approved and added to the merge queue."
elif [ -n "$SMOKE" ] && [ "$SMOKE" != "success" ]; then
- text=":red_circle: Sandbox Base Image Pass concluded \`${SMOKE}\` on ${pr}, so it waits for a person. <${RUN_URL}|View run>"
+ text=":red_circle: Sandbox Base Image Smoke concluded \`${SMOKE}\` on ${pr}, so it waits for a person. <${RUN_URL}|View run>"
elif [ -n "$GATEWAY_SMOKE" ] && [ "$GATEWAY_SMOKE" != "pass" ]; then
text=":red_circle: The Go ai-gateway smoke reported \`${GATEWAY_SMOKE}\` on ${pr}, so it waits for a person. <${RUN_URL}|View run>"
elif [ -n "$PR_NUMBER" ]; then