Repository navigation
CI rules: a lockfile change reaches only the workspaces and crates whose resolved dependencies changed - #134
Open
agorischek wants to merge 2 commits into
Open
agorischek wants to merge 2 commits into
agorischek wants to merge 2 commits into
Conversation
agorischek
force-pushed
the
agorischek/ci-rules-narrower
branch
from
November 21, 2026 04:06
559e1df to
366e404
Compare
agorischek
force-pushed
the
agorischek/ci-rules-lockfiles
branch
from
November 21, 2026 04:06
dfb0c38 to
972cbb2
Compare
agorischek
force-pushed
the
agorischek/ci-rules-narrower
branch
from
November 21, 2026 04:21
366e404 to
f94e8e6
Compare
…ose resolved dependencies changed package-lock.json and Cargo.lock no longer run everything. A new `lockfile` file effect compares each with its version at the merge base, by the lockfiles alone (ci-lockfiles.ts: npm's `packages` entries resolved as Node resolves them, Cargo.lock's `[[package]]` blocks), and counts the change as one to the workspaces and crates whose resolved dependencies changed; the unit graph carries it to their dependants. The rule's `root: "full"` still runs everything when the root package's own tooling (TypeScript, ESLint, oxfmt) changed, and so does a lockfile with no earlier version to compare. Replayed on main's recent lockfile commits: a VS Code extension dependency reaches only that extension (6 jobs), and a new extractor only its crate and the catalog (12), instead of 42 each. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Dependency resolution ignores Cargo source qualifiers, so same-name/version packages from different sources can be confused and transitive dependency changes may not trigger the consuming crate’s CI jobs.
1 open issue
What changed in this PR
This PR narrows CI runs for lockfile changes to the workspaces and crates whose resolved dependencies changed, building on the earlier CI rule refinements. Root tooling changes and missing baseline lockfiles still trigger full runs.
Changes:
- Compare npm and Cargo dependency graphs before and after lockfile changes.
- Wire merge-base and current file contents into the CI planner.
- Extend rule schemas, tests, and contributor documentation.
| File | Description |
|---|---|
tools/scripts/ci-plan.mjs |
Supplies baseline and current lockfile contents. |
tools/cli/test/ci-plan.test.ts |
Tests selective planning with the real npm lockfile. |
tools/cli/test/ci-lockfiles.test.ts |
Tests npm resolution and Cargo dependency reach. |
tools/cli/src/lib/ci-rules.schema.ts |
Defines lockfile effects and root handling. |
tools/cli/src/lib/ci-plan.ts |
Passes file contents into change classification. |
tools/cli/src/lib/ci-lockfiles.ts |
Computes affected units from lockfile dependency graphs. |
tools/cli/src/lib/ci-files.ts |
Applies lockfile rules and full-run fallbacks. |
CONTRIBUTING.md |
Documents lockfile-driven CI selection. |
.github/ci-rules.schema.json |
Updates the generated rule schema. |
.github/ci-rules.json |
Replaces blanket lockfile runs with selective rules. |
Review effort: Balanced
agorischek
force-pushed
the
agorischek/ci-rules-lockfiles
branch
from
November 21, 2026 04:21
972cbb2 to
dc0b37f
Compare
…name and version Copilot review on #134. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.

Stacked on #133. This is step (c): a lockfile change reaches only the workspaces and crates whose resolved dependencies changed.
package-lock.jsonandCargo.lockno longer run everything. They match a newlockfilefile rule:{"description": "A lockfile: a change to the workspaces and crates whose resolved dependencies changed, and everything when the root's own tooling (TypeScript, ESLint, oxfmt) did", "paths": ["package-lock.json", "Cargo.lock"], "effect": "lockfile", "root": "full"}tools/cli/src/lib/ci-lockfiles.tscompares each lockfile with its version at the merge base, using the lockfiles alone, with no install, registry or network.packagesentries, with each dependency resolved as Node resolves it (nestednode_modulesfirst), and workspace links standing for their workspace.[[package]]blocks, withname,name versionorname version (source)dependencies."root": "full": when the root package's own dependencies change. Only its dependency fields are compared, not itsworkspaceslist.ci-plan.mjspasses each file's contents before (git show <merge-base>:path) and after.tools/cli/test/ci-lockfiles.test.tscovers npm nested and hoisted resolution, removed packages, the root's tooling, a new workspace, and Cargo blocks and dependencies.package-lock.json.Replayed on
main's recent lockfile commits (lockfile alone, then the whole commit):packages/integrations/vscodepackages/host/inspectorpackages/machinepackages/machinepackage.jsonchanged