-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - test: Rewrite test-crate-version in Rust #2595
Conversation
Implement reading publish list Implement downloading crates.io data
WIP: Implementing crate diffing
Thinking of using treediff in conjunction with cargo-manifest for showing changes in manifest files. Not sure yet how I'm gonna approach diffing the There are some good crates for diffing text, but I haven't found one yet that can show differences in file structure. Edit: I think folder_compare may be a good candidate for diffing directories Edit 2: All of this may be overkill. What I have now seems to be working pretty well. |
Testing showed that: + Reordering keys does not get flagged as a change (good!) + Removing keys also does not get flagged as a change (bad! maybe?)
So an interesting thing about the current state of the manifest diffing:
I honestly don't know if this is a problem. It may even be desirable. Removing an unused dependency should not require a version bump (I think?) but there are probably other keys that ought to require a version bump if removed. But maybe this is a rare enough thing that we don't care? Feedback would be appreciated. |
I couldn't find a good crate for diffing toml files, so I'm making my own. |
The desire to have a version bump is primarily driven by our release process. Since we use path dependencies for the public crates in the repo during development and testing, we have expectations that the public version is compatible after release. So if we could be objective in order to decide what changes require or don't require a new version bump, and cover our internal dependency tree, then that sounds ok to me. (emphasis: As long as we're consistent between our internal dependencies.) |
There might be a way to get that working for toml, but I wasn't able to easily figure it out. Good news is my |
I wasn't sure if I should include the crate in the source, or if I should publish it myself and have it pull from crates.io. For now I just included the crate in the source. |
Thanks for PR. |
Yes it is. |
Great. Thanks for the nice work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it took a lot of effort and will be a lot easier to maintain. Good job with toml-diff
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I really appreciate the hard work that went into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks reasonable. Just a couple of minor nits regarding the license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This is a fairly good effort. Thanks for working on this.
bors r+ |
**Notable changes** + Does not download `https://static.crates.io/db-dump.tar.gz` to check if crates are published (very slow) + Instead requests `https://crates.io/api/v1/crates/{crate_name}/versions` - 404 indicates that the crate is not published **TODO** + [x] Test source diffing + [x] Display source changes + [x] Test manifest diffing + [x] Decide whether deleted manifest keys should be ignored or flagged + [x] Display manifest changes + [x] Download crates without an external tool (currently using `cargo-download`) + [ ] ~~Diff source without an external tool (currently using `diff`) - maybe? Might not be worth the effort.~~ + [x] Add a `--verbose` mode + [x] Download crates concurrently + [x] Colorize diff Related: #2590
Pull request successfully merged into master. Build succeeded: |
Notable changes
https://static.crates.io/db-dump.tar.gz
to check if crates are published (very slow)https://crates.io/api/v1/crates/{crate_name}/versions
- 404 indicates that the crate is not publishedTODO
cargo-download
)Diff source without an external tool (currently usingdiff
) - maybe? Might not be worth the effort.--verbose
modeRelated: #2590