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

Add semver 2 versioning in dependabot common #10434

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Add semver 2 versioning in dependabot common #10434

merged 2 commits into from
Aug 20, 2024

Conversation

amazimbe
Copy link
Contributor

@amazimbe amazimbe commented Aug 14, 2024

What are you trying to accomplish?

Implement semver 2 (https://semver.org/spec/v2.0.0.html) as the standard that dependabot follows for ecosystems that have no version standards; docker for example.

We have numerous errors and issues due to lack of clarity on what a valid dependency version should be and how to consistently compare versions within an ecosystem. Gem::Version has been inadequate so far and we think semver 2 will be an improvement especially for ecosystems without a well defined standard.

Malformed version errors and issues related to dependabot opening PRs to update a dependency to an unacceptable version, for example, a prerelease or beta release.

Anything you want to highlight for special attention from reviewers?

This one is the first in a series of PRs. Subsequent PRs will focus on improving ecosystem specific versioning by implementing the standard for the ecosystem where one exists; implementing deviations from semver 2 where applicable and improving test coverage which is below 50% in most cases.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@amazimbe amazimbe changed the title [WIP] Add semver 2 versioning in dependabot common Add semver 2 versioning in dependabot common Aug 15, 2024
@amazimbe amazimbe marked this pull request as ready for review August 15, 2024 13:51
@amazimbe amazimbe requested a review from a team as a code owner August 15, 2024 13:51
Copy link
Member

@jakecoffman jakecoffman left a comment

Choose a reason for hiding this comment

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

Can you write more tests with known valid/invalid values to make sure this implementation supports valid SemVer 2.0? For example, some folks have listed known values here: semver/semver#833

common/lib/dependabot/sem_version.rb Outdated Show resolved Hide resolved
Gemfile Outdated Show resolved Hide resolved
Why:
To be used as a standard for ecosystems that do not have a versioning
standard.
@amazimbe
Copy link
Contributor Author

I'm very happy with the code and branch test coverage both of which are now on 💯 %

@amazimbe amazimbe merged commit 86ab940 into main Aug 20, 2024
142 checks passed
@amazimbe amazimbe deleted the amazimbe/semver2 branch August 20, 2024 15:55
imajes pushed a commit to imajes/dependabot-core that referenced this pull request Sep 27, 2024
* Add semver 2 versioning in dependabot common

Why:
To be used as a standard for ecosystems that do not have a versioning
standard.

* Fix sorbet errors and address PR comments
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.

3 participants