Repository navigation
feat(cli): syspi verify checks every installed copy under lib/ against the lock - #14
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
…t the lock Offline by nature and writing nothing: every usage of .project.json has a lock entry, and every lock entry's installed copy (exported tree, .kpar, local directory) is what the lock recorded — its .project.json, every checksum its .meta.json records (project.MismatchedChecksums reports them all, where VerifyChecksums stops at the first), the tree or .kpar SHA-256 and the usages it declares. Every discrepancy is printed; the exit status is 1 on any. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…nst its lock entry, the locked packages' usages too A usage whose constraint the lock entry no longer satisfies, a usage a locked package recorded that the lock does not cover, or a repository at another location (repo vs repo.git) spelled the same way all passed; each is now a discrepancy, as for the resolver. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
There was a problem hiding this comment.
Devin Review found 4 findings. Devin automatically fixed all 4 findings.
Fixed by Devin (4)
- Changed version requirement passes verification — verifyUsage now checks the lock entry's version against the usage's constraint (
the lock entry is at 1.1.0, the usage wants ^1.2.0); tested. - Missing transitive dependency passes verification — Every usage a lock entry recorded is checked the same way as the project's own: missing entry or unsatisfied constraint is a discrepancy; tested with a hand-added locked package.
- Relative local packages fail with
-C— verifyLocal resolves a relative source against the project root as resolveLocalDir does; TestVerifyRelativeLocalDir runs from another working directory. - Changed repository location passes verification — lockedEntry also requires locationKey(entry.Source) == locationKey(usage source), as lockedRepository does; a repo vs repo.git spelling is now
no lock entry; tested.
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
syspi verify [-C dir] [-offline] [-q]— the third of the commands 0.1.0 lacks. Independent of #10 (remove) and #13 (list); like them it adds the identical new fileinternal/install/libpath.go, so the three merge in any order without a conflict.install.Verify(root)is offline by nature (it reads.project.json, the lock andlib/, contacts no repository) and writes nothing. It returns every discrepancy, not the first, plus the number of lock entries checked; the command prints one line per discrepancy and exits 1 when there is any.vcs: the treelib/<publisher>-<name>_<version>exists;digest.TreeExcept(skipping.meta.jsonwhenmetaGenerated) equalssha256;.meta.jsonis present and every checksum it records matches (project.MismatchedChecksums, new —VerifyChecksumsstops at the first mismatch);.project.jsonsays the locked publisher/name/version; the usages it declares equal the entry'susage(both directions reported).archive: the.kparexists and its SHA-256 equalssha256;project.OpenArchiveverifies the members against its.meta.json; same.project.jsonand usage checks.local: the directory is still there and its.project.jsonsays what the lock recorded.standard: nothing is installed, nothing to check..project.jsonhas a lock entry (vcs by repository key, others by resource), else…: usage of .project.json has no lock entry; run syspi lock.Tests:
internal/install/verify_test.go(ten discrepancies of every kind in one project, all reported, nothing written or repaired; missing tree; missing.meta.json) andtests/e2e/verify_test.go(pass, tamper + delete,installrepairs,-q,-C, the git/hg/svn fixtures with a deleted member). Docs: README "Commands",docs/packages.md"Install layout",changes/unreleased/verify.added.md.Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/888897f71c264c89a8abc11e9a432241
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/888897f71c264c89a8abc11e9a432241?variant=devin
Requested by: @HuiJun
🟢 Devin fixed all 4 findings · Follow Devin's work