Repository navigation
fix(check): count Cargo workspace members as covered by the scan scope - #584
Merged
Merged
Conversation
A root Cargo.toml with [workspace] members made the scan scope row warn that each member crate was an uncovered nested project, although osv-scanner and cargo audit read the root Cargo.lock, which pins every member. declaresWorkspaces only looked at package.json workspaces. Members (globs such as crates/* included, exclude honored) now count as covered when a root Cargo.lock exists. Non-members, and members without a lockfile, still warn. A root pnpm-workspace.yaml now counts as declaring workspaces too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ft6L7xbdazPw8xqvxfPzs
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
# Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RSop9MyLof8XxLTkFnF4KG
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
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.
What was wrong
kit checkwarned about crates that its own scanners already cover. In a repo whose rootCargo.tomlis a Cargo workspace:with one root
Cargo.lock, the scan scope row reported:That is a false warning. osv-scanner and cargo audit read the root
Cargo.lock, and a workspace's single lockfile pins every member.declaresWorkspacesonly looked atpackage.jsonworkspaces, so any root that was not an npm workspace made every nested crate look uncovered.What changed
src/check-nested-projects.ts:scanScopeFactsnow also recordscargoMembers, the nested paths listed in the root[workspace] members(simple globs such ascrates/*supported,excludehonored). It records them only when a rootCargo.lockexists, because the scanners read the lockfile.checkScanScopepasses when every nested project is a member, and otherwise warns with only the uncovered paths.pnpm-workspace.yamlnow counts as declaring workspaces, the same aspackage.jsonworkspaces. It was the same small gap in the same function.cargoMembersis optional onScanScope, so existing callers and fixtures are unchanged.How it was tested
New cases in
src/check-nested-projects.test.ts:Cargo.lock: pass.Cargo.lock: still warns, both members named.tools/web/package.json: warns, and names onlytools/web.Results:
npm run build: ok.npm test: 6518 tests, 6508 pass, 0 fail, 10 skipped.npm run lint: 0 errors, no warnings in the changed files.prettier --checkon the changed files: clean.node dist/cli.js adr check: 4 enforced ADRs, no new violations.kit check --category security, against the real repo above. The row now readsscan scope: pass 2 nested crate(s) covered via the Cargo workspace: crates/lyssna-core, src-tauri.🤖 Generated with Claude Code