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

getmodules: support tbz2 module archives #36081

Merged
merged 11 commits into from
Nov 26, 2024

Conversation

bschaatsbergen
Copy link
Member

@bschaatsbergen bschaatsbergen commented Nov 22, 2024

Closes #36080

Our documentation suggests that files with the tar.bz2, tar.tbz2 and tbz2 extension can be fetched, unpacked and used as modules—however tbz2 is currently not supported.

In go-getter there is a decompressor for tar archives compressed with bzip2 that can handle both tar.bz2, tar.tbz2 and tbz2 files. See https://github.com/hashicorp/go-getter/blob/main/decompress_tbz2.go#L28-L48

This PR adds

  • Support for decompressing tbz2 files, enabling the unpacking of tbz2 module archives
  • Improves the ordering of defined go-getter getter sets.
  • Updates the documentation to reflect all possible go-getter getters and decompressors we have implemented.

The `tbz2` extension, a shorthand for `tar.bz2`, is supported for downloading and handling compressed archives in go-getter, which already treats both `tbz2` and `tar.bz2` as using the same bzip2 decompressor. This commit adds support for the `tbz2` decompressor when fetching modules from a source.

Signed-off-by: Bruno Schaatsbergen <git@bschaatsbergen.com>
- Grouped decompressor extensions (bz2, gzip, xz, zip).
- Grouped getters (protocol-based, cloud storage, version control, file-based).

Signed-off-by: Bruno Schaatsbergen <git@bschaatsbergen.com>
@bschaatsbergen bschaatsbergen marked this pull request as ready for review November 22, 2024 19:11
@bschaatsbergen bschaatsbergen requested a review from a team as a code owner November 22, 2024 19:11

// Bzip2
"bz2": new(getter.Bzip2Decompressor),
"tbz2": new(getter.TarBzip2Decompressor),
Copy link
Member Author

@bschaatsbergen bschaatsbergen Nov 22, 2024

Choose a reason for hiding this comment

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

For clarity, this is the tbz2 decompressor I'm adding.

Signed-off-by: Bruno Schaatsbergen <git@bschaatsbergen.com>
@bschaatsbergen bschaatsbergen requested a review from a team as a code owner November 22, 2024 19:41
@crw crw added the bug label Nov 22, 2024
rkoron007
rkoron007 previously approved these changes Nov 25, 2024
Copy link
Contributor

@rkoron007 rkoron007 left a comment

Choose a reason for hiding this comment

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

Added oxford commas, but besides that this look good from a style perspective ✨

website/docs/language/modules/sources.mdx Outdated Show resolved Hide resolved
website/docs/language/modules/sources.mdx Outdated Show resolved Hide resolved
website/docs/language/modules/sources.mdx Outdated Show resolved Hide resolved
bschaatsbergen and others added 2 commits November 25, 2024 19:56
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
bschaatsbergen and others added 2 commits November 25, 2024 19:56
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
Copy link
Contributor

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@DanielMSchmidt DanielMSchmidt merged commit 1221f33 into hashicorp:main Nov 26, 2024
7 of 8 checks passed
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@bschaatsbergen bschaatsbergen deleted the b/tbz2-getter branch November 26, 2024 13:45
Copy link
Contributor

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

Successfully merging this pull request may close these issues.

Unreadable module directory when module is .tbz2 archive
4 participants