Repository navigation
fix(engine): read the working tree as Git would push it, and exclude test data by default - #53
Merged
Merged
Conversation
…test data by default Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Rust | Oct 26, 2026 5:32p.m. | Review ↗ | |
| JavaScript | Oct 26, 2026 5:32p.m. | Review ↗ | |
| Shell | Oct 26, 2026 5:32p.m. | Review ↗ | |
| Secrets | Oct 26, 2026 5:32p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 24ac3d8 | Commit Preview URL Branch Preview URL |
Oct 26 2026, 05:22 PM |
|
[Medium impact] The PR appears safe to merge; both earlier findings are addressed. Reviews (2) · Last reviewed commit: "fix(engine): skip files below symlinked ..." · Reviewed by Greptile |
… in the spinner Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
Local runs (no repository named) walked the whole checkout, git-ignored directories included, so a working tree could read manifests GitHub never sees. They also took every tracked test fixture and example as a real manifest. This change fixes both and makes the progress label say what it counts.
Working tree reads what a push would carry
read_tree, whichlookup,run --dry-run,tuiandapplyall go through, now lists files withgit ls-files -z --cached --others --exclude-standard. That is tracked files plus untracked ones Git doesn't ignore, so.gitignore,.git/info/excludeand the global excludes file apply. Tracked files inside an ignored directory are still read, as on GitHub. A directory outside Git, or a machine without Git, falls back to the old walk, which skips.git. Deleted tracked files, symlinks, submodules and tracked paths below a symlinked directory are skipped, so nothing outside the checkout is read or written.Root cause, corrected: the default config already excluded
**/node_modules/**, so a plain npm, pnpm, bun or Yarn-PnP project on defaults wasn't inflated. In my repro with defaults it read 2 manifests and made 4 lookups. The blow-up happens when a repo'spatchula.pklreplacesexclude, or when other ignored directories hold manifests. Repro withexclude = new Listing { "dist/**" }, an npm project andnode_modules/present:Built-in excludes cover install and test-data directories
excludenow defaults tonode_modules,bower_components,vendor,.git,test,tests,__tests__,__fixtures__,fixturesandexamples, at any depth. This applies to GitHub reads and working-tree reads alike. Amendingexclude { … }adds to the defaults. An entry such asexclude { "!examples/app/**" }re-includes one directory, and assigning anew Listingreplaces the list. The configuration guide and reference document this, and departures.md records how it differs from Renovate'signorePathsdefault andconfig:recommended.Running
patchula lookup --default-configon this repository:The 27 that remain are the workspace and crate
Cargo.tomls,Cargo.lock,conformance/Cargo.toml,docs/package.json,mise.toml, the Dockerfile,action.ymland the workflows, so this repo doesn't need its ownpatchula.pkl. The corpus snapshot is unchanged, because both the snapshot test andcorpus:checkread paths relative totests/corpus/. Thepublic-batchcassette drops the 5 blob reads forjdx/usage'stest/andtests/fixtures/manifests, which are no longer requested.Progress label
The lookup stage counts unique lookups (one per package, plus one per action ref whose digest is read), so the spinner now says "running N lookups" instead of "looking up N dependencies".
Tests
crates/engine/tests/working_tree.rscovers five cases. An ignorednode_modules/(and aninfo/excludedbuild/) full ofpackage.jsonfiles is not extracted, even withexclude = new Listing {}. A force-added file in an ignored directory is still read. A directory outside Git is walked with the default excludes applied. A!entry re-includes a default-excluded directory. A tracked file whose directory became a symlink to somewhere outside is not read.