-
Notifications
You must be signed in to change notification settings - Fork 17
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
add version number generation logic and tests #63
Conversation
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.
Tests are thorough 🔥
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.
nice
majorVersionMultiplier int = 1000000 | ||
minorVersionMultiplier int = 1000 | ||
patchVersionMultiplier int = 1 |
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.
If we wanted to support a possible future date based form, do these need to have an additional zero?
Counterpoint, maybe not, so that any future 2024, is bigger than a potential 3.0
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.
yeah i like the counterpoint here!
// allowing for an easy "upgrade-only" detection configuration within intune. | ||
// Zero is returned for any case where the version cannot be reliably translated | ||
func VersionNum() int { | ||
semverMatch := semverRegexp.FindStringSubmatch(version) |
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 will make it impossible to differentiate between different builds (shas) of a given patch. Maybe that's okay
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.
yeah I couldn't think of a clean way to handle that, and given the intention felt like this would be alright
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.
going to merge this for now but happy to iterate if you have any ideas here!
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.
unix timestamp :)
I forget... Did the windows functionality include lexigraphical string sorts? I assume not
We need to be able to generate an integer value from our semver versioning strings. The value generated will be added to windows registry to assist with intune detection rules. We will add the built version automatically on MSI install, as well as set an additional key on startup with the currently running version after autoupdates.
I imagine we'll want to add this information to flares at some point too, so a helper function to translate the integer version back to a semver string is also included
For additional context see issue here