Skip to content

feat: support template bundles as zip archives #11839

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

Merged
merged 7 commits into from
Jan 31, 2024
Merged

feat: support template bundles as zip archives #11839

merged 7 commits into from
Jan 31, 2024

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Jan 26, 2024

Related: #11687

This PR implements format conversion in coderd API to support templates submitted as .zip files. I know that we can store different template formats in the database, but I decided to keep template format consistent across all files including the already submitted ones.

Once this PR is merged, users should be able to POST /files with .zip content, and fetch .tar files converted to .zip on-the-fly using GET /files/<file_id>?format=zip.

@mtojek mtojek self-assigned this Jan 26, 2024
@mtojek mtojek marked this pull request as ready for review January 31, 2024 10:53
Copy link
Member

Choose a reason for hiding this comment

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

👍 nice tests

Comment on lines +189 to +191
case "": // no format? no conversion
rw.Header().Set("Content-Type", file.Mimetype)
_, _ = rw.Write(file.Data)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe no harm to allow explicitly setting ContentTypeTar?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about it, but it would be another place to adjust if we decide to natively support other formats.

@mtojek mtojek merged commit 13cbca6 into main Jan 31, 2024
@mtojek mtojek deleted the 11687-accept-zip branch January 31, 2024 13:49
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants