Skip to content

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

Merged
merged 3 commits into from
Sep 25, 2023
Merged

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Sep 20, 2023

If CI needs to be distinguished from a dev build, we should add a different pre-release tag for those builds.

If CI needs to be distinguished from a dev build, we should add
a different pre-release tag for those builds.
@Emyrk Emyrk requested a review from mafredri September 20, 2023 15:19
@Emyrk Emyrk changed the title fix: all 'devel' builds should be considered 'dev' builds. fix: all 'devel' builds should be considered 'dev' builds Sep 20, 2023
@Emyrk Emyrk changed the title fix: all 'devel' builds should be considered 'dev' builds fix: consider all 'devel' builds as 'dev' builds Sep 20, 2023
@@ -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) {
Copy link
Member

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?

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 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.

Copy link
Member Author

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.

Comment on lines 73 to 77
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
Copy link
Member Author

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

@Emyrk Emyrk requested a review from mafredri September 25, 2023 18:41
@Emyrk Emyrk merged commit b6c5e94 into main Sep 25, 2023
@Emyrk Emyrk deleted the stevenmasley/is-dev branch September 25, 2023 18:59
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants