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

Exclude yanked releases when choosing baseline version #255

Merged
merged 14 commits into from
Jan 3, 2023

Conversation

mgr0dzicki
Copy link
Collaborator

Closes #254

Extracts the selection of baseline version to a separate function, adds tests for it.

src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

I'm excited to have test coverage on this tricky logic! Thanks for putting it together.

It would be good to add two more test cases that check & document that when all versions are either yanked or pre-releases, cargo-semver-checks will pick the largest-numbered version regardless of whether it's been yanked or is a pre-release. (One test where it's yanked and one where it's a pre-release.)

src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
@mgr0dzicki
Copy link
Collaborator Author

It would be good to add two more test cases that check & document that when all versions are either yanked or pre-releases, cargo-semver-checks will pick the largest-numbered version regardless of whether it's been yanked or is a pre-release. (One test where it's yanked and one where it's a pre-release.)

Added! They revealed that my logic of handling yanked versions was not behaving as it should (it was ignoring yanked releases when there weren't any normal one). I fixed this.

src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
src/baseline.rs Outdated Show resolved Hide resolved
Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

This looks good to me! @tonowak if your concerns are also resolved, let's merge?

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.

Yanked release selected as baseline
3 participants