Repository navigation
chore(lock): read the lock as written; drop the pre-release spellings - #9
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
No release wrote pkg:git/… or bare-URL lock resources or string usages, so the translation of them goes; a non-canonical resource is now refused with the form this tool writes. 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)".
|
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
0.1.0 shipped two translations for lock formats no release ever wrote. They go:
lock.Usage.UnmarshalJSONaccepted a bare string ("usage": ["pkg:…@1.2.0"]) beside the{resource, versionConstraint}object. Removed; a string usage is now a JSON decode error fromlock.Parse.install.keyResourcesre-parsed every lockresourcethroughorigin.Parseand replaced it with its key, which silently upgradedpkg:git/host/pathand baregit+ssh://…resources topkg:generic/…?vcs_url=…. It still maps a canonical identity to its key (that is howrepo.gitandrepomeet, a 0.1.0 behaviour that stays), but any resource whoseIdentity()is not the text in the lock is now an error:Tests:
TestParseLegacyStringUsagesreplaced byTestParseRejectsStringUsages;TestKeyResourcesnow asserts the refusal forpkg:git/…, a bare URL, and a versioned identity; the install round-trip test asserts the error instead of a silent rewrite;TestLockMatchesAcrossGitSuffixSpellingskeeps all four usage spellings but feeds only canonical lock spellings.docs/packages.mdstates the rule; changelog fragment underremoved.Gate:
go build/vet,gofmt -lempty,SYSPI_REQUIRE_VCS=1 go test -count=1 ./...green locally.Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/68b5a820c94c465ba03856b204dbd50d
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/68b5a820c94c465ba03856b204dbd50d?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings