Open ethanwhite opened 7 years ago
👍 I think this is a great idea, the current implementation of that rule is here: https://github.com/librariesio/libraries.io/blob/1ff744f7748452ed110eb9d20b58084bda51b9c0/app/models/project.rb#L138
def follows_semver?
if versions.all.length > 0
versions.all?(&:follows_semver?)
elsif tags.published.length > 0
tags.published.all?(&:follows_semver?)
end
end
We should be able to just check, say the last 5 releases (ordered by published_at
) instead I think
I concur with this. Might want to add time component, or just check all releases in the latest Major version, perhaps? If you change versioning system to start following SemVer, it would make sense to bump the Major version, don't you think?
If you change versioning system to start following SemVer, it would make sense to bump the Major version, don't you think?
Not necessarily. In at least one case we were using 1.0
, 1.1
, etc., which isn't technically semver compliant due to the lack of a patch number, but the next release should presumably be 1.2.0
unless there are major backwards breaking changes.
The metric also ignores updates to the releases. In my case an old release x.y.zrc1 isn't following SemVer (should be x.y.z-rc1) but removing that release doesn't update the rank.
Enhancements and Features
Before submitting an enhancement or feature request:
I have a suggestion for improving the SourceRank scoring on the "Follows SemVer" metric. This metric currently rewards the use of proper semantic versioning from the very beginning of the project. My proposal is for this metric to reward the use of proper semantic versioning only for newer releases rather than requiring it for all releases. The limitation to the current approach is that for projects that weren't originally following semantic versioning the only way to pass this criteria would be to remove or rename old releases. This would be problematic from a history/reproducibility perspective. Making this criteria apply to the most recent or last few releases would provide easy encouragement for improving good practice in versioning releases because projects trying to improve their SourceRank could easily do so by shifting to good practice. It would also provide the proper information to consumers (sensu the Strategy doc), which is that the current version of the software follows this good practice.
I don't have any Ruby background, but would be open to submitting a PR if someone would point me in the right direction.