Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Fix in_parallel step type (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-becker authored Jul 16, 2020
1 parent 80f53fb commit 350ca9d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This allows the user to more easily generate type-safe Concourse CI pipelines, t
For stability, users are encouraged to import from a tagged release, not from the master branch, and to watch for new releases. This project does not yet have rigorous testing set up for it and new commits on the master branch are prone to break compatibility and are almost sure to change the import hash for the expression, thus the releases are currently `v0.x`.
To import everything, use:
```
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.5.0/package.dhall sha256:7e130a8a6dac03d725a4b834ec95370da6ca32393266cec94fa00a79f6331e0c
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.5.1/package.dhall sha256:9f8d8948c30868b6343617212d04f3f3392eac77cf069461e62e9f1ad347ea6c
```

## Intended Usage
Expand All @@ -49,16 +49,16 @@ This introduces a question - what should the type of the `source` field be? Main
This repository allows the user to construct the type of `Resource` and of `ResourceType` based on a union that the downstream user constructs, consisting only of the resource types which the downstream user actually uses in their pipeline. This solves both the code-reusage problem, and keeps the implementation performant. For example:

```dhall
let Git = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.4.1/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558
let Git = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.5.1/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558

let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.4.1/resource-types/S3.dhall sha256:6e062defd2cf94a3f7840d1b09c7a832d0a92467f5924a2b812843c053a8eca5
let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.5.1/resource-types/S3.dhall sha256:6e062defd2cf94a3f7840d1b09c7a832d0a92467f5924a2b812843c053a8eca5

let Source = < Git : Git.Source.Type | S3 : S3.Source.Type >

let Version = < Git : Git.Version.Type | S3 : S3.Version.Type >

let Resource =
let import = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.4.1/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1
let import = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.5.1/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1

in import { Source, Version }

Expand Down
20 changes: 13 additions & 7 deletions Step.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,12 @@ let LoadVar
let InParallel
: (_params : HookParams { step : Type })
{ Type : Type
, Config :
{ Type : Type
, default : { limit : Optional Natural, fail_fast : Optional Bool }
}
, default :
{ limit : Optional Natural
, fail_fast : Optional Bool
, timeout : Optional Text
{ timeout : Optional Text
, attempts : Optional Natural
, tags : Optional (List Text)
, on_success : Optional _params.on_success
Expand All @@ -280,14 +282,18 @@ let InParallel
Hooks
_params.{ on_success, on_failure, on_abort, on_error, ensure }

in { Type =
let Config =
{ Type =
{ steps : List _params.step
, limit : Optional Natural
, fail_fast : Optional Bool
}
Hooks.Type
, default =
{ limit = None Natural, fail_fast = None Bool } Hooks.default
, default = { limit = None Natural, fail_fast = None Bool }
}

in { Type = { in_parallel : Config.Type } Hooks.Type
, Config
, default = Hooks.default
}

let Do
Expand Down
2 changes: 1 addition & 1 deletion package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
./ResourceType.dhall sha256:41ead24540852689f7d08893e4f354358a26696b1d96762e5b188615a031cc06
? ./ResourceType.dhall
, Step =
./Step.dhall sha256:bc27631c06ca1ff19deca0f6205216f9c2cfa7b1f9a0c202c84f7ebc83c20716
./Step.dhall sha256:496795f751710c5feb68f8e70f685a095e81d826d9e376359609103b966266de
? ./Step.dhall
, Task =
./Task.dhall sha256:d48a3c01812e363ce34a0928373c21658b92600e9e066a0c73014f4beefd61a4
Expand Down

0 comments on commit 350ca9d

Please sign in to comment.