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

feat: add OS X ARM download url #795

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions web/elm/src/Assets.elm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ toPath asset =
OSX ->
"apple"

OSXArm ->
"apple-arm"

Windows ->
"windows"

Expand Down
22 changes: 20 additions & 2 deletions web/elm/src/Concourse/Cli.elm
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import Url.Builder

clis : List Cli
clis =
[ OSX, Windows, Linux ]
[ OSX, OSXArm, Windows, Linux ]


type Cli
= OSX
| OSXArm
| Windows
| Linux

Expand All @@ -23,15 +24,26 @@ downloadUrl cli =
OSX ->
"darwin"

OSXArm ->
"darwin"

Windows ->
"windows"

Linux ->
"linux"

archName =
case cli of
OSXArm ->
"arm"

_ ->
"amd64"
in
Endpoints.Cli
|> Endpoints.toString
[ Url.Builder.string "arch" "amd64"
[ Url.Builder.string "arch" archName
, Url.Builder.string "platform" platformName
]

Expand All @@ -44,6 +56,9 @@ label cli =
OSX ->
"OS X"

OSXArm ->
"OS X arm"

Windows ->
"Windows"

Expand All @@ -59,6 +74,9 @@ id cli =
OSX ->
"osx"

OSXArm ->
"osx-arm"

Windows ->
"windows"

Expand Down
5 changes: 5 additions & 0 deletions web/elm/tests/AssetsTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ toStringTests =
CliIcon OSX
|> toString
|> Expect.equal "/public/images/apple-logo.svg"
, test "OSXArm" <|
\_ ->
CliIcon OSXArm
|> toString
|> Expect.equal "/public/images/apple-arm-logo.svg"
, test "Windows" <|
\_ ->
CliIcon Windows
Expand Down
2 changes: 2 additions & 0 deletions web/elm/tests/CliTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ all =
List.map downloadUrl clis
|> Expect.equal
[ "/api/v1/cli?arch=amd64&platform=darwin"
, "/api/v1/cli?arch=arm&platform=darwin"

Choose a reason for hiding this comment

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

this should be arm64

fly-darwin-amd64.tgz fly-darwin-arm64.tgz fly-linux-amd64.tgz fly-windows-amd64.zip

, "/api/v1/cli?arch=amd64&platform=windows"
, "/api/v1/cli?arch=amd64&platform=linux"
]
Expand All @@ -21,6 +22,7 @@ all =
List.map label clis
|> Expect.equal
[ "Download OS X CLI"
, "Download OS X arm CLI"
, "Download Windows CLI"
, "Download Linux CLI"
]
Expand Down
11 changes: 9 additions & 2 deletions web/elm/tests/DashboardTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ all =
\_ ->
cliIcons
|> Expect.all
[ Query.count (Expect.equal 3)
[ Query.count (Expect.equal 4)
, Query.index 0
>> Query.has
[ attribute <|
Expand All @@ -1703,9 +1703,16 @@ all =
[ attribute <|
Attr.attribute
"aria-label"
"Download Windows CLI"
"Download OS X arm CLI"
]
, Query.index 2
>> Query.has
[ attribute <|
Attr.attribute
"aria-label"
"Download Windows CLI"
]
, Query.index 3
>> Query.has
[ attribute <|
Attr.attribute
Expand Down
14 changes: 13 additions & 1 deletion web/elm/tests/PipelineTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ all =
>> Query.has
[ style "background-image" <|
Assets.backgroundImage <|
Just (Assets.CliIcon Windows)
Just (Assets.CliIcon OSXArm)
, style "background-position" "50% 50%"
, style "background-repeat" "no-repeat"
, style "width" "12px"
Expand All @@ -363,6 +363,18 @@ all =
, attribute <| Attr.download ""
]
, Query.index 2
>> Query.has
[ style "background-image" <|
Assets.backgroundImage <|
Just (Assets.CliIcon Windows)
, style "background-position" "50% 50%"
, style "background-repeat" "no-repeat"
, style "width" "12px"
, style "height" "12px"
, style "display" "inline-block"
, attribute <| Attr.download ""
]
, Query.index 3
>> Query.has
[ style "background-image" <|
Assets.backgroundImage <|
Expand Down
11 changes: 9 additions & 2 deletions web/elm/tests/WelcomeCardTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ hasWelcomeCard setup =
, test "icons have descriptive ARIA labels" <|
cliIcons
>> Expect.all
[ Query.count (Expect.equal 3)
[ Query.count (Expect.equal 4)
, Query.index 0
>> Query.has
[ attribute <|
Expand All @@ -237,9 +237,16 @@ hasWelcomeCard setup =
[ attribute <|
Attr.attribute
"aria-label"
"Download Windows CLI"
"Download OS X arm CLI"
]
, Query.index 2
>> Query.has
[ attribute <|
Attr.attribute
"aria-label"
"Download Windows CLI"
]
, Query.index 3
>> Query.has
[ attribute <|
Attr.attribute
Expand Down
74 changes: 74 additions & 0 deletions web/public/images/apple-arm-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.