perf(ci): give non-isolated product declarations a per-product lane - #76483
Merged
trunk-io[bot] merged 1 commit intoAug 3, 2026
Merged
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "perf(ci): give non-isolated product decl..." | Re-trigger Greptile |
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts Trunk lane computation for non-isolated products so that changes to product-level contract declarations (products/<p>/package.json, products/<p>/turbo.json) no longer claim all backend lanes, but instead claim the product’s own backend lane and seed the existing tach-dependent cascade (matching the mechanism already used for isolated products’ contract surfaces).
Changes:
- Introduce
isContractDeclaration()and use it to special-case non-isolated product declaration changes to claimpy:product:<p>(instead of widening to all backend lanes). - Rename
changedIsolatedProducts→cascadeSeedsand expand seeding logic to include non-isolated declaration changes. - Add/update unit tests covering narrowing behavior, cascade seeding, and tach-graph-unavailable fallback widening.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/scripts/trunk-impacted-targets.js | Adds per-product backend lane claiming for non-isolated package.json/turbo.json and seeds dependent cascade accordingly. |
| .github/scripts/trunk-impacted-targets.test.js | Adds coverage for the new narrowing + cascade behavior and updates an expectation for product-root handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Aug 3, 2026
gantoine
force-pushed
the
trunk-lanes-product-declarations
branch
from
August 3, 2026 12:44
5f2f0f2 to
1228c38
Compare
gantoine
force-pushed
the
trunk-lanes-product-declarations
branch
from
August 3, 2026 13:19
1228c38 to
74f9fb2
Compare
gantoine
force-pushed
the
trunk-lanes-product-declarations
branch
from
August 3, 2026 13:21
74f9fb2 to
1667686
Compare
products/<p>/package.json and turbo.json claimed every backend lane for the 63 non-isolated products, because a non-isolated product widens on any file the frontend rules do not claim. Those two files are not backend code: they configure the product's own tasks, including the backend:test command most of them carry. They now claim the product's own lane and seed the dependent cascade, the same treatment the isolated products already get. Everything else in a non-isolated product keeps widening. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gantoine
force-pushed
the
trunk-lanes-product-declarations
branch
from
August 3, 2026 13:26
1667686 to
6682ee7
Compare
rnegron
approved these changes
Aug 3, 2026
|
😎 Stack merged successfully - details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Stacked on #76481. Review that one first; this PR's diff is against it, not master.
Problem
products/<p>/package.jsonandproducts/<p>/turbo.jsonclaim all 87 backend lanes for the 63 non-isolated products. A non-isolated product widens on any file the frontend rules don't claim, and neither of those is.tsx.The 15 isolated products already get the narrow treatment for the same two files — their own lane plus the tach dependent cascade:
Nothing about the file justifies the difference. Isolation governs whether a product's backend code can be tested alone; these two files aren't backend code.
Changes
A non-isolated product's
CONTRACT_DECLARATIONS(turbo.json,package.json) now claimpy:product:<p>and seed the dependent cascade, instead ofallPyProducts(). Everything else in a non-isolated product widens exactly as before.Renamed
changedIsolatedProductstocascadeSeeds, since the set is no longer isolated-only.Why these two files and nothing else. I checked what they actually contain before narrowing them. 69 of 78 products keep their backend test command right there:
So they are not bare JS manifests, and this PR deliberately does not treat them as frontend-only — they keep a backend claim. What changes is the blast radius: the product's own lane plus every importer the tach cascade names, rather than every product in the repo. The cascade is the same mechanism the isolated products rely on, and
tach checkruns in CI so the graph can't drift.Warning
This extends to non-isolated products a trust we previously reserved for isolated ones, for these two files. If the tach graph is unavailable the code still falls back to
allPyProducts(), and there's a test for that, but the policy call is worth a reviewer's opinion rather than mine.How did you test this code?
node --test .github/scripts/trunk-impacted-targets.test.js— 46 pass, 4 new.The new cases cover the narrowing, the cascade seeding, that non-declaration files in the same product still widen, and that an unavailable tach graph widens a declaration change. I also updated one case from #76481 whose expectation this supersedes: it asserted the product root still reached
py:core, and now asserts it still claims a backend lane (py:product:gamma) — the property it was actually guarding, which is that the workspace narrowing doesn't swallow the product root.Whole-tree differential against #76481's head, all 20,555 tracked files under
products/:Every narrowed file is a product-root declaration, 89 lanes down to 2-13. Spot checks:
products/desktop/package.json→['fe:product:desktop', 'py:product:desktop'];products/actions/package.json→ 13 lanes including its 11 tach dependents;products/actions/backend/api.pystill → 88 lanes.👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Automatic notifications
Docs update
Not applicable. The rationale lives in the script's own header comments.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Follow-up to #76481. I asked Claude (Claude Code) whether the same idea extended to every
package.jsonin the repo outside the root; the answer was no, and finding out why is what produced this narrower change.Two rejected approaches worth recording:
package.jsonas a JS manifest and dropping its backend claim. Rejected on thebackend:testevidence above. Repo-wide the case doesn't exist anyway: of 137package.jsonfiles, 52 already claim no Python lane, 16 are the isolated products, and the only non-product ones that widen arecommon/hogql_parser,common/hogvm/typescript, andcommon/plugin_transpiler, which are genuinely Python-coupled.backend:*script means no Python effect." Only 9 products qualify, and the rule inverts on deletion: removingbackend:testwould classify as frontend-only precisely when the change is most backend-relevant./writing-testsinvoked before adding the test cases.