Skip to content

Clean up fallback to unstable version when looking for unyanked versions #2091

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

Closed

Conversation

charmander
Copy link

@charmander charmander commented Jan 6, 2020

It was checking the result of the previous search for a stable unyanked version.
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @carols10cents (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@charmander charmander force-pushed the version-fallback-fixes branch from a44427b to bd3c0c0 Compare January 6, 2020 05:56
@charmander
Copy link
Author

Actually, this might not fix anything:

If max_version is 0.0.0 then all versions have been yanked

suggests that latestUnyankedVersion == null is supposed to be impossible here, inside

if (!requestedVersion && maxVersion !== '0.0.0') {
. I’ll try to find out for sure.

@Turbo87
Copy link
Member

Turbo87 commented Jan 7, 2020

@charmander is there a GitHub issue for the thing that you're fixing here? do you think it would be possible to write a test case for it?

@carols10cents
Copy link
Member

Hi @charmander, we deliberately changed this in #1857 to fix #1144. If you can open a bug first to describe what you're trying to fix, we can work on the best way to fix it and test it! Thank you!

@charmander
Copy link
Author

@carols10cents This is a fix to a typo in that patch – the second check was supposed to be for the new latestUnyankedVersion instead of the already-checked latestStableVersion – but I’m still trying to figure out how to create a crate affected by it or prove that one doesn’t exist. Sorry for the wait.

@charmander
Copy link
Author

Actually, I don’t understand how #1857 could have changed any behaviour without this typo fix… maybe #1144 was really fixed by #1684?

@charmander
Copy link
Author

charmander commented Jan 23, 2020

Okay, it looks like max_version comes from Crate::top_versions, which uses CrateVersions::versions, which only includes unyanked versions. So making a test for this isn’t possible and it’s just cleanup. Changes pushed accordingly! (They don’t show up when the pull request is closed.)

@charmander charmander changed the title Fix fallback to unstable version when looking for unyanked versions Clean up fallback to unstable version when looking for unyanked versions Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants