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): hold single-domain workflows to their own queue lanes (#89288)

Georges-Antoine Assi2e4dda42082f
diff --git a/.github/scripts/trunk-impacted-targets.js b/.github/scripts/trunk-impacted-targets.js
index b89a4c97b682..7813308fc534 100644
--- a/.github/scripts/trunk-impacted-targets.js
+++ b/.github/scripts/trunk-impacted-targets.js
@@ -121,12 +121,24 @@ 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
@@ -168,8 +180,11 @@ 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. Everything else
- // under .github/ stays universal: the list grows by decision, and a
+ // 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
// workflow nobody has placed here keeps the old radius.
['.github/workflows/ci-frontend.yml', JAVASCRIPT],
['.github/workflows/ci-storybook.yml', JAVASCRIPT],
@@ -177,12 +192,145 @@ 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],
+ // 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]],
+ // 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],
// 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
@@ -1280,6 +1428,18 @@ 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.rustGraph) {
return false
@@ -1311,11 +1471,6 @@ function addCargoLockLanes(targets, context) {
return true
}
-// The nodejs lane on its own. No tripwire resolves to it, because a file that
-// can break the ingestion suite can almost always break more than that. The
-// rust and proto rules still need to name it without dragging in the frontend.
-const NODE = 'node'
-
function addNodeLanes(targets) {
targets.add('node:ingestion')
return true
@@ -1392,14 +1547,47 @@ const DOMAIN_LANES = new Map([
[NODE, addNodeLanes],
[PRODUCT_SURFACE, addProductSurfaceLanes],
[PROTO, addProtoLanes],
+ [DESKTOP, addDesktopLanes],
])
+// 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
+}
+
// 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.
+// 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.
function applyTripwireDomain(domain, file, targets, context) {
const resolved = domain === SEMGREP ? (context.semgrepDomains || new Map()).get(file) || UNIVERSAL : domain
- const addLanes = DOMAIN_LANES.get(resolved)
- return addLanes ? addLanes(targets, context, file) : false
+ 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
+ })
}
// Paths under rust/ that belong to no crate, and the domains that read them. A
@@ -1486,9 +1674,10 @@ function computeTargets(changedFiles, context) {
// a README under posthog/ into the backend lane.
//
// The exception is markdown that is a build input: `hogli build:skills`
- // zips products/*/skills/*, ci-agent-skills.yml gates on those paths and
- // on .agents/, and ci-python.yml runs the pr-approval-agent suite over
- // .stamphog/. All of them fall through to their directory rules below.
+ // zips products/*/skills/* (which ci-agent-skills.yml gates), the
+ // skills build syncs .agents/skills/, and ci-python.yml runs the
+ // pr-approval-agent suite over .stamphog/. All of them fall through to
+ // their directory rules below.
const isBuildInput =
top === '.agents' || top === '.stamphog' || (top === 'products' && segments[2] === 'skills')
diff --git a/.github/scripts/trunk-impacted-targets.test.js b/.github/scripts/trunk-impacted-targets.test.js
index bf42c10654a9..45cbc4ef36d5 100644
--- a/.github/scripts/trunk-impacted-targets.test.js
+++ b/.github/scripts/trunk-impacted-targets.test.js
@@ -153,9 +153,10 @@ test('a universal tripwire claims every known target', () => {
// Read by pytest, jest, and playwright alike, so no one domain holds it.
'.test_quarantine.json',
// Trees that steer what every suite runs or what it runs against: the
- // Depot copies of the workflows, the toolchain, the service configs the
- // stack mounts, and the markdownlint config every tree's prose obeys.
- '.depot/workflows/ci-backend.yml',
+ // 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',
'.flox/env/manifest.toml',
'docker/clickhouse/config.d/default.xml',
'devenv/duckgres.yaml',
@@ -486,13 +487,136 @@ 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/${workflow}`], CONTEXT), javascript, workflow)
+ }
+ 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',
+ ]) {
+ assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), python, workflow)
+ }
+ 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',
+ ]) {
+ assert.deepEqual(computeTargets([`.github/workflows/${workflow}`], CONTEXT), rust, workflow)
+ }
+ // The workflow gating tools/openapi-codegen takes the tree's own domain.
assert.deepEqual(
- computeTargets(['.github/workflows/ci-frontend.yml'], CONTEXT),
- computeTargets(['.oxlintrc.json'], CONTEXT)
+ 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'],
+ ]) {
+ assert.deepEqual(
+ computeTargets([`.github/workflows/${workflow}`], CONTEXT),
+ computeTargets([treeFile], CONTEXT),
+ workflow
+ )
+ }
+ // 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'],
+ }
+ 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'],
+ ]) {
+ assert.deepEqual(
+ computeTargets([`.github/workflows/${workflow}`], serviceContext),
+ computeTargets([treeFile], serviceContext),
+ workflow
+ )
+ }
+ 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.
+ assert.deepEqual(
+ computeTargets(['.github/workflows/cd-mcp-image.yml'], CONTEXT),
+ computeTargets(['.github/workflows/ci-openapi-codegen.yml'], 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']),
+ }
+ 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)
)
+ 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.
assert.deepEqual(
- computeTargets(['.github/workflows/ci-backend.yml'], CONTEXT),
- computeTargets(['mypy.ini'], CONTEXT)
+ computeTargets(
+ ['.depot/workflows/ci-backend.yml', '.depot/workflows/ci-backend-update-test-timing.yml'],
+ CONTEXT
+ ),
+ python
)
})
@@ -623,6 +747,9 @@ test('an incomplete context falls back to the ALL sentinel', () => {
assert.equal(allKnownTargets({ ...CONTEXT, rustGraph: 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', () => {
diff --git a/.github/scripts/trunk-lane-telemetry.js b/.github/scripts/trunk-lane-telemetry.js
index f48e58b16fc6..03c1b905ee1c 100644
--- a/.github/scripts/trunk-lane-telemetry.js
+++ b/.github/scripts/trunk-lane-telemetry.js
@@ -81,6 +81,16 @@ function buildProperties(changedFiles, impactedTargets, universe) {
domain = 'universal'
}
}
+ // A cross-domain rule holds a list of members (domains or explicit
+ // {lanes: [...]} objects); one stable joined key keeps the counts per
+ // rule rather than per member.
+ if (Array.isArray(domain)) {
+ domain = domain
+ .map((member) => (member && typeof member === 'object' ? member.lanes.join('+') : member))
+ .join('+')
+ } else if (domain && typeof domain === 'object') {
+ domain = domain.lanes.join('+')
+ }
tripwireDomains[domain] = (tripwireDomains[domain] || 0) + 1
}