Repository navigation
fix: scan and build read package metadata only from the given path - #469
Draft
vibgrate-team wants to merge 1 commit into
Draft
vibgrate-team wants to merge 1 commit into
vibgrate-team wants to merge 1 commit into
Conversation
vg build ../other treated that directory as a scope of the working directory, so the lockfile and config came from the cwd and the ignore matcher rejected ../other/package-lock.json. A directory outside the working directory is now the project that is mapped. Add tests that run vg scan, vg build, and vg sbom export from a decoy working directory against a sibling project. Fixes #377 Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@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.
Summary
vg scan <path>andvg sbom export --root <path>already read the project at<path>.vg build <path>did not, when<path>was a directory outside the working directory.vg build ../othertreated that directory as a discovery scope of the working directory. The build then read the cwd lockfile and config, and the ignore matcher threw on../other/package-lock.json(path should be a path.relative()d string). A single directory outside the working directory is now the project that is mapped: its lockfile,node_modules, and config are the ones that are read, and artifacts are written for that directory. A path inside the working directory stays a scope (vg build srcstill uses the repo's lockfile and config).Regression tests run
vg scan,vg build, andvg sbom exportfrom a decoy working directory against a sibling project with different lockfile versions,node_modulesversions, anddriftBudget/ exclude settings. Output matches a run from inside the target, decoy markers do not appear, and.vibgrate/artifacts are not written under the decoy.Related issues
Fixes #377
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleangraph.json/ report output (content-hashed IDs, stable sorts; no time, randomness, or filesystem-order dependence)git commit -s, DCO)Notes for reviewers
pnpm lintexits 0. It still reports five unused-variable warnings in files this change does not touch.Scan JSON is compared as data, not bytes: extended scanners finish concurrently, so object key order can differ between two runs of the same tree. Progress lines on stderr include elapsed time; the test rewrites those durations before comparing.
graph.jsonis compared byte for byte with--generated-atpinned.