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 latest unavailable checksum fail fix #12103

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

lbajolet-hashicorp
Copy link
Contributor

When Packer tries to get the latest version of a plugin, it will attempt to get the latest version from a list that is picked from the list of releases, fetched directly from Github.

What may happen is that a release is triggered, the assets are not yet available, including the checksum file, which is uploaded last, at the end of the release process.

This causes any client that tries to get the latest version of a plugin to fail during that window, as the code will fail immediately whenever a checksum file is unavailable.

To circumvent this issue, and fallback to a previous version, we acknowledge that a checksum was unavailable then trying to get the latest version, and fallback to a previous one.

Closes #11897

Verified

This commit was signed with the committer’s verified signature.
ychin Yee Cheng Chin
The mockPluginGetter would always succeed in returning a file from the
list of suggested releases, which does not let us test what happens when
a release is not yet complete, and a checksum file fails to be fetched
from the source.

This commit changes this behaviour so that we get an error when a
checksum does not exist, mirrorring what happens in real conditions.
@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner November 9, 2022 22:33
Copy link
Contributor

@JenGoldstrich JenGoldstrich left a comment

Choose a reason for hiding this comment

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

LGTM, I had some questions about this that I asked @lbajolet-hashicorp in slack

When Packer tries to get the latest version of a plugin, it will attempt
to get the latest version from a list that is picked from the list of
releases, fetched directly from Github.

What may happen is that a release is triggered, the assets are not yet
available, including the checksum file, which is uploaded last, at the
end of the release process.

This causes any client that tries to get the latest version of a plugin
to fail during that window, as the code will fail immediately whenever a
checksum file is unavailable.

To circumvent this issue, and fallback to a previous version, we
acknowledge that a checksum was unavailable then trying to get the
latest version, and fallback to a previous one.
@lbajolet-hashicorp lbajolet-hashicorp force-pushed the plugin_latest_unavailable_checksum_fail_fix branch from 87127f0 to 0900a54 Compare November 10, 2022 14:27
@nywilken nywilken added the bug label Nov 11, 2022
@nywilken nywilken added this to the 1.8.5 milestone Nov 11, 2022
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.

LGTM :shipit:

@nywilken nywilken merged commit 9d9f6d3 into main Nov 11, 2022
@nywilken nywilken deleted the plugin_latest_unavailable_checksum_fail_fix branch November 11, 2022 11:50
@github-actions
Copy link

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 Dec 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to install plugin while release process is running
3 participants