-
Notifications
You must be signed in to change notification settings - Fork 0
Support ZIP-packaged Linux release assets #20
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
Changes from all commits
363295e
6426a3b
9c5364c
b024efb
637b11e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,31 +39,42 @@ internal class EmbedCodePlatformSpec { | |
| fun `select Apple silicon asset`() { | ||
| assertEquals( | ||
| EmbedCodePlatform("embed-code-macos-arm64.zip", "embed-code-macos-arm64"), | ||
| EmbedCodePlatform.detect("Mac OS X", "aarch64"), | ||
| EmbedCodePlatform.detect("Mac OS X", "aarch64", "v1.2.4"), | ||
| ) | ||
| } | ||
|
|
||
| @Test | ||
| fun `select Intel macOS asset`() { | ||
| assertEquals( | ||
| EmbedCodePlatform("embed-code-macos-x64.zip", "embed-code-macos-x64"), | ||
| EmbedCodePlatform.detect("Mac OS X", "x86_64"), | ||
| EmbedCodePlatform.detect("Mac OS X", "x86_64", "v1.2.4"), | ||
| ) | ||
| } | ||
|
|
||
| @Test | ||
| fun `select Linux asset`() { | ||
| fun `select Linux ZIP asset for a new release`() { | ||
| assertEquals( | ||
| EmbedCodePlatform("embed-code-linux", "embed-code-linux"), | ||
| EmbedCodePlatform.detect("Linux", "amd64"), | ||
| EmbedCodePlatform("embed-code-linux.zip", "embed-code-linux"), | ||
| EmbedCodePlatform.detect("Linux", "amd64", "v1.2.5"), | ||
| ) | ||
| } | ||
|
|
||
| @Test | ||
| fun `select bare Linux asset for releases published before ZIP packaging`() { | ||
| listOf("v1.2.3", "v1.2.4").forEach { releaseTag -> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: the |
||
| assertEquals( | ||
| EmbedCodePlatform("embed-code-linux", "embed-code-linux"), | ||
| EmbedCodePlatform.detect("Linux", "amd64", releaseTag), | ||
| releaseTag, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| fun `select Windows asset`() { | ||
| assertEquals( | ||
| EmbedCodePlatform("embed-code-windows.exe", "embed-code-windows.exe"), | ||
| EmbedCodePlatform.detect("Windows 11", "amd64"), | ||
| EmbedCodePlatform.detect("Windows 11", "amd64", "v1.2.4"), | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -80,7 +91,7 @@ internal class EmbedCodePlatformSpec { | |
| @Test | ||
| fun `reject platform without release binary`() { | ||
| val error = assertThrows(GradleException::class.java) { | ||
| EmbedCodePlatform.detect("Linux", "aarch64") | ||
| EmbedCodePlatform.detect("Linux", "aarch64", "v1.2.4") | ||
| } | ||
|
|
||
| assertEquals( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should fix (design / diagnostics): this allowlist inverts the trust boundary — every release not listed, including any future embed-code-go release, is assumed to ship
embed-code-linux.zip. That is correct today (v1.2.3/v1.2.4 are the only releases and both ship the bare asset), but it hard-codes the assumption that every release after v1.2.4 packages Linux as a ZIP.If a future release ships the bare asset instead, or the ZIP switch slips past v1.2.5, Linux installs fail with a plain
HTTP 404 ... embed-code-linux.zip.addReleaseTagMigrationHintonly covers a missingvprefix, so nothing points the user at the packaging change.Consider (a) recording the cross-repo constraint — new embed-code-go releases must package Linux as
.zip— in PROJECT.md's compatibility/trust notes or a comment here, and/or (b) extending the download-failure hint to mention the bare↔ZIP fallback.