Repository navigation
Report the Hex package name for renamed rebar.lock entries - #176
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Fixes #175.
Summary
A
rebar.lockentry for a renamed package names the app first and the Hex package inside{pkg, ...}:{<<"jiffy">>,{pkg,<<"jiffy_fork">>,<<"1.1.1">>},0}rebarPkgRegexonly captured the app name, so this was reported asjiffywithpkg:hex/jiffy@1.1.1, while the installed package isjiffy_fork. It now captures the package name too and uses it forName, givingpkg:hex/jiffy_fork@1.1.1. That matches therebar.configparser in #174 for{jiffy, "1.1.1", {pkg, jiffy_fork}}.rebar3 keys
pkg_hashandpkg_hash_extby the app name (expand_locksinapps/rebar/src/rebar_config.erl), so the integrity lookup keeps using the app name. Entries that are not renamed have the same name in both places and are unaffected.This changes the
Nameand PURL callers receive for renamed packages.Tests
testdata/rebar/rebar.lockgains a renamedjiffy/jiffy_forkentry, with hashes keyed byjiffyin both hash sections.TestRebarLockexpectsjiffy_forkat1.1.1with itspkg_hash_extintegrity.TestRebarLockUsesHexPackageNameForRenameschecks that no dependency is reported under the app name.rebar_lock_test.gocheckspkg:hex/jiffy_fork@1.1.1and the integrity throughParse.go build ./...,go vet ./...,go test ./...andgolangci-lint run ./...all pass.Summary by CodeRabbit
jiffy_forkis represented with its correct package identifier and version, helping ensure dependency listings reflect the details in the lockfile.