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

Regression in v3 or unexpected breaking behavior for NewConstraint(str) #143

Open
consideRatio opened this issue Dec 17, 2019 · 3 comments
Labels

Comments

@consideRatio
Copy link

consideRatio commented Dec 17, 2019

I experienced a downstream issue in Helm v3 that worked well in Helm v2. This issue relates to a change of masterminds/semver v2 to v3.

The downstream issue is described here briefly, but it is really an upstream issue of masterminds/semver, and is reproducible in this Go Playground.

In short, the 001 variant of the following versions are now causing an issue for the NewConstraint() function.

	var version = ""
	version = "0.9.0-alpha.100" // OK
	version = "0.9.0-alpha.001" // ERROR
	var err error
	
	_, err = semver.NewConstraint(version)
	if err != nil {
		fmt.Println(err)
	} else {
        	fmt.Println("Everything is OK!")
	}
@consideRatio consideRatio changed the title Regression in v3 or unexpected breaking behavior Regression in v3 or unexpected breaking behavior for NewConstraint(str) Dec 17, 2019
@consideRatio
Copy link
Author

It relates to these changes by @mattfarina, that excludes the use of versions with leading zeroes:
23f51de#diff-ccde124315e74e68fae484840d08dff5

@consideRatio
Copy link
Author

I've pinpointed that this is a breaking change to me only because now the semver specification is followed properly.

Numeric identifiers MUST NOT include leading zeroes.

ref: https://semver.org/#spec-item-9 (from item 9)

@mattfarina
Copy link
Member

@consideRatio sorry for the slow response. It's the holidays so responses are slow right now.

You are right about the semver lib now following the specification. That's the reason. Most of the changes to v3 are behavior based rather than Go API based. This is one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants