chore(ci): gate depot ci-backend shadow behind toggle variable#60992
Merged
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "chore(ci): disable depot ci-backend shad..." | Re-trigger Greptile |
…ble-depot-shadow # Conflicts: # .depot/workflows/ci-backend.yml
gantoine
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Depot CI-backend shadow (added in the depot ci-backend shadow timing-trial PR (#53803)) auto-runs on every
pull_request,merge_group, andmasterpush, consuming Depot CI on each. We want it dormant now, but with an easy on/off switch — re-enabling shouldn't require another PR.Changes
Instead of stripping the triggers, the workflows keep their canonical triggers and gate execution on a
CI_ENABLE_DEPOT_SHADOWvariable. The two files run on different CI systems and therefore read the variable from different stores:vars.*from.depot/workflows/ci-backend.ymldepot ci vars add CI_ENABLE_DEPOT_SHADOW=true --repo PostHog/posthog.github/workflows/ci-backend-shadow-drift.yml.depot/workflows/ci-backend.yml: triggers restored to match canonical (push: master,pull_request,merge_group,workflow_dispatch). Gated onvars.CI_ENABLE_DEPOT_SHADOW == 'true'at two jobs —changes(the root of theneedsgraph, so gating it short-circuits every downstream job via the existingneeds.changes.outputs.*cascade) anddjango_tests(runs withalways(), so it would otherwise survive the skip cascade). All job logic is otherwise untouched..github/workflows/ci-backend-shadow-drift.yml:pull_request: pathstrigger restored and thecheckjob gated on the same-named GitHub variable, so drift enforcement tracks the shadow's on/off state.The variable is currently unset in both stores, so merging this leaves the shadow off — same end state as a hard disable. Re-enabling is a variable flip in both stores, no code change.
On the name
CI_ENABLE_DEPOT_SHADOWis valid in both stores: Depot reserves theDEPOT_prefix (an earlierDEPOT_CI_SHADOW_ENABLEDwas rejected bydepot ci vars), and GitHub only reserves theGITHUB_prefix.CIis a default environment variable on runners, but that namespace is separate from thevars.*context, so there's no collision.How did you test this code?
I'm an agent. No automated tests apply to a CI trigger/gating change. Verified:
yaml.safe_load) and the threeif:gates resolve to the expected jobs (changes,django_tests,check).masteris additive (comments + gates).depotCLI that the variable store is Depot-side and repo-scoped:depot ci vars list --repo PostHog/posthogshows the existingOIDC_RSA_FAKE_PRIVATE_KEY, confirming.depot/workflows read Depot variables (not GitHub).🤖 Agent context
Authored by Claude Code (Opus 4.8) at Raúl's direction. The first revision disabled the shadow by reducing both workflows to
workflow_dispatch; the ask was a variable-gated toggle so the shadow flips on/off without editing files.Key decisions and corrections:
changesjob and thealways()django_testscollator rather than annotating all ~10 jobs, since every other job already short-circuits through theneeds.changes.outputs.*cascade.varsfrom GitHub repository variables. That was wrong —depot ci varsis a separate Depot store (repo-scoped toPostHog/posthog), and the.github/drift check reads GitHub variables. The toggle therefore lives in two stores under the same name.CI_ENABLE_DEPOT_SHADOWto clear Depot's reservedDEPOT_prefix while staying valid on GitHub.