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.

fix(devex): narrow the merge-queue universal lane (#90085)

Georges-Antoine Assi91652abd7aa9
diff --git a/.github/scripts/trunk-impacted-targets.js b/.github/scripts/trunk-impacted-targets.js
index 052c90a3afd0..89fd60d13baa 100644
--- a/.github/scripts/trunk-impacted-targets.js
+++ b/.github/scripts/trunk-impacted-targets.js
@@ -121,24 +121,12 @@ const PYTHON = 'python'
const JAVASCRIPT = 'javascript'
const RUST = 'rust'
-// The nodejs lane on its own. No path-based tripwire resolves to it alone,
-// because a file that can break the ingestion suite can almost always break
-// more than that. The rust, proto, and cross-domain workflow rules still need
-// to name it without dragging in the frontend.
-const NODE = 'node'
-
// The product manifests and the artifacts generated from them. Not a toolchain
// domain: it names the two lane families that read that data rather than a
// language, and it exists because `universal` was claiming lanes no reader of
// those files can reach.
const PRODUCT_SURFACE = 'product-surface'
-// The desktop app's workflow family. Named for its product rather than a
-// language because products/desktop is backend-detached: its files land on
-// fe:product:desktop and py:product:desktop and nothing else, so those two
-// lanes are the whole radius of a workflow confined to that tree.
-const DESKTOP = 'desktop'
-
// The proto trees, named for their consumers for the same reason. Every
// consumer generates stubs, so the set is enumerable: tonic builds the rust
// ones on `cargo build`, and the personhog stubs are checked in for both python
@@ -155,6 +143,69 @@ const SEMGREP = 'semgrep'
// moved, degrading to every crate when that answer is absent.
const CARGO_LOCK = 'cargo-lock'
+// The nodejs lane on its own, for files whose only reader is the ingestion
+// suite or an image built purely from nodejs/ sources. The rust and proto
+// rules also use it to name that lane without dragging in the frontend.
+const NODE = 'node'
+
+// Suites that run the backend and the frontend together: E2E, Hog, and the
+// builds of the images those suites run inside. Both language families in
+// full, which still leaves the rust crates and the standalone trees free
+// (E2E runs prebuilt capture containers from rust/, but rust/** is outside
+// its paths filter, so that gap is the filter's, not this lane's).
+const FULLSTACK = 'fullstack'
+
+// Release and CD workflows. See addDeployLane for why one shared lane is safe.
+const DEPLOY = 'deploy'
+
+// The hobby deployment: its install scripts and the smoke test that runs them.
+const HOBBY = 'hobby'
+
+// The desktop product's own CI and release workflows.
+const DESKTOP = 'desktop'
+
+// ci-cli.yml and the reusable cargo-dist plan it calls, which build the CLI
+// from services/mcp sources. The same pair STANDALONE_TREES gives cli/ itself.
+const CLI_ARTIFACTS = 'cli-artifacts'
+
+// The hogbox preview-environment workflows, which read the hogbox tooling.
+const HOGBOX_PREVIEW = 'hogbox-preview'
+
+// Bot, report, sync, and canary workflows plus the scripts they run. None of
+// them is a required check, so a break costs a bot action rather than a merge
+// gate, and one shared lane keeps a script and the workflow that runs it
+// serialized against each other.
+const REPO_AUTOMATION = 'repo-automation'
+
+// The local development stack: hogli start, the mprocs process lists, the
+// readiness checks, and the developer-only helper scripts. No required check
+// runs any of it except its own selftest workflows, which share the lane.
+const DEV_ENV = 'dev-env'
+
+// Entrypoints and configuration baked into the unified app image, which backs
+// the E2E suites, the hobby deployment, and production alike.
+const APP_IMAGE = 'app-image'
+
+// Suites that gate documentation changes, which claim the prose lane. Their
+// tooling has to share it, or a docs-check change and the docs PR it breaks
+// against merge in parallel.
+const PROSE_SUITE = 'prose-suite'
+
+// The ownership data and the suite that validates it. No other suite's outcome
+// depends on ownership jointly with a second PR's changes: the root owners.yaml
+// is a fallback, so nothing can become unowned, and the readers outside the
+// validation suite are review-routing bots. Two ownership edits can conflict
+// with each other (a team renamed under a reference), which one shared lane
+// serializes. A product's own owners.yaml keeps its product lane.
+const OWNERSHIP = 'ownership'
+
+// The vendored paths-filter action and its CI. It decides which jobs run
+// inside a single run's own diff, so no run's outcome depends on it jointly
+// with another queue entry: parallel entries never share a run, and master
+// pushes skip the filters and run the suites in full. Its own tests pair with
+// it in the lane.
+const CI_TOOLING = 'ci-tooling'
+
const TRIPWIRE_RULES = [
// Markdown in these trees compiles into nothing and no suite reads it, so
// it is prose like any other. Ahead of the trees themselves, which would
@@ -181,11 +232,8 @@ const TRIPWIRE_RULES = [
['tach.toml', PYTHON],
// A workflow decides which suites run, so one that defines a single
- // language's suite can be held to that language's lanes. A release or
- // maintenance workflow whose sources and artifacts all sit on one
- // language's lanes is held the same way, and a workflow spanning more
- // than one family takes a list of domains, applied in union. Everything
- // else under .github/ stays universal: the list grows by decision, and a
+ // language's suite can be held to that language's lanes. Everything else
+ // under .github/ stays universal: the list grows by decision, and a
// workflow nobody has placed here keeps the old radius.
['.github/workflows/ci-frontend.yml', JAVASCRIPT],
['.github/workflows/ci-storybook.yml', JAVASCRIPT],
@@ -193,145 +241,262 @@ const TRIPWIRE_RULES = [
['.github/workflows/ci-nodejs.yml', JAVASCRIPT],
['.github/workflows/ci-nodejs-container.yml', JAVASCRIPT],
['.github/workflows/ci-mcp.yml', JAVASCRIPT],
- // Gates only the TS generation and vite builds under services/mcp,
- // products/*/mcp, and common/mosaic. Its uv install step is unused
- // toolchain setup, not a Python suite.
- ['.github/workflows/ci-mcp-ui-apps.yml', JAVASCRIPT],
- // workflow_call only; its one caller (ci-survey-sdk-check) drift-checks
- // docs generated by a frontend TS build.
- ['.github/workflows/ci-docs-check.yml', JAVASCRIPT],
- ['.github/workflows/browserslist.yml', JAVASCRIPT],
- ['.github/workflows/publish-quill-npm.yml', JAVASCRIPT],
- // Runs pnpm inside nodejs/ to refresh the LLM cost tables, despite the
- // language-neutral name.
- ['.github/workflows/update-ai-costs.yml', JAVASCRIPT],
- // Mirrors the upstream Playwright image to ghcr on a schedule; the image
- // is consumed only by ci-storybook.yml and the local Playwright
- // container, and no PR triggers the mirror itself.
- ['.github/workflows/ci-playwright-container.yml', JAVASCRIPT],
['.github/workflows/ci-backend.yml', PYTHON],
['.github/workflows/ci-backend-update-test-timing.yml', PYTHON],
['.github/workflows/ci-backend-shadow-drift.yml', PYTHON],
['.github/workflows/ci-dagster.yml', PYTHON],
- ['.github/workflows/ci-python.yml', PYTHON],
- // ci-ai and ci-replay-vision-evals install a rust toolchain only to
- // cargo-install the external sqlx-cli their dev stack needs; no repo
- // crate compiles, and the suites they run are Python evals.
- ['.github/workflows/ci-ai.yml', PYTHON],
- ['.github/workflows/ci-replay-vision-evals.yml', PYTHON],
- ['.github/workflows/ci-clickhouse-hcl-schema.yml', PYTHON],
- ['.github/workflows/ci-clickhouse-multinode-migrations.yml', PYTHON],
- // Builds the CPython extension wheel from common/hogql_parser (a
- // COMMON_PYTHON tree) and commits the pyproject.toml/uv.lock pin, all of
- // which sit on the python lanes already.
- ['.github/workflows/build-hogql-parser.yml', PYTHON],
- ['.github/workflows/publish-hogli.yml', PYTHON],
- // Dispatches the cloud-infra UDF deploy when the committed binaries under
- // posthog/user_scripts/ change. It never fires on funnel-udf/** (the rust
- // sources those binaries are built from), so the PRs it interacts with
- // are the python-lane ones that commit the binaries.
- ['.github/workflows/clickhouse-udfs.yml', PYTHON],
['.github/workflows/ci-rust.yml', RUST],
['.github/workflows/ci-rust-flags-integration.yml', RUST],
- // The rust image builds and crate publishes: everything they build or
- // release comes from the rust workspace, and their outputs (ghcr images,
- // crates.io crates) feed nothing another lane's suite builds from this
- // checkout.
- ['.github/workflows/rust-docker-build.yml', RUST],
- ['.github/workflows/rust-smoke-test-build.yml', RUST],
- ['.github/workflows/_rust-build-images.yml', RUST],
- ['.github/workflows/publish-replay-anonymizer-crate.yml', RUST],
- ['.github/workflows/publish-symbol-data-crate.yml', RUST],
- // Tests tools/openapi-codegen, so it takes the same domain as the tree
- // it gates.
- ['.github/workflows/ci-openapi-codegen.yml', PRODUCT_SURFACE],
- // The desktop app's CI and release family. Every desktop-*.yml confines
- // itself to products/desktop/** and .github/scripts/desktop/** (the
- // PR-triggering ones are also path-filtered to that tree), so its radius
- // is the desktop product's own two lanes. A desktop workflow that starts
- // reaching further must be placed above this rule with the wider domain.
- ['.github/workflows/desktop-*.yml', DESKTOP],
+ // These two gate suites that run only Python: the tools and
+ // approval-agent pytest suites, and the ClickHouse multinode migration
+ // smoke.
+ ['.github/workflows/ci-python.yml', PYTHON],
+ ['.github/workflows/ci-clickhouse-multinode-migrations.yml', PYTHON],
// Blocks Django or sqlx migrations landing beside nodejs/ or other rust/
// changes, so all three families interact with an edit to the gate.
['.github/workflows/ci-migrations-service-separation-check.yml', [PYTHON, NODE, RUST]],
- // The deltalite and hogql-parser-rs release paths pair a rust crate with
- // the root Python pins (pyproject.toml, uv.lock) they commit back.
- ['.github/workflows/build-deltalite.yml', [RUST, PYTHON]],
- ['.github/workflows/ci-deltalite-python.yml', [RUST, PYTHON]],
- ['.github/workflows/build-hogql-parser-rs.yml', [RUST, PYTHON]],
- // Compiles the C++ parser (a COMMON_PYTHON tree) to WASM and commits the
- // frontend/package.json + pnpm-lock.yaml pin back to the PR branch.
- ['.github/workflows/build-hogql-parser-npm.yml', [PYTHON, JAVASCRIPT]],
- // Gates the Python HogVM, the generated hogql grammar, and the
- // TypeScript @posthog/hogvm package it publishes. rust/** and
- // livestream/** are excluded at its trigger, so the rust HogVM is not in
- // its radius.
- ['.github/workflows/ci-hog.yml', [PYTHON, JAVASCRIPT]],
+ // Suites that run the backend and the frontend together, and the builds of
+ // the images those suites run inside. cd-sandbox-base-image is here rather
+ // than on the deploy lane because it builds on pull requests from product
+ // code, so it is a PR suite despite the cd- name, and it has to precede
+ // the cd-*-image rule below.
+ ['.github/workflows/ci-e2e-playwright.yml', FULLSTACK],
+ ['.github/workflows/ci-e2e-playwright-audit.yml', FULLSTACK],
+ ['.github/workflows/ci-hog.yml', FULLSTACK],
+ ['.github/workflows/container-images-ci.yml', FULLSTACK],
+ ['.github/workflows/cd-sandbox-base-image.yml', FULLSTACK],
+ ['.github/workflows/ci-recording-rasterizer-container.yml', FULLSTACK],
+ // The ml-mirror-image-scrub sidecar is built from nodejs/ sources only.
+ ['.github/workflows/ci-ml-mirror-image-scrub-container.yml', NODE],
// The skills build renders templates that import product Python, and the
// embedded-payload job runs the services/mcp generator that writes into
// products/*/frontend/generated/. It does not gate .agents/.
['.github/workflows/ci-agent-skills.yml', [PYTHON, JAVASCRIPT]],
- // buf lint and breaking gate every tree under proto/, including the ones
- // whose only consumers are rust crates, and the codegen jobs gate the
- // checked-in python and node stubs.
- ['.github/workflows/ci-proto.yml', [PYTHON, NODE, RUST]],
-
- // Workflows whose whole radius is a standalone tree take that tree's own
- // lanes, verified against each workflow's jobs and path filters like the
- // domain entries above. Two lookalikes are deliberately absent:
- // hogbox-preview-env.yml builds the main app frontend and boots the PR's
- // backend with no paths filter, and clickhouse-udfs.yml fires on
- // posthog/user_scripts/** (the committed UDF binaries in the Django
- // tree), never on funnel-udf/**, so it sits with the python entries.
- ['.github/workflows/ci-cli.yml', { lanes: ['cli', 'svc:mcp'] }],
- ['.github/workflows/release-cli.yml', { lanes: ['cli', 'svc:mcp'] }],
- // The cargo-dist packaging check pr-housekeeping.yml calls: it builds the
- // cli crate plus the services/mcp API CLI bundle, the same pairing
- // ci-cli.yml carries.
- ['.github/workflows/release.yml', { lanes: ['cli', 'svc:mcp'] }],
- // Service suites and image builds confined to one services/ tree. The
- // two -image CDs default their Docker context to the repo root, but
- // their Dockerfiles copy only the root lockfiles plus the service tree.
- ['.github/workflows/ci-llm-gateway.yml', { lanes: ['svc:llm-gateway'] }],
- ['.github/workflows/llm-gateway-cd.yml', { lanes: ['svc:llm-gateway'] }],
- ['.github/workflows/ci-agent-proxy.yml', { lanes: ['svc:agent-proxy'] }],
- ['.github/workflows/cd-agent-proxy-image.yml', { lanes: ['svc:agent-proxy'] }],
- ['.github/workflows/ci-integration-service.yml', { lanes: ['svc:integration-service'] }],
- ['.github/workflows/cd-integration-service-image.yml', { lanes: ['svc:integration-service'] }],
- ['.github/workflows/ci-oauth-proxy.yml', { lanes: ['svc:oauth-proxy'] }],
- // Builds the otel-collector agent image and its chart from
- // products/metrics/agent, a self-contained product subtree. Any file
- // there claims at least one of these two lanes, so the pair overlaps
- // every interacting PR.
- ['.github/workflows/cd-metrics-agent-image.yml', { lanes: ['py:product:metrics', 'fe:product:metrics'] }],
- // Tests and builds the standalone image-scrub sidecar package under
- // nodejs/; its repo-root Docker context copies nothing outside that tree.
- ['.github/workflows/ci-ml-mirror-image-scrub-container.yml', NODE],
- // The MCP image compiles every product's mcp/apps, all of packages/, and
- // tools/openapi-codegen, which is the product-surface reader set.
- ['.github/workflows/cd-mcp-image.yml', PRODUCT_SURFACE],
- // Audited and kept universal: cd-llm-analytics-image and
- // cd-sandbox-base-image bake the whole Django app into their images (the
- // sandbox image also builds every product's skills against the full dev
- // stack), and ci-recording-rasterizer-container copies all of rust/ and
- // both common/ families into its image.
- ['.github/workflows/ci-livestream.yml', { lanes: ['livestream'] }],
- ['.github/workflows/ci-livestream-tui.yml', { lanes: ['livestream'] }],
- ['.github/workflows/build-livestream-tui.yml', { lanes: ['livestream'] }],
- ['.github/workflows/livestream-docker-image.yml', { lanes: ['livestream'] }],
- ['.github/workflows/terragrunt-posthog.yaml', { lanes: ['terraform'] }],
- ['.github/workflows/ci-phrocs.yml', { lanes: ['tools:phrocs'] }],
- ['.github/workflows/build-phrocs.yml', { lanes: ['tools:phrocs'] }],
- ['.github/workflows/hogbox-preview-cleanup.yml', { lanes: ['tools:hogbox-preview'] }],
-
- // The Depot shadows of workflows narrowed above take their canonical
- // twin's domain: a shadow defines the same single-language suite, just on
- // Depot runners, and ci-backend-shadow-drift.yml holds the pair in sync.
- // A shadow of a workflow not narrowed above falls through to the .depot/**
- // rule below and stays universal, the same way the canonical one does
- // through .github/**.
- ['.depot/workflows/ci-backend.yml', PYTHON],
- ['.depot/workflows/ci-backend-update-test-timing.yml', PYTHON],
+ // buf lint and the stub drift checks span every proto tree, which is the
+ // radius proto/buf.yaml gets.
+ ['.github/workflows/ci-proto.yml', PROTO],
+ // Suites owned by one service directory.
+ ['.github/workflows/ci-llm-gateway.yml', 'service:llm-gateway'],
+ ['.github/workflows/ci-oauth-proxy.yml', 'service:oauth-proxy'],
+ ['.github/workflows/ci-agent-proxy.yml', 'service:agent-proxy'],
+ // The UI apps build reads services/mcp and every products/*/mcp tree,
+ // which are the readers the product-surface domain already names.
+ ['.github/workflows/ci-mcp-ui-apps.yml', PRODUCT_SURFACE],
+ ['.github/workflows/ci-cli.yml', CLI_ARTIFACTS],
+ ['.github/workflows/release.yml', CLI_ARTIFACTS],
+ // The hobby smoke test and the installer CI are the only suites that read
+ // the hobby scripts, so they share the hobby lane with them (the bin/
+ // rules below).
+ ['.github/workflows/ci-hobby.yml', HOBBY],
+ ['.github/workflows/ci-hobby-installer.yml', HOBBY],
+ // The desktop product's whole CI and release family builds and tests only
+ // products/desktop.
+ ['.github/workflows/desktop-*.yml', DESKTOP],
+ // Release and CD workflows: they publish artifacts from master pushes,
+ // tags, or opt-in labels, and none of them is a required check on a pull
+ // request or in the merge queue. See addDeployLane.
+ ['.github/workflows/container-images-cd.yml', DEPLOY],
+ ['.github/workflows/cd-*-image.yml', DEPLOY],
+ ['.github/workflows/rust-docker-build.yml', DEPLOY],
+ ['.github/workflows/release-cli.yml', DEPLOY],
+ ['.github/workflows/publish-hogli.yml', DEPLOY],
+ // Also read by rust-compute-affected in ci-rust and ci-nodejs, so it takes
+ // the rust lanes on top of deploy: those PR checks parse it, even though
+ // only the image builds act on what it maps.
+ ['.github/rust-images.yml', [RUST, DEPLOY]],
+ // The hogbox preview environment gates no check, and its deploys read the
+ // hogbox tooling, which owns a lane already.
+ ['.github/workflows/hogbox-preview-env.yml', HOGBOX_PREVIEW],
+ ['.github/workflows/hogbox-preview-cleanup.yml', HOGBOX_PREVIEW],
+ // CI scripts held to the workflows that run them: the backend test-timing
+ // pair and the IDOR coverage check run only in ci-backend and its timing
+ // workflow, while report_test_timings is read by the backend, frontend,
+ // and nodejs workflows alike.
+ ['.github/scripts/optimize_test_durations.py', PYTHON],
+ ['.github/scripts/test_optimize_test_durations.py', PYTHON],
+ ['.github/scripts/check-idor-model-coverage.py', PYTHON],
+ ['.github/scripts/report_test_timings.py', FULLSTACK],
+ ['.github/scripts/test_report_test_timings.py', FULLSTACK],
+ // Bot, report, sync, and canary workflows. None is a required check; each
+ // failure costs a bot action, a Slack post, or a canary signal. Their
+ // scripts and config sit on the same lane further down.
+ ['.github/workflows/auto-assign-labels.yml', REPO_AUTOMATION],
+ ['.github/workflows/auto-assign-reviewers.yml', REPO_AUTOMATION],
+ ['.github/workflows/browserslist.yml', REPO_AUTOMATION],
+ ['.github/workflows/canary-flags-enable.yml', REPO_AUTOMATION],
+ ['.github/workflows/ci-alerts-devex.yml', REPO_AUTOMATION],
+ ['.github/workflows/ci-geoip-canary.yml', REPO_AUTOMATION],
+ ['.github/workflows/ci-master-run-traces.yml', REPO_AUTOMATION],
+ ['.github/workflows/eng-analytics-weekly-digest.yml', REPO_AUTOMATION],
+ ['.github/workflows/foss-sync.yml', REPO_AUTOMATION],
+ ['.github/workflows/inkeep-agent.yml', REPO_AUTOMATION],
+ ['.github/workflows/monitor-github-rate-limit.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-autoresolve-conflicts.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-cleanup.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-closed.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-opened.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-posthog-js-reviewer.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-priority-review.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-resolve-outdated-bot-comments.yml', REPO_AUTOMATION],
+ ['.github/workflows/pr-updated.yml', REPO_AUTOMATION],
+ ['.github/workflows/private-sync.yml', REPO_AUTOMATION],
+ ['.github/workflows/review-hog.yml', REPO_AUTOMATION],
+ ['.github/workflows/stale.yaml', REPO_AUTOMATION],
+ ['.github/workflows/test-quarantine.yml', REPO_AUTOMATION],
+ ['.github/workflows/update-ai-costs.yml', REPO_AUTOMATION],
+ ['.github/workflows/update-bot-ips.yml', REPO_AUTOMATION],
+ ['.github/workflows/weekly-flaky-report.yml', REPO_AUTOMATION],
+ ['.github/workflows/weekly-slow-tests-report.yml', REPO_AUTOMATION],
+ // More single-suite workflows, held to the trees their suites read: the AI
+ // evals, replay-vision evals, and ClickHouse HCL checks are Python; the
+ // hogql parser builds wheels (python), an npm package (both families), and
+ // a crate (rust); deltalite spans its crates and the wheel's python
+ // consumers.
+ ['.github/workflows/ci-ai.yml', PYTHON],
+ ['.github/workflows/ci-replay-vision-evals.yml', PYTHON],
+ ['.github/workflows/ci-clickhouse-hcl-schema.yml', PYTHON],
+ ['.github/workflows/build-hogql-parser.yml', PYTHON],
+ ['.github/workflows/build-hogql-parser-npm.yml', FULLSTACK],
+ ['.github/workflows/build-hogql-parser-rs.yml', RUST],
+ ['.github/workflows/rust-smoke-test-build.yml', RUST],
+ ['.github/workflows/publish-replay-anonymizer-crate.yml', RUST],
+ ['.github/workflows/build-deltalite.yml', [RUST, PYTHON]],
+ ['.github/workflows/ci-deltalite-python.yml', [RUST, PYTHON]],
+ // Standalone trees whose suites already own a lane.
+ ['.github/workflows/build-livestream-tui.yml', 'livestream-suite'],
+ ['.github/workflows/ci-livestream.yml', 'livestream-suite'],
+ ['.github/workflows/ci-livestream-tui.yml', 'livestream-suite'],
+ ['.github/workflows/livestream-docker-image.yml', 'livestream-suite'],
+ ['.github/workflows/build-phrocs.yml', 'phrocs-suite'],
+ ['.github/workflows/ci-phrocs.yml', 'phrocs-suite'],
+ ['.github/workflows/terragrunt-posthog.yaml', 'terraform-suite'],
+ ['.github/workflows/build-hobby-installer.yml', HOBBY],
+ ['.github/workflows/ci-integration-service.yml', 'service:integration-service'],
+ ['.github/workflows/ci-openapi-codegen.yml', PRODUCT_SURFACE],
+ // Publish and CD workflows found after the first deploy pass.
+ ['.github/workflows/llm-gateway-cd.yml', DEPLOY],
+ ['.github/workflows/publish-quill-npm.yml', DEPLOY],
+ ['.github/workflows/publish-symbol-data-crate.yml', DEPLOY],
+ ['.github/workflows/clickhouse-udfs.yml', DEPLOY],
+ // A scheduled mirror of the upstream Playwright image; no suite runs it.
+ ['.github/workflows/ci-playwright-container.yml', DEPLOY],
+ // The dev-environment checks: the flox boot check and the sandbox
+ // selftests, which are the only suites reading the dev-stack scripts.
+ ['.github/workflows/ci-dev-setup.yml', DEV_ENV],
+ ['.github/workflows/dev-sandbox-selftest.yml', DEV_ENV],
+ // The docs suites gate documentation PRs, which claim the prose lane.
+ // ci-docs-check is reusable but its one caller is the survey check, whose
+ // radius spans the frontend sources it compares against the docs.
+ ['.github/workflows/docs-preview-trigger.yml', PROSE_SUITE],
+ ['.github/workflows/ci-survey-sdk-check.yml', [JAVASCRIPT, PROSE_SUITE]],
+ ['.github/workflows/ci-docs-check.yml', [JAVASCRIPT, PROSE_SUITE]],
+ // Scripts and config on the automation lane above.
+ ['.github/scripts/assign-reviewers.js', REPO_AUTOMATION],
+ ['.github/scripts/assign-reviewers.test.js', REPO_AUTOMATION],
+ ['.github/scripts/codeowners.js', REPO_AUTOMATION],
+ ['.github/scripts/label-pr-from-title.js', REPO_AUTOMATION],
+ ['.github/scripts/label-pr-from-title.test.js', REPO_AUTOMATION],
+ ['.github/scripts/minimize-superseded-comments.mjs', REPO_AUTOMATION],
+ ['.github/scripts/autoresolve/**', REPO_AUTOMATION],
+ ['.github/scripts/monitor-github-rate-limit.js', REPO_AUTOMATION],
+ ['.github/scripts/monitor-github-rate-limit.test.js', REPO_AUTOMATION],
+ ['.github/scripts/weekly-*.mjs', REPO_AUTOMATION],
+ ['.github/scripts/eng-analytics-weekly-digest.mjs', REPO_AUTOMATION],
+ ['.github/scripts/ci-alerts-devex.js', REPO_AUTOMATION],
+ ['.github/scripts/ci-alerts-devex.test.js', REPO_AUTOMATION],
+ ['.github/scripts/ci_flake_overseer.py', REPO_AUTOMATION],
+ ['.github/scripts/test_ci_flake_overseer.py', REPO_AUTOMATION],
+ ['.github/scripts/compare-ci-runners.py', REPO_AUTOMATION],
+ ['.github/scripts/report_workflow_run_traces.py', REPO_AUTOMATION],
+ ['.github/scripts/test_report_workflow_run_traces.py', REPO_AUTOMATION],
+ ['.github/auto-assign-labels.json', REPO_AUTOMATION],
+ ['.github/dependabot.yml', REPO_AUTOMATION],
+ ['.github/renovate.json5', REPO_AUTOMATION],
+ // Scripts run only by ci-backend, ci-python, or ci-dagster.
+ ['.github/scripts/check-dagster-paths.py', PYTHON],
+ ['.github/scripts/test_check_dagster_paths.py', PYTHON],
+ ['.github/scripts/check-dwh-source-agnostic.py', PYTHON],
+ ['.github/scripts/check-operator-parity.py', PYTHON],
+ ['.github/scripts/check-version-specifiers.py', PYTHON],
+ ['.github/scripts/coverage_report.py', PYTHON],
+ ['.github/scripts/coverage_report.py.lock', PYTHON],
+ ['.github/scripts/test_coverage_report.py', PYTHON],
+ ['.github/scripts/list-removed-renamed-paths.sh', PYTHON],
+ ['.github/scripts/migration-deletion-allowlist.txt', PYTHON],
+ ['.github/scripts/signal-fanout', PYTHON],
+ ['.github/scripts/verify-new-snapshots.sh', PYTHON],
+ ['.github/scripts/post-ch-migration-section.mjs', PYTHON],
+ ['.github/scripts/post-django-migration-section.mjs', PYTHON],
+ ['.github/scripts/post-coverage-section.mjs', PYTHON],
+ ['.github/scripts/post-eval-section.mjs', PYTHON],
+ // CI-report sections and helpers owned by one suite each.
+ ['.github/scripts/post-playwright-section.mjs', FULLSTACK],
+ ['.github/scripts/verify-playwright-new-tests-and-snapshots.sh', FULLSTACK],
+ ['.github/scripts/post-snapshot-section.mjs', FULLSTACK],
+ ['.github/scripts/count-snapshot-changes.sh', FULLSTACK],
+ ['.github/scripts/fixtures/**', FULLSTACK],
+ ['.github/scripts/verify-storybook-new-stories.sh', JAVASCRIPT],
+ ['.github/scripts/post-hobby-section.mjs', HOBBY],
+ ['.github/scripts/desktop/**', DESKTOP],
+ ['.github/scripts/patch-cli-npm-installer.mjs', DEPLOY],
+ ['.github/scripts/patch-cli-npm-installer.test.mjs', DEPLOY],
+ ['.github/scripts/check-docs-links.js', PROSE_SUITE],
+ ['.github/scripts/trigger-vercel-preview.sh', PROSE_SUITE],
+ ['.github/scripts/post-docs-preview-section.mjs', PROSE_SUITE],
+ // Validates the AGENTS.md symlinks that the agents lane's build reads.
+ ['.github/scripts/check-agents-md-symlinks.sh', 'agents-lane'],
+ // Run only by the husky pre-commit hook, whose config already sits on the
+ // repo-config lane. No CI suite executes them.
+ ['.github/scripts/check-access-control-doc-sync.sh', 'repo-config-lane'],
+ ['.github/scripts/check-fixture-provenance.sh', 'repo-config-lane'],
+ ['.github/scripts/check-product-scaffold.sh', 'repo-config-lane'],
+ // Composite actions held to the workflows that use them. The setup and
+ // helper actions used across language families (pnpm-install, paths-filter,
+ // setup-sqlx-cli, setup-protoc, setup-sccache, docker-meta, semgrep-ci) and
+ // the lane-feeding rust-compute-affected stay on the blanket below.
+ ['.github/actions/build-n-cache-image/**', FULLSTACK],
+ ['.github/actions/commit-snapshots/**', FULLSTACK],
+ ['.github/actions/trunk-quarantine-gate/**', FULLSTACK],
+ ['.github/actions/setup-emsdk/**', FULLSTACK],
+ ['.github/actions/desktop-build-agent-release/**', DESKTOP],
+ ['.github/actions/desktop-restore-turbo-cache/**', DESKTOP],
+ ['.github/actions/setup-python-cached/**', PYTHON],
+ // Also used by ci-scripts.yml, which is universal, so the node lane is the
+ // only radius left to claim.
+ ['.github/actions/report-jest-timings/**', NODE],
+ ['.github/actions/get-pr-labels/**', APP_IMAGE],
+ ['.github/actions/wait-for-check/**', HOBBY],
+ // Problem matchers and coverage config registered only by the Python
+ // suites, and the ClickHouse version matrix the backend, dagster, and E2E
+ // suites test against.
+ ['.github/mypy-problem-matcher.json', PYTHON],
+ ['.github/ty-problem-matcher.json', PYTHON],
+ ['.github/openapi-problem-matcher.json', PYTHON],
+ ['.github/coverage-core.cfg', PYTHON],
+ ['.github/clickhouse-versions.json', FULLSTACK],
+ ['.github/dockerignore-drop-allowlist.txt', FULLSTACK],
+ // Issue templates render on github.com and compile into nothing.
+ ['.github/ISSUE_TEMPLATE/**', 'repo-config-lane'],
+ // Deployment templates with no in-repo reader; nothing tests them.
+ ['.github/pr-deploy/**', DEPLOY],
+ // Ownership data on the shared ownership lane (see OWNERSHIP): the
+ // CODEOWNERS the review bots read, and .github/'s own tree ownership.
+ ['.github/CODEOWNERS', OWNERSHIP],
+ ['.github/owners.yaml', OWNERSHIP],
+ // The vendored paths-filter action and its CI (see CI_TOOLING). The
+ // .depot/ shadow of the action follows through canonicalPath.
+ ['.github/actions/paths-filter/**', CI_TOOLING],
+ ['.github/workflows/ci-paths-filter.yml', CI_TOOLING],
+ // Feed turbo-discover's backend product selection, so they take the
+ // python lanes the same way the snob selector does.
+ ['.github/scripts/schema-impact.js', PYTHON],
+ ['.github/scripts/schema-impact.test.js', PYTHON],
+ ['.github/scripts/schema_usage_scan.py', PYTHON],
+ ['.github/scripts/test_schema_usage_scan.py', PYTHON],
+ // Reusable image builder called by the rust smoke build and the rust
+ // image CD (ci-frontend only names it in a comment), so it spans exactly
+ // those two radii.
+ ['.github/workflows/_rust-build-images.yml', [RUST, DEPLOY]],
// Lint rules that run repo-wide: a new rule fails code that merged in a
// parallel lane, which is the same conflict .oxlintrc.json is here for. The
@@ -355,6 +520,9 @@ const TRIPWIRE_RULES = [
['webpack.config.js', JAVASCRIPT],
['.oxlintrc.json', JAVASCRIPT],
['.oxfmtrc*', JAVASCRIPT],
+ // Prettier still formats the nodejs tree (ci-nodejs runs its check), so
+ // its ignore file is a JS toolchain setting like the two above.
+ ['.prettierignore', JAVASCRIPT],
['.nvmrc', JAVASCRIPT],
['postcss.config.js', JAVASCRIPT],
['.stylelintrc.js', JAVASCRIPT],
@@ -418,10 +586,21 @@ const TRIPWIRE_RULES = [
['hogli.yaml', UNIVERSAL],
['.github/**', UNIVERSAL],
['docker-compose*.yml', UNIVERSAL],
- ['Dockerfile*', UNIVERSAL],
- // Decides what lands in the build context of every image built from the
- // repository root, so it belongs with the Dockerfiles above.
- ['.dockerignore', UNIVERSAL],
+ // Single-purpose images ahead of the fallback: each is read by exactly one
+ // workflow or suite, whose rule above already carries the radius.
+ // Dockerfile.llm-analytics is built only by its master-push CD workflow,
+ // Dockerfile.ml-mirror-image-scrub only from nodejs/ sources, and the
+ // playwright and sandbox images host suites that run both language
+ // families. Everything else at the root, the unified app image included,
+ // backs E2E, hobby, and production, which is the app-image radius; no
+ // rust suite builds from a root Dockerfile. The build-context ignore file
+ // belongs with them.
+ ['Dockerfile.llm-analytics', DEPLOY],
+ ['Dockerfile.ml-mirror-image-scrub', NODE],
+ ['Dockerfile.playwright', FULLSTACK],
+ ['Dockerfile.sandbox', FULLSTACK],
+ ['Dockerfile*', APP_IMAGE],
+ ['.dockerignore', APP_IMAGE],
['proto/**', PROTO],
['frontend/src/queries/schema.json', PRODUCT_SURFACE],
['posthog/schema.py', PRODUCT_SURFACE],
@@ -443,27 +622,142 @@ const TRIPWIRE_RULES = [
// Generates the frontend API types from the backend serializers, so a
// change lands on both sides of the fe/py split at once.
['tools/openapi-codegen/**', PRODUCT_SURFACE],
- // Ownership data read by the backend, frontend, and script suites alike.
- // The root owners.yaml is the fallback every path resolves through when no
- // nearer file claims it, so it has the same readers as the tooling. A
- // product's own owners.yaml is not here: it keeps its product lane.
- ['tools/owners/**', UNIVERSAL],
- ['owners.yaml', UNIVERSAL],
- // Left universal: the quarantine list covers all three suites at once, and
- // playwright.quarantine.ts and replay-shared's jest.config.js read it
- // alongside pytest, so an entry for a flaky frontend test moves a
- // frontend lane.
- ['.test_quarantine.json', UNIVERSAL],
- // bin/ appears in the backend, frontend, and E2E path filters alike.
+ // The per-suite test-selection scripts at the root of tools/, ahead of the
+ // catch-all that widens anything else there. Each decides which of one
+ // suite's tests run on a PR, so an under-selection can only mask conflicts
+ // that suite's lanes already serialize: the snob shadow, its verdict, and
+ // the testmon fanout list select Django tests, the dagster selector its
+ // own suite, and the playwright pair the E2E specs.
+ ['tools/snob_backend_test_selection_shadow.py', PYTHON],
+ ['tools/test_snob_backend_test_selection_shadow.py', PYTHON],
+ ['tools/test_selection_verdict.py', PYTHON],
+ ['tools/test_test_selection_verdict.py', PYTHON],
+ ['tools/dagster_test_selection.py', PYTHON],
+ ['tools/test_dagster_test_selection.py', PYTHON],
+ ['tools/testmon_high_fanout_files.txt', PYTHON],
+ ['tools/playwright_spec_selection.py', FULLSTACK],
+ ['tools/test_playwright_spec_selection.py', FULLSTACK],
+ ['tools/playwright_area_map.json', FULLSTACK],
+ // The ownership data and its validation tooling share one lane. The root
+ // owners.yaml is the fallback every path resolves through when no nearer
+ // file claims it. A product's own owners.yaml is not here: it keeps its
+ // product lane.
+ ['tools/owners/**', OWNERSHIP],
+ ['owners.yaml', OWNERSHIP],
+ // The quarantine list covers the pytest, jest, and playwright suites at
+ // once, and turbo-discover reads it to drop products from the backend
+ // matrix. Every reader sits inside the two language families; no rust
+ // suite consumes it. A schema change and an entry in the old format meet
+ // in the same file, which git serializes as a textual conflict.
+ ['.test_quarantine.json', FULLSTACK],
+ // The hobby install scripts, ahead of the bin/ blanket. Only the hobby
+ // smoke test and the installer CI read them, and both workflows sit on the
+ // same lane above, so a hobby change and the workflow change that runs it
+ // stay serialized against each other and nothing else.
+ ['bin/hobby-installer/**', HOBBY],
+ ['bin/hobby-ci.py', HOBBY],
+ ['bin/hobby-ci-setup-user.py', HOBBY],
+ ['bin/deploy-hobby', HOBBY],
+ ['bin/upgrade-hobby', HOBBY],
+ ['bin/migrate-storage-hobby', HOBBY],
+ ['bin/migrate-session-recordings-hobby', HOBBY],
+ // Called by the hobby storage-migration scripts above, so it has to share
+ // their lane.
+ ['bin/migrate-minio-to-seaweedfs', HOBBY],
+ // Entrypoints and configuration the unified app image bakes in, plus the
+ // scripts docker-compose.base.yml runs as service commands. The image
+ // backs E2E, hobby, and production, which is the app-image radius. The
+ // exact-name rows precede the wildcard rows that would otherwise claim
+ // them for the dev stack.
+ ['bin/docker-server*', APP_IMAGE],
+ ['bin/docker-worker*', APP_IMAGE],
+ ['bin/docker-migrate', APP_IMAGE],
+ ['bin/migrate', APP_IMAGE],
+ ['bin/migrate-check', APP_IMAGE],
+ ['bin/celery-queues.env', APP_IMAGE],
+ ['bin/posthog-node', APP_IMAGE],
+ ['bin/temporal-django-worker', APP_IMAGE],
+ ['bin/granian_metrics.py', APP_IMAGE],
+ ['bin/unit_metrics.py', APP_IMAGE],
+ ['bin/start-backend', APP_IMAGE],
+ ['bin/start-frontend', APP_IMAGE],
+ // The schema and taxonomy codegen pipeline, which turns
+ // frontend/src/queries/schema.json into posthog/schema.py and the other
+ // generated artifacts both families read.
+ ['bin/build-*', PRODUCT_SURFACE],
+ ['bin/patch-schema-*', PRODUCT_SURFACE],
+ ['bin/split-schema-enums.py', PRODUCT_SURFACE],
+ // Scripts run only by the Python suites.
+ ['bin/check_uv_python_compatibility.py', PYTHON],
+ ['bin/find_python_dependencies.py', PYTHON],
+ ['bin/test/**', PYTHON],
+ ['bin/ruff.sh', PYTHON],
+ // Scripts run only by the frontend and storybook suites, plus the pnpm
+ // lifecycle hook package.json declares.
+ ['bin/find-affected-stories', JAVASCRIPT],
+ ['bin/find-affected-stories.test.mjs', JAVASCRIPT],
+ ['bin/frontend-exclude-filter', JAVASCRIPT],
+ ['bin/validate-setup-tasks.mjs', JAVASCRIPT],
+ ['bin/lint-feature-flag-sorting.mjs', JAVASCRIPT],
+ ['bin/fix-rdkafka-paths', JAVASCRIPT],
+ ['bin/create-notebook-node.sh', JAVASCRIPT],
+ // The Hog CLI backs the Hog suite, the jest-timing helpers feed
+ // report_test_timings, the dockerignore check runs in container-images-ci,
+ // and the sandbox scripts are baked into the sandbox image; all of those
+ // sit on the fullstack lanes already.
+ ['bin/hog', FULLSTACK],
+ ['bin/hoge', FULLSTACK],
+ ['bin/report-jest-timings', FULLSTACK],
+ ['bin/render-jest-timings-example', FULLSTACK],
+ ['bin/dockerignore-drop-check', FULLSTACK],
+ ['bin/sandbox*', FULLSTACK],
+ ['bin/sandbox-shims/**', FULLSTACK],
+ ['bin/generate_personhog_proto.sh', PROTO],
+ // Runs in the bot-IP update workflow on the automation lane.
+ ['bin/update-bots-list', REPO_AUTOMATION],
+ // The local development stack: process lists, launchers, readiness checks,
+ // storage upgrades, and developer helpers. Nothing in CI reads them except
+ // the dev-setup check and the sandbox selftests, which share the lane.
+ ['bin/mprocs*.yaml', DEV_ENV],
+ ['bin/e2e-test-runner', DEV_ENV],
+ ['bin/start', DEV_ENV],
+ ['bin/start-*', DEV_ENV],
+ ['bin/dev-*', DEV_ENV],
+ ['bin/check_*', DEV_ENV],
+ ['bin/clickhouse-*', DEV_ENV],
+ ['bin/docker-*', DEV_ENV],
+ ['bin/temporal-*', DEV_ENV],
+ ['bin/verify-*', DEV_ENV],
+ ['bin/upgrade-*', DEV_ENV],
+ ['bin/helpers/**', DEV_ENV],
+ ['bin/wait-for-postgres-tables', DEV_ENV],
+ ['bin/ensure-local-setup', DEV_ENV],
+ ['bin/dump_hogvmrs_stl', DEV_ENV],
+ ['bin/download-sentiment-model', DEV_ENV],
+ ['bin/inject_mcp_intents.py', DEV_ENV],
+ ['bin/install-hogli-completion', DEV_ENV],
+ ['bin/phw', DEV_ENV],
+ ['bin/posthog-worktree', DEV_ENV],
+ ['bin/rust-jumphost', DEV_ENV],
+ ['bin/send-dev-metrics.sh', DEV_ENV],
+ ['bin/setup-gateway-e2e', DEV_ENV],
+ ['bin/sync-storage', DEV_ENV],
+ ['bin/warm-flags-cache', DEV_ENV],
+ // bin/ appears in the backend, frontend, and E2E path filters alike, and
+ // what remains here is read across families: hogli and turbo drive the
+ // suites, bin/docker is the image entrypoint, and download-mmdb and the
+ // wait-for-docker pair run in backend, frontend, nodejs, and rust CI.
['bin/**', UNIVERSAL],
- ['patches/**', UNIVERSAL],
- // Holds the Depot-runner copies of the workflows and composite actions in
- // .github/, so it decides what runs for everyone the same way.
- ['.depot/**', UNIVERSAL],
+ // pnpm patches resolve inside the JS workspace the same way pnpm-lock.yaml
+ // does, and the python suites never execute the patched packages.
+ ['patches/**', JAVASCRIPT],
// Names the Depot project every container build and runner is billed and
- // cached against. rust/depot.json is deliberately not here: it configures
- // builds of that workspace only, and the rust rules below hold it to them.
- ['depot.json', UNIVERSAL],
+ // cached against, which is infrastructure routing rather than anything a
+ // suite reads: a wrong project fails its own PR's builds alone, never
+ // jointly with another PR. rust/depot.json is deliberately not here: it
+ // configures builds of that workspace only, and the rust rules below hold
+ // it to them.
+ ['depot.json', 'repo-config-lane'],
// The toolchain every suite runs inside. ci-python.yml gates on
// .flox/env/manifest.toml for that reason.
['.flox/**', UNIVERSAL],
@@ -569,6 +863,10 @@ const REPO_CONFIG_DIRS = [
'.interface-design',
'.posthog-code',
'.run',
+ // Configures the local Trunk CLI only (merge / status / cancel); linting
+ // is deliberately disabled there. The queue's own behavior lives
+ // server-side and in the lane rules, which stay universal.
+ '.trunk',
'.vscode',
'.zed',
]
@@ -620,11 +918,24 @@ function globToRegExp(glob) {
const TRIPWIRE_MATCHERS = TRIPWIRE_RULES.map(([glob, domain]) => [globToRegExp(glob), domain])
+// .depot/ holds Depot-runner shadows of the workflows and composite actions in
+// .github/, kept apples-to-apples with their canonicals by the shadow-drift
+// check, and their statuses are non-blocking. A shadow can only affect what
+// its canonical affects, so it resolves through the canonical's rules: the
+// ci-backend shadow takes the python lanes, and a shadow of something unplaced
+// still lands on the .github/** blanket.
+const DEPOT_MIRROR_PREFIX = '.depot/'
+
+function canonicalPath(file) {
+ return file.startsWith(DEPOT_MIRROR_PREFIX) ? `.github/${file.slice(DEPOT_MIRROR_PREFIX.length)}` : file
+}
+
// The domain of the first rule matching the file, or null when no rule claims
// it and when a rule claims it as an explicit non-tripwire. Both mean the same
// thing to every caller: the file falls through to the ordinary rules.
function tripwireDomain(file) {
- const matched = TRIPWIRE_MATCHERS.find(([re]) => re.test(file))
+ const resolved = canonicalPath(file)
+ const matched = TRIPWIRE_MATCHERS.find(([re]) => re.test(resolved))
return matched ? matched[1] : null
}
@@ -1206,7 +1517,18 @@ function allKnownTargets(context) {
if (!rustInventory || !services) {
return null
}
- const targets = new Set(['py:core', 'fe:core', 'node:ingestion', 'agents'])
+ const targets = new Set([
+ 'py:core',
+ 'fe:core',
+ 'node:ingestion',
+ 'agents',
+ 'deploy',
+ 'hobby',
+ 'repo-automation',
+ 'dev-env',
+ 'ownership',
+ 'ci-tooling',
+ ])
for (const product of products) {
targets.add(pyProduct(product))
targets.add(feProduct(product))
@@ -1305,18 +1627,6 @@ function addProductSurfaceLanes(targets, context) {
return true
}
-// The two lanes of the backend-detached desktop product. Returns false when
-// no such product directory exists, so a rename widens instead of claiming a
-// lane no file can land on.
-function addDesktopLanes(targets, context) {
- if (!context.products.includes('desktop')) {
- return false
- }
- targets.add(pyProduct('desktop'))
- targets.add(feProduct('desktop'))
- return true
-}
-
function addRustLanes(targets, context) {
if (!context.rustInventory) {
return false
@@ -1344,6 +1654,80 @@ function addNodeLanes(targets) {
return true
}
+function addFullstackLanes(targets, context) {
+ return addPythonLanes(targets, context) && addJavaScriptLanes(targets, context)
+}
+
+// Release and CD workflows publish artifacts from master pushes, tags, or
+// opt-in labels. No required pull-request or merge-queue check runs them, so a
+// conflict between one of them and any other PR is not a combination the queue
+// can test, and serializing the two buys no coverage. One shared lane, on the
+// same reasoning as repo-config.
+function addDeployLane(targets) {
+ targets.add('deploy')
+ return true
+}
+
+function addHobbyLane(targets) {
+ targets.add('hobby')
+ return true
+}
+
+function addHogboxPreviewLane(targets) {
+ targets.add('tools:hogbox-preview')
+ return true
+}
+
+function addCliArtifactLanes(targets) {
+ targets.add('cli')
+ targets.add('svc:mcp')
+ return true
+}
+
+// The desktop-* workflows build and test only products/desktop, so their
+// radius is that product's two lanes. The guard widens when the product is
+// gone, because the lanes would then name targets no other PR can claim.
+function addDesktopLanes(targets, context) {
+ if (!context.products.includes('desktop')) {
+ return false
+ }
+ targets.add(pyProduct('desktop'))
+ targets.add(feProduct('desktop'))
+ return true
+}
+
+// A workflow that defines one service's suite can be held to that service's
+// lane. The guard widens when the directory no longer exists, so a renamed
+// service does not leave its workflow claiming a lane no other PR can reach.
+function addServiceSuiteLane(service) {
+ return (targets, context) => {
+ if (!context.services || !context.services.includes(service)) {
+ return false
+ }
+ targets.add(`svc:${service}`)
+ return true
+ }
+}
+
+// A domain whose lanes are a fixed list of always-known targets. Only for
+// targets allKnownTargets carries unconditionally (the static base set,
+// STANDALONE_TREES values, and TOOLS_INDEPENDENT); a dynamic target needs a
+// guarded function like the service one above.
+function laneOf(...targetNames) {
+ return (targets) => {
+ for (const name of targetNames) {
+ targets.add(name)
+ }
+ return true
+ }
+}
+
+function addAppImageLanes(targets, context) {
+ targets.add('hobby')
+ targets.add('deploy')
+ return addFullstackLanes(targets, context)
+}
+
// Each proto tree and the consumers that generate from it. proto/README.md's
// consumer table is the source, and the generated code is the check on it: a
// consumer that read a proto without committing stubs would be reading nothing.
@@ -1375,13 +1759,16 @@ const PROTO_TREES = new Map([
])
// A file directly under proto/ is treated as impacting all trees, since it's not
-// scoped to a single proto subdirectory. A subdirectory the table does not name
-// has unknown consumers and widens, which is what makes adding a tree without
-// declaring it here safe rather than silent.
+// scoped to a single proto subdirectory, and so is a file outside proto/
+// entirely (the Proto CI workflow reaches this domain that way). A subdirectory
+// the table does not name has unknown consumers and widens, which is what makes
+// adding a tree without declaring it here safe rather than silent.
function addProtoLanes(targets, context, file) {
const segments = file.split('/')
const trees =
- segments.length === 2 ? [...PROTO_TREES.keys()] : [segments[1]].filter((tree) => PROTO_TREES.has(tree))
+ segments[0] !== 'proto' || segments.length === 2
+ ? [...PROTO_TREES.keys()]
+ : [segments[1]].filter((tree) => PROTO_TREES.has(tree))
if (trees.length === 0 || !context.rustInventory) {
return false
}
@@ -1415,47 +1802,40 @@ const DOMAIN_LANES = new Map([
[NODE, addNodeLanes],
[PRODUCT_SURFACE, addProductSurfaceLanes],
[PROTO, addProtoLanes],
+ [FULLSTACK, addFullstackLanes],
+ [DEPLOY, addDeployLane],
+ [HOBBY, addHobbyLane],
+ [HOGBOX_PREVIEW, addHogboxPreviewLane],
+ [CLI_ARTIFACTS, addCliArtifactLanes],
[DESKTOP, addDesktopLanes],
+ [REPO_AUTOMATION, laneOf('repo-automation')],
+ [DEV_ENV, laneOf('dev-env')],
+ [OWNERSHIP, laneOf('ownership')],
+ [CI_TOOLING, laneOf('ci-tooling')],
+ [APP_IMAGE, addAppImageLanes],
+ [PROSE_SUITE, laneOf('prose')],
+ ['livestream-suite', laneOf('livestream')],
+ ['phrocs-suite', laneOf('tools:phrocs')],
+ ['terraform-suite', laneOf('terraform')],
+ ['repo-config-lane', laneOf('repo-config')],
+ ['agents-lane', laneOf('agents')],
])
-
-// The explicit-lanes rule form: a workflow whose radius is a standalone tree
-// takes that tree's own lane names rather than a language family. Every named
-// lane has to be one the context can enumerate — a lane missing from
-// allKnownTargets would make this rule disjoint from a widened PR, which is
-// the one failure mode that silently breaks master — so an unknown name (a
-// typo, or a tree that was renamed out from under the rule) widens instead.
-function addExplicitLanes(lanes, targets, context) {
- const known = allKnownTargets(context)
- if (!known) {
- return false
- }
- for (const lane of lanes) {
- if (!known.includes(lane)) {
- console.error(`Unknown lane ${lane} in an explicit-lanes rule; widening until the rule is updated`)
- return false
- }
- targets.add(lane)
- }
- return true
+for (const service of ['llm-gateway', 'oauth-proxy', 'agent-proxy', 'integration-service']) {
+ DOMAIN_LANES.set(`service:${service}`, addServiceSuiteLane(service))
}
// Returns false when the file's domain is universal, which is the caller's cue
// to abandon the per-file accumulation and report the whole set. A rule may
-// hold a list of members for a file whose radius spans more than one family,
-// the same composition RUST_NON_CRATE_RULES and PROTO_TREES use; the list is
-// applied in union, and widens if any member cannot name its lanes in full.
-// Each member is a domain, or {lanes: [...]} naming explicit standalone
-// lanes; a bare {lanes: [...]} rule is the one-member form of the same thing.
+// carry a list of domains for a file read on both sides of a split; the file
+// claims every listed domain's lanes, and one that cannot enumerate widens the
+// whole set as it would alone.
function applyTripwireDomain(domain, file, targets, context) {
+ if (Array.isArray(domain)) {
+ return domain.every((entry) => applyTripwireDomain(entry, file, targets, context))
+ }
const resolved = domain === SEMGREP ? (context.semgrepDomains || new Map()).get(file) || UNIVERSAL : domain
- const members = Array.isArray(resolved) ? resolved : [resolved]
- return members.every((member) => {
- if (member && typeof member === 'object') {
- return addExplicitLanes(member.lanes, targets, context)
- }
- const addLanes = DOMAIN_LANES.get(member)
- return addLanes ? addLanes(targets, context, file) : false
- })
+ const addLanes = DOMAIN_LANES.get(resolved)
+ return addLanes ? addLanes(targets, context, file) : false
}
// Paths under rust/ that belong to no crate, and the domains that read them. A
@@ -1961,6 +2341,12 @@ module.exports = {
parseRustAffectedCrates,
ALL,
CARGO_LOCK,
+ CLI_ARTIFACTS,
+ DEPLOY,
+ DESKTOP,
+ FULLSTACK,
+ HOBBY,
+ HOGBOX_PREVIEW,
JAVASCRIPT,
NATIVE_BINDING_CONSUMER_LANES,
NODE,
diff --git a/.github/scripts/trunk-impacted-targets.test.js b/.github/scripts/trunk-impacted-targets.test.js
index 30ee027e3bb7..3fe92cce8c57 100644
--- a/.github/scripts/trunk-impacted-targets.test.js
+++ b/.github/scripts/trunk-impacted-targets.test.js
@@ -134,20 +134,22 @@ const WORKSPACE_CONTEXT = {
// runs against.
test('a universal tripwire claims every known target', () => {
const tripwireFiles = [
- 'bin/start',
- // Read by pytest, jest, and playwright alike, so no one domain holds it.
- '.test_quarantine.json',
+ // Runs in backend, frontend, nodejs, and rust CI alike.
+ 'bin/download-mmdb',
+ // The stack every suite tests against, the rust integration suites
+ // included.
+ 'docker-compose.base.yml',
// Trees that steer what every suite runs or what it runs against: the
- // Depot copies of the composite actions, the toolchain, the service
- // configs the stack mounts, and the markdownlint config every tree's
- // prose obeys.
- '.depot/actions/paths-filter/action.yml',
+ // Depot shadow of an action every workflow uses, the toolchain, the
+ // service configs the stack mounts, and the markdownlint config every
+ // tree's prose obeys.
+ '.depot/actions/pnpm-install/action.yml',
'.flox/env/manifest.toml',
'docker/clickhouse/config.d/default.xml',
'devenv/duckgres.yaml',
'.config/.markdownlint-cli2.jsonc',
// A workflow nobody has placed in a domain keeps the old radius.
- '.github/workflows/ci-e2e-playwright.yml',
+ '.github/workflows/ci-security.yaml',
]
for (const file of tripwireFiles) {
assert.equal(isTripwire(file), true, `${file} should be a tripwire`)
@@ -461,20 +463,87 @@ test('single-language root configuration claims that language', () => {
// suite runs on. The narrowing above stops here: these keep the full set, but
// by decision rather than for want of a rule.
test('stack and image configuration at the root stays universal', () => {
+ for (const file of ['.env.development', '.env.services', '.envrc', 'otel-collector-config.dev.yaml']) {
+ assert.equal(tripwireDomain(file), UNIVERSAL, file)
+ assert.deepEqual(computeTargets([file], CONTEXT), EVERYTHING, file)
+ }
+})
+
+// No suite's outcome depends on ownership data jointly with a second PR: the
+// root owners.yaml is a fallback, so nothing can become unowned, and the other
+// readers are review-routing bots. Two ownership edits still serialize against
+// each other on the shared lane.
+test('ownership data shares one lane instead of every lane', () => {
for (const file of [
- '.env.development',
- '.env.services',
- '.envrc',
- '.dockerignore',
- 'depot.json',
'owners.yaml',
- 'otel-collector-config.dev.yaml',
+ 'tools/owners/posthog_owners/matcher.py',
+ '.github/CODEOWNERS',
+ '.github/owners.yaml',
]) {
- assert.equal(tripwireDomain(file), UNIVERSAL, file)
- assert.deepEqual(computeTargets([file], CONTEXT), EVERYTHING, file)
+ assert.deepEqual(computeTargets([file], CONTEXT), ['ownership'], file)
+ }
+ // A product's own ownership file keeps its product lane.
+ assert.notDeepEqual(computeTargets(['products/alpha/owners.yaml'], CONTEXT), ['ownership'])
+})
+
+// Every quarantine reader (pytest, jest, playwright, and turbo-discover's
+// product-skip input) sits inside the two language families; no rust suite
+// consumes the list, so a flaky-test quarantine no longer serializes rust PRs.
+test('the quarantine list claims the fullstack lanes and no rust crate', () => {
+ const targets = computeTargets(['.test_quarantine.json'], CONTEXT)
+ assert.equal(targets.includes('py:core'), true)
+ assert.equal(targets.includes('fe:core'), true)
+ assert.equal(
+ targets.some((target) => target.startsWith('rust:crate:')),
+ false
+ )
+ assert.notDeepEqual(targets, EVERYTHING)
+})
+
+// paths-filter decides which jobs run inside a single run's own diff, so no
+// run's outcome depends on it jointly with another queue entry. Its own CI and
+// its .depot shadow share the lane.
+test('the paths-filter action and its CI share the ci-tooling lane', () => {
+ for (const file of [
+ '.github/actions/paths-filter/src/filter.ts',
+ '.github/actions/paths-filter/dist/index.js',
+ '.github/workflows/ci-paths-filter.yml',
+ '.depot/actions/paths-filter/src/filter.ts',
+ ]) {
+ assert.deepEqual(computeTargets([file], CONTEXT), ['ci-tooling'], file)
+ }
+})
+
+// pnpm patches resolve inside the JS workspace the way pnpm-lock.yaml does,
+// and depot.json is billing and cache routing that fails its own PR's builds
+// alone.
+test('pnpm patches take the JS lanes and depot.json the repo-config lane', () => {
+ assert.deepEqual(computeTargets(['patches/[email protected]'], CONTEXT), computeTargets(['.oxlintrc.json'], CONTEXT))
+ assert.deepEqual(computeTargets(['depot.json'], CONTEXT), ['repo-config'])
+})
+
+// The schema-impact pair feeds turbo-discover's backend product selection, the
+// same radius the snob selector holds.
+test('the schema selection scripts claim the python lanes', () => {
+ for (const file of ['.github/scripts/schema-impact.js', '.github/scripts/schema_usage_scan.py']) {
+ assert.deepEqual(computeTargets([file], CONTEXT), computeTargets(['mypy.ini'], CONTEXT), file)
+ }
+})
+
+// Called by the rust smoke build and the rust image CD; the image map is also
+// parsed by rust-compute-affected in the rust and nodejs PR checks.
+test('the rust image builder and image map span rust plus deploy', () => {
+ for (const file of ['.github/workflows/_rust-build-images.yml', '.github/rust-images.yml']) {
+ const targets = computeTargets([file], CONTEXT)
+ assert.equal(targets.includes('deploy'), true, file)
+ assert.equal(
+ targets.some((target) => target.startsWith('rust:crate:')),
+ true,
+ file
+ )
+ assert.equal(targets.includes('fe:core'), false, file)
+ assert.equal(targets.includes('py:core'), false, file)
}
- // A product's own ownership file is not the root one and keeps its lane.
- assert.notDeepEqual(computeTargets(['products/alpha/owners.yaml'], CONTEXT), EVERYTHING)
})
// cargo-dist packages the CLI, which ci-cli.yml builds from services/mcp
@@ -484,139 +553,269 @@ test('the cargo-dist manifest shares the cli lane', () => {
})
test('a single-language workflow claims that language rather than everything', () => {
- const javascript = computeTargets(['.oxlintrc.json'], CONTEXT)
- for (const workflow of [
- 'ci-frontend.yml',
- 'ci-mcp-ui-apps.yml',
- 'ci-docs-check.yml',
- 'browserslist.yml',
- 'publish-quill-npm.yml',
- 'update-ai-costs.yml',
- 'ci-playwright-container.yml',
+ assert.deepEqual(
+ computeTargets(['.github/workflows/ci-frontend.yml'], CONTEXT),
+ computeTargets(['.oxlintrc.json'], CONTEXT)
+ )
+ for (const file of [
+ '.github/workflows/ci-backend.yml',
+ '.github/workflows/ci-python.yml',
+ '.github/workflows/ci-clickhouse-multinode-migrations.yml',
+ // The backend test-timing pair and the IDOR coverage check run only in
+ // ci-backend and its timing workflow.
+ '.github/scripts/optimize_test_durations.py',
+ '.github/scripts/test_optimize_test_durations.py',
+ '.github/scripts/check-idor-model-coverage.py',
]) {
- assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), javascript, workflow)
+ assert.deepEqual(computeTargets([file], CONTEXT), computeTargets(['mypy.ini'], CONTEXT), file)
}
- const python = computeTargets(['mypy.ini'], CONTEXT)
- for (const workflow of [
- 'ci-backend.yml',
- 'ci-python.yml',
- 'ci-ai.yml',
- 'ci-replay-vision-evals.yml',
- 'ci-clickhouse-hcl-schema.yml',
- 'ci-clickhouse-multinode-migrations.yml',
- 'build-hogql-parser.yml',
- 'publish-hogli.yml',
+})
+
+// Suites that run the backend and the frontend together used to widen to every
+// lane, which serialized them against rust and the standalone trees no E2E or
+// image build can touch.
+test('a full-stack suite claims both language families and no rust crate', () => {
+ for (const file of [
+ '.github/workflows/ci-e2e-playwright.yml',
+ '.github/workflows/ci-hog.yml',
+ '.github/workflows/container-images-ci.yml',
+ '.github/workflows/cd-sandbox-base-image.yml',
+ '.github/workflows/ci-recording-rasterizer-container.yml',
+ '.github/scripts/report_test_timings.py',
+ 'Dockerfile.playwright',
+ 'Dockerfile.sandbox',
]) {
- assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), python, workflow)
+ const targets = computeTargets([file], CONTEXT)
+ for (const target of ['py:core', 'py:product:alpha', 'fe:core', 'node:ingestion', 'svc:mcp']) {
+ assert.equal(targets.includes(target), true, `${target} (from ${file})`)
+ }
+ assert.equal(
+ targets.some((target) => target.startsWith('rust:crate:')),
+ false,
+ file
+ )
+ assert.notDeepEqual(targets, EVERYTHING, file)
}
- const rust = computeTargets(['.github/workflows/ci-rust.yml'], CONTEXT)
- for (const workflow of [
- 'rust-docker-build.yml',
- 'rust-smoke-test-build.yml',
- '_rust-build-images.yml',
- 'publish-replay-anonymizer-crate.yml',
- 'publish-symbol-data-crate.yml',
+})
+
+// No required pull-request or merge-queue check runs a release or CD workflow,
+// so no queue combination tests it either way and one shared lane is the
+// honest radius.
+test('release and CD workflows share the deploy lane', () => {
+ for (const file of [
+ '.github/workflows/container-images-cd.yml',
+ '.github/workflows/cd-mcp-image.yml',
+ '.github/workflows/rust-docker-build.yml',
+ '.github/workflows/release-cli.yml',
+ '.github/workflows/publish-hogli.yml',
+ 'Dockerfile.llm-analytics',
]) {
- assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), rust, workflow)
+ assert.deepEqual(computeTargets([file], CONTEXT), ['deploy'], file)
}
- // The workflow gating tools/openapi-codegen takes the tree's own domain.
- assert.deepEqual(
- computeTargets(['.github/workflows/ci-openapi-codegen.yml'], CONTEXT),
- computeTargets(['tools/openapi-codegen/package.json'], CONTEXT)
- )
- // Workflows serving a standalone tree take that tree's own lanes. The
- // equality against a file in the tree also guards the lane names: a
- // typo'd lane widens the workflow to everything and fails here.
- for (const [workflow, treeFile] of [
- ['ci-cli.yml', 'cli/src/main.rs'],
- ['release-cli.yml', 'cli/src/main.rs'],
- ['ci-livestream.yml', 'livestream/main.go'],
- ['ci-livestream-tui.yml', 'livestream/tui/main.go'],
- ['build-livestream-tui.yml', 'livestream/tui/main.go'],
- ['livestream-docker-image.yml', 'livestream/Dockerfile'],
- ['terragrunt-posthog.yaml', 'terraform/team-devex/main.tf'],
- ['ci-phrocs.yml', 'tools/phrocs/main.go'],
- ['build-phrocs.yml', 'tools/phrocs/Makefile'],
- ['hogbox-preview-cleanup.yml', 'tools/hogbox-preview/cli.py'],
- ['release.yml', 'cli/src/main.rs'],
+})
+
+// The hobby smoke test is the only suite that reads the install scripts, so
+// the scripts and the two workflows that run them have to share one lane: a
+// script change and the workflow change that runs it must not merge in
+// parallel.
+test('the hobby scripts and their smoke test share one lane', () => {
+ for (const file of [
+ '.github/workflows/ci-hobby.yml',
+ '.github/workflows/ci-hobby-installer.yml',
+ 'bin/hobby-installer/go.mod',
+ 'bin/hobby-ci.py',
+ 'bin/deploy-hobby',
]) {
- assert.deepEqual(
- computeTargets([`.github/workflows/${workflow}`], CONTEXT),
- computeTargets([treeFile], CONTEXT),
- workflow
- )
+ assert.deepEqual(computeTargets([file], CONTEXT), ['hobby'], file)
}
- // Service workflows take their service's lane. The base CONTEXT lists
- // only two services, so the universe here has to know the real ones.
- const serviceContext = {
- ...CONTEXT,
- products: [...CONTEXT.products, 'metrics'],
- services: [...CONTEXT.services, 'agent-proxy', 'integration-service', 'llm-gateway'],
+ // A bin file read across language families keeps the old radius.
+ assert.deepEqual(computeTargets(['bin/download-mmdb'], CONTEXT), EVERYTHING)
+})
+
+// The bot, report, and sync workflows gate no required check, so a break costs
+// a bot action rather than a merge. Each one shares the lane with the script
+// and config it runs, which is the pair that has to stay serialized.
+test('automation workflows share one lane with their scripts and config', () => {
+ for (const file of [
+ '.github/workflows/auto-assign-reviewers.yml',
+ '.github/scripts/assign-reviewers.js',
+ '.github/workflows/weekly-flaky-report.yml',
+ '.github/scripts/weekly-flaky-report.mjs',
+ '.github/scripts/weekly-report-common.mjs',
+ '.github/auto-assign-labels.json',
+ '.github/renovate.json5',
+ '.github/workflows/stale.yaml',
+ ]) {
+ assert.deepEqual(computeTargets([file], CONTEXT), ['repo-automation'], file)
}
- for (const [workflow, treeFile] of [
- ['ci-llm-gateway.yml', 'services/llm-gateway/src/main.py'],
- ['llm-gateway-cd.yml', 'services/llm-gateway/src/main.py'],
- ['ci-agent-proxy.yml', 'services/agent-proxy/src/index.ts'],
- ['cd-agent-proxy-image.yml', 'services/agent-proxy/src/index.ts'],
- ['ci-integration-service.yml', 'services/integration-service/src/index.ts'],
- ['cd-integration-service-image.yml', 'services/integration-service/src/index.ts'],
- ['ci-oauth-proxy.yml', 'services/oauth-proxy/src/index.ts'],
- ['ci-ml-mirror-image-scrub-container.yml', 'nodejs/src/index.ts'],
+})
+
+// The dev stack is exercised only by the dev-setup check and the sandbox
+// selftests, so its process lists, launchers, and helpers share one lane with
+// those workflows instead of serializing the whole queue.
+test('the dev stack and its selftests share the dev-env lane', () => {
+ for (const file of [
+ '.github/workflows/ci-dev-setup.yml',
+ '.github/workflows/dev-sandbox-selftest.yml',
+ 'bin/mprocs.yaml',
+ 'bin/start',
+ 'bin/start-rust-service',
+ 'bin/dev-sandbox',
+ 'bin/check_hosts',
+ 'bin/docker-dev',
+ 'bin/helpers/_utils.sh',
]) {
- assert.deepEqual(
- computeTargets([`.github/workflows/${workflow}`], serviceContext),
- computeTargets([treeFile], serviceContext),
- workflow
+ assert.deepEqual(computeTargets([file], CONTEXT), ['dev-env'], file)
+ }
+})
+
+// The unified app image backs E2E, hobby, and production, so its baked-in
+// entrypoints claim all three radii and stay clear of the rust crates.
+test('app-image entrypoints claim the fullstack, hobby, and deploy lanes', () => {
+ for (const file of [
+ 'bin/docker-server',
+ 'bin/migrate',
+ 'bin/celery-queues.env',
+ 'bin/start-backend',
+ 'Dockerfile',
+ 'Dockerfile.node',
+ '.dockerignore',
+ ]) {
+ const targets = computeTargets([file], CONTEXT)
+ for (const target of ['py:core', 'fe:core', 'node:ingestion', 'hobby', 'deploy']) {
+ assert.equal(targets.includes(target), true, `${target} (from ${file})`)
+ }
+ assert.equal(
+ targets.some((target) => target.startsWith('rust:crate:')),
+ false,
+ file
)
}
- assert.deepEqual(computeTargets(['.github/workflows/cd-metrics-agent-image.yml'], serviceContext), [
- 'fe:product:metrics',
- 'py:product:metrics',
- ])
- // The MCP image's readers are the product-surface set, same as the
- // openapi-codegen workflow.
+})
+
+// A docs-check change has to overlap the docs PRs it can break against, which
+// claim the prose lane.
+test('docs suites and their scripts claim the prose lane', () => {
+ for (const file of ['.github/workflows/docs-preview-trigger.yml', '.github/scripts/check-docs-links.js']) {
+ assert.deepEqual(computeTargets([file], CONTEXT), ['prose'], file)
+ }
+ // The survey check compares docs against frontend sources, so it spans
+ // both.
+ const survey = computeTargets(['.github/workflows/ci-survey-sdk-check.yml'], CONTEXT)
+ assert.equal(survey.includes('prose'), true)
+ assert.equal(survey.includes('fe:core'), true)
+ assert.equal(survey.includes('py:core'), false)
+})
+
+// A rule may list several domains for a file read on both sides of a split;
+// the file claims every listed domain's lanes.
+test('a multi-domain rule claims the union of its domains', () => {
+ const deltalite = computeTargets(['.github/workflows/ci-deltalite-python.yml'], CONTEXT)
+ assert.equal(deltalite.includes('py:core'), true)
+ assert.equal(
+ deltalite.some((target) => target.startsWith('rust:crate:')),
+ true
+ )
+ assert.equal(deltalite.includes('fe:core'), false)
+ // The separation gate path-filters Django, sqlx, and nodejs migrations, so
+ // it spans all three families and matches what the same change spelled as
+ // files would claim.
assert.deepEqual(
- computeTargets(['.github/workflows/cd-mcp-image.yml'], CONTEXT),
- computeTargets(['.github/workflows/ci-openapi-codegen.yml'], CONTEXT)
+ computeTargets(['.github/workflows/ci-migrations-service-separation-check.yml'], CONTEXT),
+ computeTargets(['mypy.ini', 'rust/Cargo.toml', 'nodejs/src/index.ts'], CONTEXT)
)
- // Cross-domain workflows take the union of the families on each side,
- // matching what the same change spelled as files would claim.
- const pythonNodeRust = computeTargets(['mypy.ini', 'rust/Cargo.toml', 'nodejs/src/index.ts'], CONTEXT)
- for (const workflow of ['ci-migrations-service-separation-check.yml', 'ci-proto.yml']) {
- assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), pythonNodeRust, workflow)
- }
- const rustPython = computeTargets(['mypy.ini', 'rust/Cargo.toml'], CONTEXT)
- for (const workflow of ['build-deltalite.yml', 'ci-deltalite-python.yml', 'build-hogql-parser-rs.yml']) {
- assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), rustPython, workflow)
- }
- const pythonJavascript = computeTargets(['mypy.ini', '.oxlintrc.json'], CONTEXT)
- for (const workflow of ['build-hogql-parser-npm.yml', 'ci-hog.yml', 'ci-agent-skills.yml']) {
- assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), pythonJavascript, workflow)
- }
- // The desktop workflow family takes the desktop product's own two lanes,
- // and widens in a context where no such product exists.
- const desktopContext = {
- ...CONTEXT,
- products: [...CONTEXT.products, 'desktop'],
- backendDetachedProducts: new Set(['desktop']),
- }
+})
+
+// The schema codegen pipeline turns schema.json into the generated artifacts
+// both families read, which is the product-surface radius.
+test('the schema codegen scripts claim the product-surface lanes', () => {
assert.deepEqual(
- computeTargets(['.github/workflows/desktop-ci.yml', '.github/workflows/desktop-release.yml'], desktopContext),
- computeTargets(['products/desktop/apps/code/src/main.ts', 'products/desktop/tools/build.py'], desktopContext)
+ computeTargets(['bin/build-schema-python.sh'], CONTEXT),
+ computeTargets(['frontend/src/products.json'], CONTEXT)
)
+})
+
+// A Depot shadow is kept apples-to-apples with its canonical by the
+// shadow-drift check and posts non-blocking statuses, so it can only affect
+// what the canonical affects. The narrowing direction is the guard: a shadow
+// of something no rule has placed must stay on the .github blanket rather
+// than fall through unclaimed.
+test('a depot shadow resolves through its canonical workflow rules', () => {
+ assert.deepEqual(
+ computeTargets(['.depot/workflows/ci-backend.yml'], CONTEXT),
+ computeTargets(['.github/workflows/ci-backend.yml'], CONTEXT)
+ )
+ assert.deepEqual(
+ computeTargets(['.depot/workflows/ci-backend-update-test-timing.yml'], CONTEXT),
+ computeTargets(['mypy.ini'], CONTEXT)
+ )
+ assert.deepEqual(computeTargets(['.depot/actions/pnpm-install/action.yml'], CONTEXT), EVERYTHING)
+ assert.deepEqual(computeTargets(['.depot/workflows/some-new-shadow.yml'], CONTEXT), EVERYTHING)
+ // Shadow markdown is prose like any other.
+ assert.deepEqual(computeTargets(['.depot/actions/paths-filter/README.md'], CONTEXT), ['prose'])
+})
+
+// The guard is the narrowing direction: a service workflow whose directory is
+// gone must widen rather than claim a lane no other PR can reach.
+test('a service suite workflow claims its service lane and widens without it', () => {
+ assert.deepEqual(computeTargets(['.github/workflows/ci-oauth-proxy.yml'], CONTEXT), ['svc:oauth-proxy'])
+ assert.deepEqual(computeTargets(['.github/workflows/ci-llm-gateway.yml'], CONTEXT), EVERYTHING)
+})
+
+test('desktop workflows claim the desktop product lanes and widen without the product', () => {
+ const withDesktop = { ...CONTEXT, products: [...CONTEXT.products, 'desktop'] }
+ for (const file of ['.github/workflows/desktop-ci.yml', '.github/workflows/desktop-release.yml']) {
+ assert.deepEqual(computeTargets([file], withDesktop), ['fe:product:desktop', 'py:product:desktop'], file)
+ }
assert.deepEqual(computeTargets(['.github/workflows/desktop-ci.yml'], CONTEXT), EVERYTHING)
- // The Depot shadows take their canonical twin's domain instead of the
- // .depot/** universal rule, so a shadow-only or paired edit stays on the
- // python lanes.
+})
+
+// The Proto CI workflow gates buf lint and the stub drift checks over every
+// tree, which is the same radius the root buf configuration gets.
+test('the proto workflow claims every proto tree rather than everything', () => {
assert.deepEqual(
- computeTargets(
- ['.depot/workflows/ci-backend.yml', '.depot/workflows/ci-backend-update-test-timing.yml'],
- CONTEXT
- ),
- python
+ computeTargets(['.github/workflows/ci-proto.yml'], PROTO_CONTEXT),
+ computeTargets(['proto/buf.yaml'], PROTO_CONTEXT)
)
})
+test('the cli workflow and the reusable release plan share the cli lane', () => {
+ for (const file of ['.github/workflows/ci-cli.yml', '.github/workflows/release.yml']) {
+ assert.deepEqual(computeTargets([file], CONTEXT), computeTargets(['cli/src/main.rs'], CONTEXT), file)
+ }
+})
+
+test('the hogbox preview workflows keep the hogbox tooling lane', () => {
+ for (const file of ['.github/workflows/hogbox-preview-env.yml', '.github/workflows/hogbox-preview-cleanup.yml']) {
+ assert.deepEqual(computeTargets([file], CONTEXT), ['tools:hogbox-preview'], file)
+ }
+})
+
+test('the mcp ui-apps workflow claims the product-surface readers', () => {
+ assert.deepEqual(
+ computeTargets(['.github/workflows/ci-mcp-ui-apps.yml'], CONTEXT),
+ computeTargets(['frontend/src/products.json'], CONTEXT)
+ )
+})
+
+// The skills build renders templates that import product Python, and the
+// embedded-payload job regenerates products/*/frontend/generated/, so the
+// workflow spans both language families. Its paths filter never matches
+// .agents/, so that lane stays out.
+test('the agent-skills workflow claims both language families', () => {
+ const targets = computeTargets(['.github/workflows/ci-agent-skills.yml'], CONTEXT)
+ assert.equal(targets.includes('agents'), false)
+ assert.equal(targets.includes('py:core'), true)
+ assert.equal(targets.includes('fe:core'), true)
+ assert.deepEqual(targets, computeTargets(['mypy.ini', '.oxlintrc.json'], CONTEXT))
+})
+
+test('the ml-mirror sidecar image and its workflow stay on the node lane', () => {
+ for (const file of ['.github/workflows/ci-ml-mirror-image-scrub-container.yml', 'Dockerfile.ml-mirror-image-scrub']) {
+ assert.deepEqual(computeTargets([file], CONTEXT), ['node:ingestion'], file)
+ }
+})
+
// Semgrep enforces the languages: declaration on every rule, so it is a sound
// source for the radius. The IDOR allowlist every new team-scoped model has to
// touch is a python rule, and used to serialize those PRs against the frontend.
@@ -727,6 +926,41 @@ test('every target the rules can emit appears in the enumerated universe', () =>
'.oxlintrc.json',
'mypy.ini',
'.github/workflows/ci-rust.yml',
+ '.github/workflows/ci-e2e-playwright.yml',
+ '.github/workflows/container-images-cd.yml',
+ '.github/workflows/ci-hobby.yml',
+ '.github/workflows/ci-oauth-proxy.yml',
+ '.github/workflows/ci-agent-skills.yml',
+ '.github/workflows/hogbox-preview-env.yml',
+ '.github/workflows/ci-cli.yml',
+ 'bin/hobby-ci.py',
+ 'Dockerfile.llm-analytics',
+ '.github/workflows/stale.yaml',
+ '.github/workflows/ci-dev-setup.yml',
+ '.github/workflows/ci-deltalite-python.yml',
+ '.github/workflows/docs-preview-trigger.yml',
+ '.github/workflows/terragrunt-posthog.yaml',
+ '.github/workflows/ci-livestream.yml',
+ '.github/scripts/check-agents-md-symlinks.sh',
+ '.github/ISSUE_TEMPLATE/bug_report.yml',
+ 'bin/docker-server',
+ 'bin/mprocs.yaml',
+ 'bin/build-schema-python.sh',
+ 'bin/update-bots-list',
+ '.depot/workflows/ci-backend.yml',
+ 'tools/snob_backend_test_selection_shadow.py',
+ 'tools/playwright_area_map.json',
+ '.prettierignore',
+ '.trunk/trunk.yaml',
+ 'owners.yaml',
+ '.github/CODEOWNERS',
+ '.test_quarantine.json',
+ '.github/actions/paths-filter/src/filter.ts',
+ 'Dockerfile',
+ '.dockerignore',
+ 'patches/[email protected]',
+ 'depot.json',
+ '.github/workflows/_rust-build-images.yml',
]
for (const file of everyRule) {
const targets = computeTargets([file], CONTEXT)
@@ -744,9 +978,6 @@ test('an incomplete context falls back to the ALL sentinel', () => {
assert.equal(allKnownTargets({ ...CONTEXT, rustInventory: null }), null)
assert.equal(allKnownTargets({ ...CONTEXT, services: null }), null)
assert.equal(computeTargets(['some-new-toplevel/thing.go'], { ...CONTEXT, services: null }), ALL)
- // An explicit-lanes rule cannot validate its names without the full
- // universe, so it widens to the sentinel too.
- assert.equal(computeTargets(['.github/workflows/ci-cli.yml'], { ...CONTEXT, services: null }), ALL)
})
test('tripwire domains are reported for telemetry', () => {
@@ -815,6 +1046,8 @@ test('editor and agent configuration shares one lane', () => {
'.husky/pre-commit',
'.claude/settings.json',
'.greptile/config.json',
+ '.trunk/trunk.yaml',
+ '.trunk/.gitignore',
// The same class of file, one per root path rather than one per tree.
'.cursorignore',
'.editorconfig',
@@ -1573,22 +1806,36 @@ test('backend-coupled and unrecognized tools stay in the backend lanes', () => {
}
})
-// These steer what every suite runs, so they cannot sit in one domain's lane.
-test('CI-steering scripts directly under tools/ widen', () => {
- assert.deepEqual(computeTargets(['tools/playwright_spec_selection.py'], CONTEXT), EVERYTHING)
- assert.deepEqual(computeTargets(['tools/snob_backend_test_selection_shadow.py'], CONTEXT), EVERYTHING)
+// Each selection script decides which of one suite's tests run on a PR, so an
+// under-selection can only mask conflicts that suite's lanes already
+// serialize. A root-level tools/ file nobody has classified still widens.
+test('test-selection scripts claim the lanes of the suite they select for', () => {
+ for (const file of [
+ 'tools/snob_backend_test_selection_shadow.py',
+ 'tools/test_selection_verdict.py',
+ 'tools/dagster_test_selection.py',
+ 'tools/testmon_high_fanout_files.txt',
+ ]) {
+ assert.deepEqual(computeTargets([file], CONTEXT), computeTargets(['mypy.ini'], CONTEXT), file)
+ }
+ const playwright = computeTargets(['tools/playwright_spec_selection.py'], CONTEXT)
+ assert.deepEqual(playwright, computeTargets(['tools/playwright_area_map.json'], CONTEXT))
+ assert.equal(playwright.includes('fe:core'), true)
+ assert.equal(playwright.includes('py:core'), true)
+ assert.notDeepEqual(playwright, EVERYTHING)
+ assert.deepEqual(computeTargets(['tools/some_new_steering_script.py'], CONTEXT), EVERYTHING)
})
// Both are tripwires rather than falling through to the tools/ rule, which
// would give them the python product lanes and nothing else. openapi-codegen
// generates the frontend types from the backend serializers, so it claims both
-// sides of the fe/py split, and owners is read by both suites.
+// sides of the fe/py split, and owners sits on the shared ownership lane.
test('cross-domain tools are tripwires rather than backend-only', () => {
assert.deepEqual(
computeTargets(['tools/openapi-codegen/config.ts'], CONTEXT),
computeTargets(['frontend/src/products.json'], CONTEXT)
)
- assert.deepEqual(computeTargets(['tools/owners/posthog_owners/__init__.py'], CONTEXT), EVERYTHING)
+ assert.deepEqual(computeTargets(['tools/owners/posthog_owners/__init__.py'], CONTEXT), ['ownership'])
})
// Prose overlaps only other prose, and has to reach that lane through the
@@ -1607,8 +1854,9 @@ test('markdown alongside code contributes no lane of its own', () => {
)
})
-// hogli build:skills zips products/*/skills/*, and ci-agent-skills.yml gates on
-// those paths and on .agents/, so this markdown is a build input, not prose.
+// hogli build:skills zips products/*/skills/* (which ci-agent-skills.yml
+// gates) and syncs .agents/skills/, so this markdown is a build input, not
+// prose.
// Skill markdown is a build input for the Python skill build (and sometimes the product backend).
// No frontend suite reads these files, so they should claim the backend lane but not the frontend lane.
test('skill markdown keeps the lane of the tree that builds it', () => {