compare version diff from crates.io code rather than git source in update review #104
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.
Motivation
In update review, we present a diff analysis between two version of a given crate. Analyzing the diff by downloading code from crates.io for respective versions is a reliable way rather than checking out the two versions from its git source and analyzing diff from there, which fails at cases: i) ii) when the source repository is not present or it is not a git repository, ii) when we can't figure out the head commit for a given version, iii) when the repository contains files that are ignored in crates.io code but we also then count them in our diff, e.g.,
libc-test
files inlibc
crate.Therefore, getting diff directly from crates.io code will give a reliable analysis in dependency update review report. In case of packages not hosted on crates.io, we still make use of repository diff as before.
Improvement TODOs
for both versions,
Enum guppy::graph::summaries::SummarySource
gives the source from where the crate has been pulled from. Incorporate that information while fetching source code for a more accurate analysis in all the cases. However, this shall be part of a larger change scope in depdive where we could identify any type of versioning change in a dep, e.g., updating to a certain commit to another from git source. Currently depdive is designed around the notion of updating from one version to another for crates hosted on crates.io. #106