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

version: don't remake semVer if not nil #233

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Conversation

lbajolet-hashicorp
Copy link
Contributor

The SemVer function of a PluginVersion returns the version.Version instance bound to the PluginVersion.

In former implementations of the structure, this could be nil in some cases, as only the version components were being registered, and the code would make sure that they were a valid semver version.

Recent changes reorganised this code by making the semVer attribute always present, so while theoretically it could be nil, this would indicate a manipulation error.

Therefore, we don't need to perform this check to re-create the semVer attribute, and by that change we fix the underlying issue that made semVer drop its pre-release/metadata parts when doing so.

The SemVer function of a PluginVersion returns the version.Version
instance bound to the PluginVersion.

In former implementations of the structure, this could be nil in some
cases, as only the version components were being registered, and the
code would make sure that they were a valid semver version.

Recent changes reorganised this code by making the semVer attribute
always present, so while theoretically it could be nil, this would
indicate a manipulation error.

Therefore, we don't need to perform this check to re-create the semVer
attribute, and by that change we fix the underlying issue that made
semVer drop its pre-release/metadata parts when doing so.
@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner April 16, 2024 19:49
Copy link
Contributor

@sylviamoss sylviamoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 lgtm

@lbajolet-hashicorp lbajolet-hashicorp merged commit 6345039 into main Apr 24, 2024
9 checks passed
@lbajolet-hashicorp lbajolet-hashicorp deleted the version_SemVer_fix branch April 24, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants