Skip to content
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

Prep for semver bump and document current blocker #3338

Closed
wants to merge 3 commits into from

Conversation

jtgeibel
Copy link
Member

@jtgeibel jtgeibel commented Feb 26, 2021

This partially reverts the revert (#3051) of #2990. While we can't bump the version yet, it is worth recovering these changes and documenting the remaining work.

r? @Turbo87

@Turbo87
Copy link
Member

Turbo87 commented Feb 26, 2021

looks like CI is unhappy 😢

@jtgeibel jtgeibel force-pushed the bring-back-latest-semver branch from d7c8b58 to eb8b0ac Compare February 26, 2021 15:02
@jtgeibel
Copy link
Member Author

Forgetting to cargo fmt strikes again. Should work now.

@Turbo87
Copy link
Member

Turbo87 commented Feb 26, 2021

you linked #3094 in the description, but I'm assuming that was a typo, right? 🤔

@Turbo87
Copy link
Member

Turbo87 commented Feb 26, 2021

I believe dtolnay/semver#217 might still be blocking this

@jtgeibel
Copy link
Member Author

@Turbo87 you're right, I meant to link to #3049. And you're right, I think the linked issue is blocking this.

@Turbo87 Turbo87 removed their assignment Feb 26, 2021
@Turbo87 Turbo87 added A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear labels Feb 27, 2021
This (partially) reverts commit 0bcb724.

This partially reverts the revert (rust-lang#3051) of rust-lang#2990. While we can't bump
the version yet, it is worth recovering these changes and documenting
the remaining work.
@jtgeibel jtgeibel force-pushed the bring-back-latest-semver branch from eb8b0ac to 3b9594c Compare February 27, 2021 23:06
@jtgeibel jtgeibel changed the title Bump to latest semver again Prep for semver bump and document current blocker Feb 27, 2021
@jtgeibel
Copy link
Member Author

@Turbo87 I've rolled back the version bump and added a comment pointing to the blocker. I've updated the PR title and description to reflect the new scope.

Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense for us to write a failing test for the blocker so that we don't update accidentally?

feel free to r=me :)

jtgeibel added 2 commits March 2, 2021 22:07
I plan to eventually land additional tests upstream. For now, this
provides a convenient way to ensure we don't regress on parsing
these formats.
@jtgeibel
Copy link
Member Author

jtgeibel commented Mar 3, 2021

@Turbo87 I've added a test that covers some scenarios where I observed breakage. I'll probably move this test upstream eventually, but it is worth including here for now.

I've also added a command to the crates-admin binary, that will test existing versions and dependency requirements in the database against our current version and the latest semver release.

let vers = versions.select(num).load(&conn)?;
test_versions(&vers);

let deps = dependencies.select(req).load(&conn)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure about loading all dependencies in a single query, but this is against the replica database and I expect memory usage to be somewhere around 100 MB so I think this is okay for our current scale.

Comment on lines +38 to +43
for version in versions {
if let Err(e) = semver::Version::parse(version) {
println!("Could not parse `{}` as a semver::Version: {}", version, e);
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for version in versions {
if let Err(e) = semver::Version::parse(version) {
println!("Could not parse `{}` as a semver::Version: {}", version, e);
}
}

this looks like a duplicate to me, no?

fn test_dependency_predicates(versions: &[String]) {
for version in versions {
if let Err(e) = semver::VersionReq::parse(version) {
println!("Could not parse `{}` as a semver::Version: {}", version, e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println!("Could not parse `{}` as a semver::Version: {}", version, e);
println!("Could not parse `{}` as a semver::VersionReq: {}", version, e);


if let Err(e) = semver_next::VersionReq::parse(version) {
println!(
"Could not parse `{}` as a semver_next::Version: {}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Could not parse `{}` as a semver_next::Version: {}",
"Could not parse `{}` as a semver_next::VersionReq: {}",

@bors
Copy link
Contributor

bors commented Mar 10, 2021

☔ The latest upstream changes (presumably #3391) made this pull request unmergeable. Please resolve the merge conflicts.

@Turbo87 Turbo87 mentioned this pull request Jun 1, 2021
bors added a commit that referenced this pull request Jun 8, 2021
Update `semver` to v1.x

This PR updates the `semver` crate to the new v1.0.0 release, which is basically a complete rewrite. The `diesel` feature no longer exists, but due to #3650 we don't need it anymore.

Closes #3338
@jtgeibel jtgeibel closed this Jun 8, 2021
@jtgeibel jtgeibel deleted the bring-back-latest-semver branch June 8, 2021 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants