: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(ci): unblock hobby CI with staging certs, health budget, nightly run (#79714)
Georges-Antoine Assi4d4814b9fb8f
diff --git a/.github/workflows/ci-hobby.yml b/.github/workflows/ci-hobby.ymlindex 3fd45c4782b9..0efccb93f5fb 100644--- a/.github/workflows/ci-hobby.yml+++ b/.github/workflows/ci-hobby.yml@@ -11,6 +11,11 @@ on:push:branches:- 'release-*.*'+ schedule:+ # Nightly smoke test against master. The paths filter only runs this job on PRs that+ # touch deploy-path files, so a hobby install broken by ordinary product code (a bad+ # migration, a service that can't boot) would otherwise go uncaught until a release push.+ - cron: '0 6 * * *'pull_request:types: [opened, synchronize, labeled, unlabeled]@@ -224,13 +229,13 @@ jobs:hobby-test:runs-on: ubuntu-24.04- timeout-minutes: 90+ timeout-minutes: 120name: Setup DO Hobby Instance and testneeds: [wait-for-docker-image, changes]# A status function is required to read wait-for-docker-image's conclusion after it# failed or was skipped. !cancelled() rather than always() so a superseded PR run stops- # this 90-minute job promptly; the explicit conclusion/push checks preserve when it runs.- if: ${{ !cancelled() && ((needs.changes.outputs.should_run == 'true' && needs.wait-for-docker-image.outputs.conclusion == 'success') || github.event_name == 'push') }}+ # this job promptly; the explicit conclusion/push/schedule checks preserve when it runs.+ if: ${{ !cancelled() && ((needs.changes.outputs.should_run == 'true' && needs.wait-for-docker-image.outputs.conclusion == 'success') || github.event_name == 'push' || github.event_name == 'schedule') }}steps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2with:@@ -306,7 +311,11 @@ jobs:- name: Wait for health checkif: env.TEST_EXIT_CODE == '0'id: health-check- timeout-minutes: 40+ # Must stay above wait_for_health_check's internal budget in bin/hobby-ci.py so the+ # script times out first and reports container diagnostics instead of the runner+ # killing the step. Raise both together: the budget covers the full Django migration+ # run against an empty Postgres before /_health answers, which grows over time.+ timeout-minutes: 65run: |set +euv run bin/hobby-ci.py wait-for-healthdiff --git a/bin/hobby-ci.py b/bin/hobby-ci.pyindex 4ddd5f1b5169..c9afca08f008 100644--- a/bin/hobby-ci.py+++ b/bin/hobby-ci.py@@ -174,6 +174,19 @@ runcmd:safe_sha = shlex.quote(self.sha) if self.sha else "unknown"safe_hostname = shlex.quote(self.hostname)+ # Smoke tests use a fresh hostname per run, so real ACME certs would blow through+ # Let's Encrypt's 50-certs-per-registered-domain/168h limit for posthog.cc. Point Caddy+ # at the LE staging directory. Preview instances keep real certs since humans browse them.+ preview_mode = os.environ.get("PREVIEW_MODE", "false").lower() == "true"+ tls_commands = (+ []+ if preview_mode+ else [+ 'echo "$LOG_PREFIX Using Let\'s Encrypt staging directory for ACME (CI cert rate-limit avoidance)"',+ "export TLS_BLOCK='acme_ca https://acme-staging-v02.api.letsencrypt.org/directory'",+ ]+ )+# Add runcmd commands with loggingcommands = ['LOG_PREFIX="[$(date +%Y-%m-%d_%H:%M:%S)]"',@@ -197,6 +210,7 @@ runcmd:self._get_wait_for_image_script(),self._get_node_image_fallback_script(),*self._get_installer_commands(),+ *tls_commands,'echo "$LOG_PREFIX Starting hobby installer (CI mode)"',f"./hobby-installer --ci --domain {safe_hostname} --version $CURRENT_COMMIT","DEPLOY_EXIT=$?",@@ -779,7 +793,7 @@ runcmd:def wait_for_health_check(self,cloud_init_finished_at: datetime.datetime,- timeout_minutes: int = 35,+ timeout_minutes: int = 60,retry_interval: int = 15,stability_period: int = 300,startup_grace_seconds: int = 300,@@ -943,7 +957,7 @@ runcmd:def test_deployment_with_details(self,cloud_init_timeout=35,- health_timeout=35,+ health_timeout=60,retry_interval=15,stability_period=300,startup_grace_seconds=300,