-
Notifications
You must be signed in to change notification settings - Fork 896
fix: consider all 'devel' builds as 'dev' builds #9794
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
Conversation
If CI needs to be distinguished from a dev build, we should add a different pre-release tag for those builds.
buildinfo/buildinfo.go
Outdated
@@ -65,16 +73,21 @@ func Version() string { | |||
func VersionsMatch(v1, v2 string) bool { | |||
// Developer versions are disregarded...hopefully they know what they are | |||
// doing. | |||
if strings.HasPrefix(v1, develPrefix) || strings.HasPrefix(v2, develPrefix) { | |||
if IsDevVersion(v1) || IsDevVersion(v2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this logic made sense for v0.0.0
, but for non-v0.0.0
we know approximately the version in question and we could require the minor version match. Or is there a use-case for returning a match for e.g. v1.1.1-devel
and v1.2.3
as tested below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking along the same lines. I will change it so only v0.0.0 matches all, and other versions do check major minor as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be pretty much the previous behavior.
func VersionsMatch(v1, v2 string) bool { | ||
// Developer versions are disregarded...hopefully they know what they are | ||
// doing. | ||
if IsDevVersion(v1) || IsDevVersion(v2) { | ||
// If no version is attached, then it is a dev build outside of CI. The version | ||
// will be disregarded... hopefully they know what they are doing. | ||
if strings.Contains(v1, noVersion) || strings.Contains(v2, noVersion) { | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should match the old behavior now @mafredri
If CI needs to be distinguished from a dev build, we should add a different pre-release tag for those builds.