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

plugin-getter: don't rely only on version for list #12731

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

lbajolet-hashicorp
Copy link
Contributor

The plugins installed command list installed plugins, and prints out all their paths and versions.

The results are listed in a list of unique versions, in ascending order.

When listing plugins outside of a specific identifier however, because of the insertion in the list works, we only consider the version number, and ignore all subsequent insertions with the same version.

This causes a problem when we have multiple plugins installed with the same version, as only the first one that is discovered (typically the one with lexicographical precedence) gets inserted, and the others are ignored.

To support such a use case, we change the insertion routine to not only support versions, but also paths when finding a spot to insert the installation into.

@lbajolet-hashicorp lbajolet-hashicorp added backport/1.9.x Backport PR changes to `release/1.9.x` backport/1.10.x Backport PR changes to `release/1.10.x` labels Dec 4, 2023
@lbajolet-hashicorp lbajolet-hashicorp marked this pull request as ready for review December 4, 2023 15:45
@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner December 4, 2023 15:45
The plugins installed command list installed plugins, and prints out all
their paths and versions.

The results are listed in a list of unique versions, in ascending
order.

When listing plugins outside of a specific identifier however, because
of the insertion in the list works, we only consider the version number,
and ignore all subsequent insertions with the same version.

This causes a problem when we have multiple plugins installed with the
same version, as only the first one that is discovered (typically the
one with lexicographical precedence) gets inserted, and the others are
ignored.

To support such a use case, we change the insertion routine to not only
support versions, but also paths when finding a spot to insert the
installation into.
@lbajolet-hashicorp lbajolet-hashicorp removed the backport/1.9.x Backport PR changes to `release/1.9.x` label Dec 4, 2023
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

This looks good. I took a look at the historical to get a sense of why it was added it was just for display purposes but I don't see any issue with removing it given that the behavior appears to be the same for all tested cases.

@lbajolet-hashicorp lbajolet-hashicorp merged commit da97f46 into main Dec 5, 2023
11 checks passed
@lbajolet-hashicorp lbajolet-hashicorp deleted the installed_plugins_list_fix branch December 5, 2023 14:55
Copy link

github-actions bot commented Jan 5, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.10.x Backport PR changes to `release/1.10.x` bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants