-
Notifications
You must be signed in to change notification settings - Fork 541
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
Verify version during build #631
Conversation
This first build should fail, verifying the feature. Once it does, I'll update the value of |
package main | ||
|
||
// Version is the current version of Glide | ||
const Version = "0.13.0-dev" |
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.
can unexport this
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.
Might be useful for exterior libs to be able to get at this, in the case that they use glide as a lib.
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'd prefer to keep the visibility the same as it was previously as part of this change.
However since this is a main package, other's can't import it anyway.
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.
Point taken - I updated to maintain the old api!
i haven't thought through all the implications of this, but in general it seems like a great idea |
@breerly yes, that i understand - that's the intended effect. when i use "implication," i'm referring to potential second-order, unintended effects. this isn't a knock against the PR; it's just a caveat about the depth of my review. |
@@ -34,7 +34,7 @@ import ( | |||
"os" | |||
) | |||
|
|||
var version = "0.13.0-dev" | |||
const version = "0.13.0-dev" |
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.
By changing from a var
to const
the ldflags
for -X main.version=${VERSION}
no longer works in the make build
. This is why it was a var
in the first place.
I think this needs to be switched back.
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.
Sure
Once I like having this check. |
Got it, I'll switch back to |
@breerly thanks for the contribution. |
Let's verify that the
glide.Version
matches the changelog - this will force us to update this value before releasing and prevent #629 from happening again.To use this correctly, you must:
glide.Version
.-dev
can optionally be added toglide.Version
.We've used this strategy successfully in:
cc @mattfarina