Skip to content

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

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