Compare commits

...

32 Commits

Author SHA1 Message Date
7179f8b598
Release dagger-core v0.2.6, dagger-codegen v0.2.7, dagger-sdk v0.2.12 2023-02-20 12:07:33 +01:00
1f77d90c0f
chore(sdk): ran clippy 2023-02-20 11:54:44 +01:00
8dfecf976c
fix(core): cli session keep session alive 2023-02-20 11:54:22 +01:00
085a998bc6
fix(ci): set path to local dagger sdk 2023-02-20 11:45:59 +01:00
1725c5188e
Release dagger-core v0.2.5, dagger-sdk v0.2.12, dagger-codegen v0.2.7 2023-02-20 11:42:14 +01:00
a13a2a9ecb
fix(all): race condition in process 2023-02-20 11:42:03 +01:00
b86710d71e
revert disable caching 2023-02-20 11:28:24 +01:00
08a2e30967
disable cache 2023-02-20 10:56:56 +01:00
b552dc5d75
chore(ci): with dagger v0.2.11 2023-02-20 10:50:48 +01:00
f869e574dd
Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 2023-02-20 10:48:05 +01:00
921e61b5e2
fix(core): remove blocking 2023-02-20 10:47:58 +01:00
17ec62a5d5
Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 2023-02-20 10:42:12 +01:00
803cfc4f8c
chore(sdk): ran clippy 2023-02-20 10:42:00 +01:00
8385aa8a15
fix(all): remove blocking 2023-02-20 10:40:53 +01:00
60f2cb2f2e
Release ci v0.1.0 2023-02-20 10:39:10 +01:00
30b7511e45
docs(ci): add changelog 2023-02-20 10:39:06 +01:00
06e2638e1f
chore(ci): with actual await on connect 2023-02-20 10:33:14 +01:00
48433cf368
chore(ci): with dagger v0.2.10 2023-02-20 10:30:33 +01:00
fc01755b99
Release dagger-rs v0.2.10 2023-02-20 10:29:00 +01:00
5cb97296b6
Release dagger-sdk v0.2.10 2023-02-20 10:28:24 +01:00
b100285312
fix(docs): changelog 2023-02-20 10:28:13 +01:00
8ed06476e5
Adjusting changelogs prior to release of dagger-sdk v0.2.10 2023-02-20 10:27:15 +01:00
09aa658b6f
update changelog 2023-02-20 10:27:09 +01:00
b436f27a53
Adjusting changelogs prior to release of dagger-sdk v0.2.10 2023-02-20 10:26:31 +01:00
577a293c67
Adjusting changelogs prior to release of dagger-sdk v0.2.10, dagger-rs v0.2.10 2023-02-20 10:26:05 +01:00
76bb1fcedd
Adjusting changelogs prior to release of dagger-sdk v0.2.10, dagger-rs v0.2.10 2023-02-20 10:25:45 +01:00
dc3487b840
Release dagger-rs v0.2.10 2023-02-20 10:25:15 +01:00
0c21d58c71
Release dagger-rs v0.2.10 2023-02-20 10:24:29 +01:00
e3fd23c64e
Release dagger-rs v0.2.10 2023-02-20 10:23:07 +01:00
82de43aa91
Release dagger-core v0.2.3, dagger-sdk v0.2.9, dagger-rs v0.2.10 2023-02-20 10:21:34 +01:00
f40ba9b403 fix(ci): with older version of dagger-sdk 2023-02-20 10:19:43 +01:00
75bc17e57d fix(core): Fix async panic on blocking #19
Replaced internal threads with tokio spawn functions
2023-02-20 10:19:43 +01:00
31 changed files with 676 additions and 309 deletions

View File

@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v0.2.10 (2023-02-20)
### Bug Fixes
- <csr-id-75bc17e57db222492c6ffd2dfe80208d2bda75c9/> Fix async panic on blocking #19
Replaced internal threads with tokio spawn functions
### Commit Statistics
<csr-read-only-do-not-edit/>
- 1 commit contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Fix async panic on blocking #19 ([`75bc17e`](https://github.com/kjuulh/dagger-rs/commit/75bc17e57db222492c6ffd2dfe80208d2bda75c9))
</details>
## v0.2.9 (2023-02-19) ## v0.2.9 (2023-02-19)
### New Features ### New Features

195
Cargo.lock generated
View File

@ -92,15 +92,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]] [[package]]
name = "bytes" name = "bytes"
version = "1.3.0" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.78" version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -114,7 +114,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"clap", "clap",
"color-eyre", "color-eyre",
"dagger-sdk 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "dagger-sdk",
"eyre", "eyre",
"tokio", "tokio",
] ]
@ -246,10 +246,10 @@ dependencies = [
[[package]] [[package]]
name = "dagger-codegen" name = "dagger-codegen"
version = "0.2.5" version = "0.2.7"
dependencies = [ dependencies = [
"convert_case", "convert_case",
"dagger-core 0.2.2", "dagger-core",
"eyre", "eyre",
"genco", "genco",
"itertools", "itertools",
@ -260,31 +260,7 @@ dependencies = [
[[package]] [[package]]
name = "dagger-core" name = "dagger-core"
version = "0.2.2" version = "0.2.6"
dependencies = [
"clap",
"dirs",
"eyre",
"flate2",
"genco",
"graphql-introspection-query",
"graphql_client",
"hex",
"hex-literal",
"platform-info",
"reqwest",
"serde",
"serde_json",
"sha2",
"tar",
"tempfile",
]
[[package]]
name = "dagger-core"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7efe798e1fe0d882e335aab8928d5deaafb0d27869b69ec7e9e4686548e11753"
dependencies = [ dependencies = [
"clap", "clap",
"dirs", "dirs",
@ -302,16 +278,17 @@ dependencies = [
"sha2", "sha2",
"tar", "tar",
"tempfile", "tempfile",
"tokio",
] ]
[[package]] [[package]]
name = "dagger-rs" name = "dagger-rs"
version = "0.2.9" version = "0.2.10"
dependencies = [ dependencies = [
"clap", "clap",
"color-eyre", "color-eyre",
"dagger-codegen", "dagger-codegen",
"dagger-core 0.2.2", "dagger-core",
"dirs", "dirs",
"eyre", "eyre",
"flate2", "flate2",
@ -327,14 +304,15 @@ dependencies = [
"sha2", "sha2",
"tar", "tar",
"tempfile", "tempfile",
"tokio",
] ]
[[package]] [[package]]
name = "dagger-sdk" name = "dagger-sdk"
version = "0.2.8" version = "0.2.12"
dependencies = [ dependencies = [
"base64", "base64",
"dagger-core 0.2.2", "dagger-core",
"derive_builder", "derive_builder",
"eyre", "eyre",
"futures", "futures",
@ -347,23 +325,6 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "dagger-sdk"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e90636d5b74ce8a62e8507a8d075c4d997c3123a1709596d0f97c3070f993b2d"
dependencies = [
"base64",
"dagger-core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"derive_builder",
"eyre",
"futures",
"gql_client",
"serde",
"serde_json",
"tokio",
]
[[package]] [[package]]
name = "darling" name = "darling"
version = "0.14.3" version = "0.14.3"
@ -474,9 +435,9 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]] [[package]]
name = "encoding_rs" name = "encoding_rs"
version = "0.8.31" version = "0.8.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
] ]
@ -514,23 +475,23 @@ dependencies = [
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "1.8.0" version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [ dependencies = [
"instant", "instant",
] ]
[[package]] [[package]]
name = "filetime" name = "filetime"
version = "0.2.19" version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"redox_syscall", "redox_syscall",
"windows-sys 0.42.0", "windows-sys 0.45.0",
] ]
[[package]] [[package]]
@ -810,9 +771,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]] [[package]]
name = "heck" name = "heck"
version = "0.4.0" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
@ -823,6 +784,12 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "hermit-abi"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
[[package]] [[package]]
name = "hex" name = "hex"
version = "0.4.3" version = "0.4.3"
@ -837,9 +804,9 @@ checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
[[package]] [[package]]
name = "http" name = "http"
version = "0.2.8" version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
@ -871,9 +838,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.14.23" version = "0.14.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@ -949,12 +916,12 @@ dependencies = [
[[package]] [[package]]
name = "io-lifetimes" name = "io-lifetimes"
version = "1.0.4" version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.42.0", "windows-sys 0.45.0",
] ]
[[package]] [[package]]
@ -965,14 +932,14 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
[[package]] [[package]]
name = "is-terminal" name = "is-terminal"
version = "0.4.2" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi 0.3.1",
"io-lifetimes", "io-lifetimes",
"rustix", "rustix",
"windows-sys 0.42.0", "windows-sys 0.45.0",
] ]
[[package]] [[package]]
@ -992,9 +959,9 @@ checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.60" version = "0.3.61"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"
dependencies = [ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
@ -1070,14 +1037,14 @@ dependencies = [
[[package]] [[package]]
name = "mio" name = "mio"
version = "0.8.5" version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
"wasi", "wasi",
"windows-sys 0.42.0", "windows-sys 0.45.0",
] ]
[[package]] [[package]]
@ -1104,7 +1071,7 @@ version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi 0.2.6",
"libc", "libc",
] ]
@ -1119,9 +1086,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.17.0" version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]] [[package]]
name = "openssl" name = "openssl"
@ -1266,9 +1233,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.50" version = "1.0.51"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -1395,16 +1362,16 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.36.7" version = "0.36.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"errno", "errno",
"io-lifetimes", "io-lifetimes",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys 0.42.0", "windows-sys 0.45.0",
] ]
[[package]] [[package]]
@ -1430,9 +1397,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]] [[package]]
name = "security-framework" name = "security-framework"
version = "2.8.1" version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c4437699b6d34972de58652c68b98cb5b53a4199ab126db8e20ec8ded29a721" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation", "core-foundation",
@ -1516,18 +1483,18 @@ dependencies = [
[[package]] [[package]]
name = "signal-hook-registry" name = "signal-hook-registry"
version = "1.4.0" version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
dependencies = [ dependencies = [
"libc", "libc",
] ]
[[package]] [[package]]
name = "slab" name = "slab"
version = "0.4.7" version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
dependencies = [ dependencies = [
"autocfg", "autocfg",
] ]
@ -1640,9 +1607,9 @@ dependencies = [
[[package]] [[package]]
name = "tinyvec_macros" name = "tinyvec_macros"
version = "0.1.0" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
@ -1677,9 +1644,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-native-tls" name = "tokio-native-tls"
version = "0.3.0" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [ dependencies = [
"native-tls", "native-tls",
"tokio", "tokio",
@ -1687,9 +1654,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-util" name = "tokio-util"
version = "0.7.4" version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
@ -1782,9 +1749,9 @@ dependencies = [
[[package]] [[package]]
name = "unicode-segmentation" name = "unicode-segmentation"
version = "1.10.0" version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
[[package]] [[package]]
name = "unreachable" name = "unreachable"
@ -1848,9 +1815,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.83" version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"wasm-bindgen-macro", "wasm-bindgen-macro",
@ -1858,9 +1825,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.83" version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
@ -1873,9 +1840,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.33" version = "0.4.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"js-sys", "js-sys",
@ -1885,9 +1852,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.83" version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@ -1895,9 +1862,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.83" version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1908,9 +1875,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.83" version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
[[package]] [[package]]
name = "wasm-streams" name = "wasm-streams"
@ -1927,9 +1894,9 @@ dependencies = [
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.60" version = "0.3.61"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "dagger-rs" name = "dagger-rs"
version = "0.2.9" version = "0.2.10"
edition = "2021" edition = "2021"
readme = "README.md" readme = "README.md"
license-file = "LICENSE.MIT" license-file = "LICENSE.MIT"
@ -19,8 +19,8 @@ members = [
] ]
[dependencies] [dependencies]
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.3" } dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.5" }
dagger-core = { path = "crates/dagger-core", version = "^0.2.2" } dagger-core = { path = "crates/dagger-core", version = "^0.2.3" }
clap = "4.1.6" clap = "4.1.6"
dirs = "4.0.0" dirs = "4.0.0"
@ -28,17 +28,15 @@ eyre = "0.6.8"
flate2 = { version = "1.0.25", features = ["zlib"] } flate2 = { version = "1.0.25", features = ["zlib"] }
genco = "0.17.3" genco = "0.17.3"
graphql-introspection-query = "0.2.0" graphql-introspection-query = "0.2.0"
graphql_client = { version = "0.12.0", features = [ graphql_client = { version = "0.12.0", features = ["reqwest"] }
"reqwest",
"reqwest-blocking",
] }
hex = "0.4.3" hex = "0.4.3"
hex-literal = "0.3.4" hex-literal = "0.3.4"
platform-info = "1.0.2" platform-info = "1.0.2"
reqwest = { version = "0.11.14", features = ["stream", "blocking", "deflate"] } reqwest = { version = "0.11.14", features = ["stream", "deflate"] }
serde = { version = "1.0.152", features = ["derive"] } serde = { version = "1.0.152", features = ["derive"] }
serde_json = "1.0.93" serde_json = "1.0.93"
sha2 = "0.10.6" sha2 = "0.10.6"
tar = "0.4.38" tar = "0.4.38"
tempfile = "3.3.0" tempfile = "3.3.0"
color-eyre = "0.6.2" color-eyre = "0.6.2"
tokio = { version = "1.25.0", features = ["full"] }

73
ci/CHANGELOG.md Normal file
View File

@ -0,0 +1,73 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v0.1.0 (2023-02-20)
<csr-id-06e2638e1fec0579d992792b94838629739bb1f0/>
<csr-id-48433cf36884ec9fa4cfed8bc5d4b3e8422c0ab9/>
<csr-id-45d646203704aed317ee2273b825ae708e83ca32/>
<csr-id-c35c104b49dc2f4456ed18e353bf8d4017cff640/>
### Chore
- <csr-id-06e2638e1fec0579d992792b94838629739bb1f0/> with actual await on connect
- <csr-id-48433cf36884ec9fa4cfed8bc5d4b3e8422c0ab9/> with dagger v0.2.10
- <csr-id-45d646203704aed317ee2273b825ae708e83ca32/> with async/await
- <csr-id-c35c104b49dc2f4456ed18e353bf8d4017cff640/> update ci to use dagger-sdk v0.2.6
### Documentation
- <csr-id-30b7511e454d4695cc1106a3d303b20aa8647fe4/> add changelog
### New Features
- <csr-id-691ecfbf52fa24a466d554b7b9701d67c33a42a5/> ci with dagger v0.2.2
- <csr-id-f42da8416a5450c7c3c924353c3cc9112afd18f0/> with sccache
### Bug Fixes
- <csr-id-f40ba9b40312a66b7699209fdddc0153ef139931/> with older version of dagger-sdk
- <csr-id-02006d40fc2c0383e0412c15c36db9af7eda991f/> without phantom data
- <csr-id-199fe16dbf426f287a7a5237c25bc16a4cae49bc/> update rust crate dagger-sdk to 0.2.1
- <csr-id-25fb9d4f24af8e7d6d81463c19a07a718b8a312a/> with secret
- <csr-id-d72313051b9b46a6eeaa909a11850b3d8fc75e81/> with test changes
### Commit Statistics
<csr-read-only-do-not-edit/>
- 16 commits contributed to the release over the course of 2 calendar days.
- 12 commits were understood as [conventional](https://www.conventionalcommits.org).
- 2 unique issues were worked on: [#7](https://github.com/kjuulh/dagger-rs/issues/7), [#8](https://github.com/kjuulh/dagger-rs/issues/8)
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **[#7](https://github.com/kjuulh/dagger-rs/issues/7)**
- add ci ([`4ce58a4`](https://github.com/kjuulh/dagger-rs/commit/4ce58a418c0ccef6cc0bfbaa878453f03c02dffb))
* **[#8](https://github.com/kjuulh/dagger-rs/issues/8)**
- feature with workspace ([`03e022f`](https://github.com/kjuulh/dagger-rs/commit/03e022fcaccd30ef0566dcfe31beb3473706bd1d))
* **Uncategorized**
- add changelog ([`30b7511`](https://github.com/kjuulh/dagger-rs/commit/30b7511e454d4695cc1106a3d303b20aa8647fe4))
- with actual await on connect ([`06e2638`](https://github.com/kjuulh/dagger-rs/commit/06e2638e1fec0579d992792b94838629739bb1f0))
- with dagger v0.2.10 ([`48433cf`](https://github.com/kjuulh/dagger-rs/commit/48433cf36884ec9fa4cfed8bc5d4b3e8422c0ab9))
- with older version of dagger-sdk ([`f40ba9b`](https://github.com/kjuulh/dagger-rs/commit/f40ba9b40312a66b7699209fdddc0153ef139931))
- with async/await ([`45d6462`](https://github.com/kjuulh/dagger-rs/commit/45d646203704aed317ee2273b825ae708e83ca32))
- update ci to use dagger-sdk v0.2.6 ([`c35c104`](https://github.com/kjuulh/dagger-rs/commit/c35c104b49dc2f4456ed18e353bf8d4017cff640))
- without phantom data ([`02006d4`](https://github.com/kjuulh/dagger-rs/commit/02006d40fc2c0383e0412c15c36db9af7eda991f))
- ci with dagger v0.2.2 ([`691ecfb`](https://github.com/kjuulh/dagger-rs/commit/691ecfbf52fa24a466d554b7b9701d67c33a42a5))
- with bin cache ([`3cb83bb`](https://github.com/kjuulh/dagger-rs/commit/3cb83bb79ceda52a0bf459850252e3902b7352fa))
- update rust crate dagger-sdk to 0.2.1 ([`199fe16`](https://github.com/kjuulh/dagger-rs/commit/199fe16dbf426f287a7a5237c25bc16a4cae49bc))
- with secret ([`25fb9d4`](https://github.com/kjuulh/dagger-rs/commit/25fb9d4f24af8e7d6d81463c19a07a718b8a312a))
- with sccache ([`f42da84`](https://github.com/kjuulh/dagger-rs/commit/f42da8416a5450c7c3c924353c3cc9112afd18f0))
- with test changes ([`d723130`](https://github.com/kjuulh/dagger-rs/commit/d72313051b9b46a6eeaa909a11850b3d8fc75e81))
- add ci ([`468bca4`](https://github.com/kjuulh/dagger-rs/commit/468bca4a69ec321b3ae1304d29d1be66a921a7db))
</details>

View File

@ -8,6 +8,6 @@ edition = "2021"
[dependencies] [dependencies]
clap = "4.1.6" clap = "4.1.6"
color-eyre = "0.6.2" color-eyre = "0.6.2"
dagger-sdk = "0.2.8" dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.12" }
eyre = "0.6.8" eyre = "0.6.8"
tokio = { version = "1.25.0", features = ["full"] } tokio = { version = "1.25.0", features = ["full"] }

View File

@ -12,7 +12,7 @@ async fn main() -> eyre::Result<()> {
.subcommand(clap::Command::new("release")) .subcommand(clap::Command::new("release"))
.get_matches(); .get_matches();
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
match matches.subcommand() { match matches.subcommand() {
Some(("pr", _)) => { Some(("pr", _)) => {

View File

@ -5,6 +5,59 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v0.2.7 (2023-02-20)
### Bug Fixes
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
### Commit Statistics
<csr-read-only-do-not-edit/>
- 2 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-core v0.2.5, dagger-sdk v0.2.12, dagger-codegen v0.2.7 ([`1725c51`](https://github.com/kjuulh/dagger-rs/commit/1725c5188e8a81069ec4a4de569484c921a94927))
- race condition in process ([`a13a2a9`](https://github.com/kjuulh/dagger-rs/commit/a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de))
</details>
## v0.2.6 (2023-02-20)
<csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/>
### Chore
- <csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/> ran clippy
### Commit Statistics
<csr-read-only-do-not-edit/>
- 3 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`f869e57`](https://github.com/kjuulh/dagger-rs/commit/f869e574dd788cd60e5b1b5d502bec68e300694c))
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`17ec62a`](https://github.com/kjuulh/dagger-rs/commit/17ec62a5d58232ff57391523b9851fb7b07d02ab))
- ran clippy ([`803cfc4`](https://github.com/kjuulh/dagger-rs/commit/803cfc4f8c4d72ab7d011be5523b3bfc6039de39))
</details>
## v0.2.5 (2023-02-19) ## v0.2.5 (2023-02-19)
### New Features ### New Features
@ -15,21 +68,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
```rust ```rust
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
// ... // ...
client.container().from("rust").publish("somewhere")?; client.container().from("rust").publish("somewhere")?;
// ... // ...
} }
// to // to
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
// ... // ...
client.container().from("rust").publish("somewhere").await?; client.container().from("rust").publish("somewhere").await?;
// ... // ...
} }
``` ```
@ -37,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<csr-read-only-do-not-edit/> <csr-read-only-do-not-edit/>
- 2 commits contributed to the release. - 3 commits contributed to the release.
- 2 commits were understood as [conventional](https://www.conventionalcommits.org). - 2 commits were understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages - 0 issues like '(#ID)' were seen in commit messages
@ -48,6 +101,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<details><summary>view details</summary> <details><summary>view details</summary>
* **Uncategorized** * **Uncategorized**
- Release dagger-sdk v0.2.8, dagger-codegen v0.2.5 ([`0499024`](https://github.com/kjuulh/dagger-rs/commit/04990247ba8e9d0555847f582fef14849dbedebf))
- add documentation strings ([`978ede6`](https://github.com/kjuulh/dagger-rs/commit/978ede68ae52f5b5150a2aa45b8d6e1fbbbee2f4)) - add documentation strings ([`978ede6`](https://github.com/kjuulh/dagger-rs/commit/978ede68ae52f5b5150a2aa45b8d6e1fbbbee2f4))
- Use async runtime instead of blocking. ([`9be6f43`](https://github.com/kjuulh/dagger-rs/commit/9be6f435d9ea39f31a8906e55dbd3e8b1e5ec598)) - Use async runtime instead of blocking. ([`9be6f43`](https://github.com/kjuulh/dagger-rs/commit/9be6f435d9ea39f31a8906e55dbd3e8b1e5ec598))
</details> </details>

View File

@ -1,6 +1,6 @@
[package] [package]
name = "dagger-codegen" name = "dagger-codegen"
version = "0.2.5" version = "0.2.7"
edition = "2021" edition = "2021"
readme = "README.md" readme = "README.md"
license-file = "LICENSE.MIT" license-file = "LICENSE.MIT"
@ -11,7 +11,7 @@ publish = true
[dependencies] [dependencies]
convert_case = "0.6.0" convert_case = "0.6.0"
dagger-core = { path = "../dagger-core", version = "^0.2.2" } dagger-core = { path = "../dagger-core", version = "^0.2.6" }
eyre = "0.6.8" eyre = "0.6.8"
genco = "0.17.3" genco = "0.17.3"

View File

@ -3,7 +3,7 @@ use genco::prelude::rust;
use genco::quote; use genco::quote;
use itertools::Itertools; use itertools::Itertools;
use crate::functions::{type_ref_is_optional, CommonFunctions}; use crate::functions::CommonFunctions;
use crate::rust::functions::{ use crate::rust::functions::{
field_options_struct_name, format_function, format_name, format_optional_args, field_options_struct_name, format_function, format_name, format_optional_args,
format_struct_comment, format_struct_name, format_struct_comment, format_struct_name,
@ -12,7 +12,7 @@ use crate::utility::OptionExt;
pub fn render_object(funcs: &CommonFunctions, t: &FullType) -> eyre::Result<rust::Tokens> { pub fn render_object(funcs: &CommonFunctions, t: &FullType) -> eyre::Result<rust::Tokens> {
let selection = rust::import("crate::querybuilder", "Selection"); let selection = rust::import("crate::querybuilder", "Selection");
let child = rust::import("std::process", "Child"); let child = rust::import("tokio::process", "Child");
let conn = rust::import("dagger_core::connect_params", "ConnectParams"); let conn = rust::import("dagger_core::connect_params", "ConnectParams");
let arc = rust::import("std::sync", "Arc"); let arc = rust::import("std::sync", "Arc");

View File

@ -5,6 +5,114 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v0.2.6 (2023-02-20)
### Chore
- <csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/> ran clippy
### Bug Fixes
- <csr-id-8dfecf976c5537cc2c03881de2b2fd2b2508683a/> cli session keep session alive
### Commit Statistics
<csr-read-only-do-not-edit/>
- 2 commits contributed to the release.
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- ran clippy ([`1f77d90`](https://github.com/kjuulh/dagger-rs/commit/1f77d90c0f0ac832a181b2322350ea395612986c))
- cli session keep session alive ([`8dfecf9`](https://github.com/kjuulh/dagger-rs/commit/8dfecf976c5537cc2c03881de2b2fd2b2508683a))
</details>
## v0.2.5 (2023-02-20)
### Bug Fixes
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
### Commit Statistics
<csr-read-only-do-not-edit/>
- 2 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-core v0.2.5, dagger-sdk v0.2.12, dagger-codegen v0.2.7 ([`1725c51`](https://github.com/kjuulh/dagger-rs/commit/1725c5188e8a81069ec4a4de569484c921a94927))
- race condition in process ([`a13a2a9`](https://github.com/kjuulh/dagger-rs/commit/a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de))
</details>
## v0.2.4 (2023-02-20)
### Bug Fixes
- <csr-id-8385aa8a15ff7b45fecc3462c482b998118c14eb/> remove blocking
- <csr-id-921e61b5e248013cb5fbf4f1bad3eef5a2673145/> remove blocking
### Commit Statistics
<csr-read-only-do-not-edit/>
- 4 commits contributed to the release.
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`f869e57`](https://github.com/kjuulh/dagger-rs/commit/f869e574dd788cd60e5b1b5d502bec68e300694c))
- remove blocking ([`921e61b`](https://github.com/kjuulh/dagger-rs/commit/921e61b5e248013cb5fbf4f1bad3eef5a2673145))
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`17ec62a`](https://github.com/kjuulh/dagger-rs/commit/17ec62a5d58232ff57391523b9851fb7b07d02ab))
- remove blocking ([`8385aa8`](https://github.com/kjuulh/dagger-rs/commit/8385aa8a15ff7b45fecc3462c482b998118c14eb))
</details>
## v0.2.3 (2023-02-20)
### Bug Fixes
- <csr-id-75bc17e57db222492c6ffd2dfe80208d2bda75c9/> Fix async panic on blocking #19
Replaced internal threads with tokio spawn functions
### Commit Statistics
<csr-read-only-do-not-edit/>
- 2 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-core v0.2.3, dagger-sdk v0.2.9, dagger-rs v0.2.10 ([`82de43a`](https://github.com/kjuulh/dagger-rs/commit/82de43aa91d6a5e09a247d1959137fdc36a40d35))
- Fix async panic on blocking #19 ([`75bc17e`](https://github.com/kjuulh/dagger-rs/commit/75bc17e57db222492c6ffd2dfe80208d2bda75c9))
</details>
## v0.2.2 (2023-02-19) ## v0.2.2 (2023-02-19)
### New Features ### New Features
@ -15,7 +123,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<csr-read-only-do-not-edit/> <csr-read-only-do-not-edit/>
- 1 commit contributed to the release. - 2 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org). - 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages - 0 issues like '(#ID)' were seen in commit messages
@ -26,6 +134,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<details><summary>view details</summary> <details><summary>view details</summary>
* **Uncategorized** * **Uncategorized**
- Release dagger-core v0.2.2, dagger-codegen v0.2.2, dagger-rs v0.2.8 ([`1638f15`](https://github.com/kjuulh/dagger-rs/commit/1638f15fba9d16512e8452f87b908d6dce417cd9))
- update to dagger v0.3.12 ([`6e5f407`](https://github.com/kjuulh/dagger-rs/commit/6e5f4074329ab0462445b31d4153f8497c483438)) - update to dagger v0.3.12 ([`6e5f407`](https://github.com/kjuulh/dagger-rs/commit/6e5f4074329ab0462445b31d4153f8497c483438))
</details> </details>

View File

@ -1,6 +1,6 @@
[package] [package]
name = "dagger-core" name = "dagger-core"
version = "0.2.2" version = "0.2.6"
edition = "2021" edition = "2021"
readme = "README.md" readme = "README.md"
license-file = "LICENSE.MIT" license-file = "LICENSE.MIT"
@ -16,16 +16,14 @@ eyre = "0.6.8"
flate2 = { version = "1.0.25", features = ["zlib"] } flate2 = { version = "1.0.25", features = ["zlib"] }
genco = "0.17.3" genco = "0.17.3"
graphql-introspection-query = "0.2.0" graphql-introspection-query = "0.2.0"
graphql_client = { version = "0.12.0", features = [ graphql_client = { version = "0.12.0", features = ["reqwest"] }
"reqwest",
"reqwest-blocking",
] }
hex = "0.4.3" hex = "0.4.3"
hex-literal = "0.3.4" hex-literal = "0.3.4"
platform-info = "1.0.2" platform-info = "1.0.2"
reqwest = { version = "0.11.14", features = ["stream", "blocking", "deflate"] } reqwest = { version = "0.11.14", features = ["stream", "deflate"] }
serde = { version = "1.0.152", features = ["derive"] } serde = { version = "1.0.152", features = ["derive"] }
serde_json = "1.0.93" serde_json = "1.0.93"
sha2 = "0.10.6" sha2 = "0.10.6"
tar = "0.4.38" tar = "0.4.38"
tempfile = "3.3.0" tempfile = "3.3.0"
tokio = { version = "1.25.0", features = ["full"] }

View File

@ -1,11 +1,12 @@
use std::{ use std::{
fs::canonicalize, fs::canonicalize,
io::{BufRead, BufReader},
path::PathBuf, path::PathBuf,
process::{Child, Stdio}, process::Stdio,
sync::{mpsc::sync_channel, Arc}, sync::Arc,
}; };
use tokio::io::AsyncBufReadExt;
use crate::{config::Config, connect_params::ConnectParams}; use crate::{config::Config, connect_params::ConnectParams};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
@ -20,12 +21,12 @@ impl CliSession {
} }
} }
pub fn connect( pub async fn connect(
&self, &self,
config: &Config, config: &Config,
cli_path: &PathBuf, cli_path: &PathBuf,
) -> eyre::Result<(ConnectParams, Child)> { ) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
self.inner.connect(config, cli_path) self.inner.connect(config, cli_path).await
} }
} }
@ -33,17 +34,17 @@ impl CliSession {
struct InnerCliSession {} struct InnerCliSession {}
impl InnerCliSession { impl InnerCliSession {
pub fn connect( pub async fn connect(
&self, &self,
config: &Config, config: &Config,
cli_path: &PathBuf, cli_path: &PathBuf,
) -> eyre::Result<(ConnectParams, Child)> { ) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
let proc = self.start(config, cli_path)?; let proc = self.start(config, cli_path)?;
let params = self.get_conn(proc)?; let params = self.get_conn(proc).await?;
Ok(params) Ok(params)
} }
fn start(&self, config: &Config, cli_path: &PathBuf) -> eyre::Result<std::process::Child> { fn start(&self, config: &Config, cli_path: &PathBuf) -> eyre::Result<tokio::process::Child> {
let mut args: Vec<String> = vec!["session".into()]; let mut args: Vec<String> = vec!["session".into()];
if let Some(workspace) = &config.workdir_path { if let Some(workspace) = &config.workdir_path {
let abs_path = canonicalize(workspace)?; let abs_path = canonicalize(workspace)?;
@ -54,7 +55,7 @@ impl InnerCliSession {
args.extend(["--project".into(), abs_path.to_string_lossy().to_string()]) args.extend(["--project".into(), abs_path.to_string_lossy().to_string()])
} }
let proc = std::process::Command::new( let proc = tokio::process::Command::new(
cli_path cli_path
.to_str() .to_str()
.ok_or(eyre::anyhow!("could not get string from path"))?, .ok_or(eyre::anyhow!("could not get string from path"))?,
@ -70,10 +71,10 @@ impl InnerCliSession {
return Ok(proc); return Ok(proc);
} }
fn get_conn( async fn get_conn(
&self, &self,
mut proc: std::process::Child, mut proc: tokio::process::Child,
) -> eyre::Result<(ConnectParams, std::process::Child)> { ) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
let stdout = proc let stdout = proc
.stdout .stdout
.take() .take()
@ -84,32 +85,27 @@ impl InnerCliSession {
.take() .take()
.ok_or(eyre::anyhow!("could not acquire stderr from child process"))?; .ok_or(eyre::anyhow!("could not acquire stderr from child process"))?;
let (sender, receiver) = sync_channel(1); let (sender, mut receiver) = tokio::sync::mpsc::channel(1);
std::thread::spawn(move || { tokio::spawn(async move {
let stdout_bufr = BufReader::new(stdout); let mut stdout_bufr = tokio::io::BufReader::new(stdout).lines();
for line in stdout_bufr.lines() { while let Ok(Some(line)) = stdout_bufr.next_line().await {
let out = line.as_ref().unwrap(); if let Ok(conn) = serde_json::from_str::<ConnectParams>(&line) {
if let Ok(conn) = serde_json::from_str::<ConnectParams>(&out) { sender.send(conn).await.unwrap();
sender.send(conn).unwrap();
}
if let Ok(line) = line {
println!("dagger: {}", line);
} }
println!("dagger: {}", line);
} }
}); });
std::thread::spawn(|| { tokio::spawn(async move {
let stderr_bufr = BufReader::new(stderr); let mut stdout_bufr = tokio::io::BufReader::new(stderr).lines();
for line in stderr_bufr.lines() { while let Ok(Some(line)) = stdout_bufr.next_line().await {
if let Ok(line) = line { println!("dagger: {}", line);
println!("dagger: {}", line);
}
//panic!("could not start dagger session: {}", out)
} }
}); });
let conn = receiver.recv()?; let conn = receiver.recv().await.ok_or(eyre::anyhow!("could not receive ok signal from dagger-engine"))?;
Ok((conn, proc)) Ok((conn, proc))
} }

View File

@ -119,7 +119,7 @@ impl Downloader {
Ok(path) Ok(path)
} }
pub fn get_cli(&self) -> eyre::Result<PathBuf> { pub async fn get_cli(&self) -> eyre::Result<PathBuf> {
let version = &self.version; let version = &self.version;
let mut cli_bin_path = self.cache_dir()?; let mut cli_bin_path = self.cache_dir()?;
cli_bin_path.push(format!("{CLI_BIN_PREFIX}{version}")); cli_bin_path.push(format!("{CLI_BIN_PREFIX}{version}"));
@ -129,7 +129,7 @@ impl Downloader {
if !cli_bin_path.exists() { if !cli_bin_path.exists() {
cli_bin_path = self cli_bin_path = self
.download(cli_bin_path) .download(cli_bin_path).await
.context("failed to download CLI from archive")?; .context("failed to download CLI from archive")?;
} }
@ -145,11 +145,11 @@ impl Downloader {
Ok(cli_bin_path) Ok(cli_bin_path)
} }
fn download(&self, path: PathBuf) -> eyre::Result<PathBuf> { async fn download(&self, path: PathBuf) -> eyre::Result<PathBuf> {
let expected_checksum = self.expected_checksum()?; let expected_checksum = self.expected_checksum().await?;
let mut bytes = vec![]; let mut bytes = vec![];
let actual_hash = self.extract_cli_archive(&mut bytes)?; let actual_hash = self.extract_cli_archive(&mut bytes).await?;
if expected_checksum != actual_hash { if expected_checksum != actual_hash {
eyre::bail!("downloaded CLI binary checksum doesn't match checksum from checksums.txt") eyre::bail!("downloaded CLI binary checksum doesn't match checksum from checksums.txt")
@ -165,15 +165,15 @@ impl Downloader {
Ok(path) Ok(path)
} }
fn expected_checksum(&self) -> eyre::Result<String> { async fn expected_checksum(&self) -> eyre::Result<String> {
let archive_url = &self.archive_url(); let archive_url = &self.archive_url();
let archive_path = PathBuf::from(&archive_url); let archive_path = PathBuf::from(&archive_url);
let archive_name = archive_path let archive_name = archive_path
.file_name() .file_name()
.ok_or(eyre::anyhow!("could not get file_name from archive_url"))?; .ok_or(eyre::anyhow!("could not get file_name from archive_url"))?;
let resp = reqwest::blocking::get(self.checksum_url())?; let resp = reqwest::get(self.checksum_url()).await?;
let resp = resp.error_for_status()?; let resp = resp.error_for_status()?;
for line in resp.text()?.lines() { for line in resp.text().await?.lines() {
let mut content = line.split_whitespace(); let mut content = line.split_whitespace();
let checksum = content let checksum = content
.next() .next()
@ -190,17 +190,13 @@ impl Downloader {
eyre::bail!("could not find a matching version or binary in checksums.txt") eyre::bail!("could not find a matching version or binary in checksums.txt")
} }
pub fn extract_cli_archive(&self, dest: &mut Vec<u8>) -> eyre::Result<String> { pub async fn extract_cli_archive(&self, dest: &mut Vec<u8>) -> eyre::Result<String> {
let archive_url = self.archive_url(); let archive_url = self.archive_url();
let resp = reqwest::blocking::get(&archive_url)?; let resp = reqwest::get(&archive_url).await?;
let mut resp = resp.error_for_status()?; let resp = resp.error_for_status()?;
let mut bytes = vec![]; let bytes = resp.bytes().await?;
let lines = resp.read_to_end(&mut bytes)?;
if lines == 0 {
eyre::bail!("nothing was downloaded")
}
let mut hasher = sha2::Sha256::new(); let mut hasher = sha2::Sha256::new();
hasher.update(bytes.as_slice()); hasher.update(&bytes);
let res = hasher.finalize(); let res = hasher.finalize();
println!("{}", hex::encode(&res)); println!("{}", hex::encode(&res));
@ -209,7 +205,7 @@ impl Downloader {
// TODO: Nothing for now // TODO: Nothing for now
todo!() todo!()
} else { } else {
self.extract_from_tar(bytes.as_slice(), dest)?; self.extract_from_tar(&bytes, dest)?;
} }
Ok(hex::encode(res)) Ok(hex::encode(res))
@ -240,9 +236,9 @@ impl Downloader {
mod test { mod test {
use super::Downloader; use super::Downloader;
#[test] #[tokio::test]
fn download() { async fn download() {
let cli_path = Downloader::new("0.3.10".into()).unwrap().get_cli().unwrap(); let cli_path = Downloader::new("0.3.10".into()).unwrap().get_cli().await.unwrap();
assert_eq!( assert_eq!(
Some("dagger-0.3.10"), Some("dagger-0.3.10"),

View File

@ -1,4 +1,4 @@
use std::process::Child;
use crate::{ use crate::{
cli_session::CliSession, config::Config, connect_params::ConnectParams, downloader::Downloader, cli_session::CliSession, config::Config, connect_params::ConnectParams, downloader::Downloader,
@ -11,17 +11,17 @@ impl Engine {
Self {} Self {}
} }
fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, Child)> { async fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
let cli = Downloader::new("0.3.12".into())?.get_cli()?; let cli = Downloader::new("0.3.12".into())?.get_cli().await?;
let cli_session = CliSession::new(); let cli_session = CliSession::new();
Ok(cli_session.connect(cfg, &cli)?) Ok(cli_session.connect(cfg, &cli).await?)
} }
pub fn start(&self, cfg: &Config) -> eyre::Result<(ConnectParams, Child)> { pub async fn start(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
// TODO: Add from existing session as well // TODO: Add from existing session as well
self.from_cli(cfg) self.from_cli(cfg).await
} }
} }
@ -32,10 +32,10 @@ mod tests {
use super::Engine; use super::Engine;
// TODO: these tests potentially have a race condition // TODO: these tests potentially have a race condition
#[test] #[tokio::test]
fn engine_can_start() { async fn engine_can_start() {
let engine = Engine::new(); let engine = Engine::new();
let params = engine.start(&Config::new(None, None, None, None)).unwrap(); let params = engine.start(&Config::new(None, None, None, None)).await.unwrap();
assert_ne!( assert_ne!(
params.0, params.0,

View File

@ -1,14 +1,14 @@
use crate::introspection::IntrospectionResponse; use crate::introspection::IntrospectionResponse;
use crate::{config::Config, engine::Engine, session::Session}; use crate::{config::Config, engine::Engine, session::Session};
pub fn get_schema() -> eyre::Result<IntrospectionResponse> { pub async fn get_schema() -> eyre::Result<IntrospectionResponse> {
let cfg = Config::new(None, None, None, None); let cfg = Config::new(None, None, None, None);
//TODO: Implement context for proc //TODO: Implement context for proc
let (conn, _proc) = Engine::new().start(&cfg)?; let (conn, _proc) = Engine::new().start(&cfg).await?;
let session = Session::new(); let session = Session::new();
let req_builder = session.start(&cfg, &conn)?; let req_builder = session.start(&cfg, &conn)?;
let schema = session.schema(req_builder)?; let schema = session.schema(req_builder).await?;
Ok(schema) Ok(schema)
} }
@ -17,8 +17,8 @@ pub fn get_schema() -> eyre::Result<IntrospectionResponse> {
mod tests { mod tests {
use super::get_schema; use super::get_schema;
#[test] #[tokio::test]
fn can_get_schema() { async fn can_get_schema() {
let _ = get_schema().unwrap(); let _ = get_schema().await.unwrap();
} }
} }

View File

@ -1,7 +1,7 @@
use graphql_client::GraphQLQuery; use graphql_client::GraphQLQuery;
use reqwest::{ use reqwest::{
blocking::{Client, RequestBuilder},
header::{HeaderMap, HeaderValue, ACCEPT, CONTENT_TYPE}, header::{HeaderMap, HeaderValue, ACCEPT, CONTENT_TYPE},
Client, RequestBuilder,
}; };
use crate::{config::Config, connect_params::ConnectParams, introspection::IntrospectionResponse}; use crate::{config::Config, connect_params::ConnectParams, introspection::IntrospectionResponse};
@ -37,14 +37,14 @@ impl Session {
Ok(req_builder) Ok(req_builder)
} }
pub fn schema(&self, req_builder: RequestBuilder) -> eyre::Result<IntrospectionResponse> { pub async fn schema(&self, req_builder: RequestBuilder) -> eyre::Result<IntrospectionResponse> {
let request_body: graphql_client::QueryBody<()> = graphql_client::QueryBody { let request_body: graphql_client::QueryBody<()> = graphql_client::QueryBody {
variables: (), variables: (),
query: introspection_query::QUERY, query: introspection_query::QUERY,
operation_name: introspection_query::OPERATION_NAME, operation_name: introspection_query::OPERATION_NAME,
}; };
let res = req_builder.json(&request_body).send()?; let res = req_builder.json(&request_body).send().await?;
if res.status().is_success() { if res.status().is_success() {
// do nothing // do nothing
@ -52,7 +52,7 @@ impl Session {
return Err(eyre::anyhow!("server error!")); return Err(eyre::anyhow!("server error!"));
} else { } else {
let status = res.status(); let status = res.status();
let error_message = match res.text() { let error_message = match res.text().await {
Ok(msg) => match serde_json::from_str::<serde_json::Value>(&msg) { Ok(msg) => match serde_json::from_str::<serde_json::Value>(&msg) {
Ok(json) => { Ok(json) => {
format!("HTTP {}\n{}", status, serde_json::to_string_pretty(&json)?) format!("HTTP {}\n{}", status, serde_json::to_string_pretty(&json)?)
@ -64,7 +64,7 @@ impl Session {
return Err(eyre::anyhow!(error_message)); return Err(eyre::anyhow!(error_message));
} }
let json: IntrospectionResponse = res.json()?; let json: IntrospectionResponse = res.json().await?;
Ok(json) Ok(json)
} }

View File

@ -3,7 +3,153 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v0.2.12 (2023-02-20)
### Chore
- <csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/> ran clippy
### Bug Fixes
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
### Commit Statistics
<csr-read-only-do-not-edit/>
- 3 commits contributed to the release.
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- ran clippy ([`1f77d90`](https://github.com/kjuulh/dagger-rs/commit/1f77d90c0f0ac832a181b2322350ea395612986c))
- Release dagger-core v0.2.5, dagger-sdk v0.2.12, dagger-codegen v0.2.7 ([`1725c51`](https://github.com/kjuulh/dagger-rs/commit/1725c5188e8a81069ec4a4de569484c921a94927))
- race condition in process ([`a13a2a9`](https://github.com/kjuulh/dagger-rs/commit/a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de))
</details>
## v0.2.11 (2023-02-20)
<csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/>
### Chore
- <csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/> ran clippy
### Commit Statistics
<csr-read-only-do-not-edit/>
- 3 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`f869e57`](https://github.com/kjuulh/dagger-rs/commit/f869e574dd788cd60e5b1b5d502bec68e300694c))
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`17ec62a`](https://github.com/kjuulh/dagger-rs/commit/17ec62a5d58232ff57391523b9851fb7b07d02ab))
- ran clippy ([`803cfc4`](https://github.com/kjuulh/dagger-rs/commit/803cfc4f8c4d72ab7d011be5523b3bfc6039de39))
</details>
## v0.2.10 (2023-02-20)
Alignment release
### Bug Fixes
- <csr-id-b100285312df522218bfd4bc00bbf41b857a81bf/> changelog
### Commit Statistics
<csr-read-only-do-not-edit/>
- 8 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-sdk v0.2.10 ([`5cb9729`](https://github.com/kjuulh/dagger-rs/commit/5cb97296b61677fb37e4bdb8519d30a484f93621))
- changelog ([`b100285`](https://github.com/kjuulh/dagger-rs/commit/b100285312df522218bfd4bc00bbf41b857a81bf))
- Adjusting changelogs prior to release of dagger-sdk v0.2.10 ([`8ed0647`](https://github.com/kjuulh/dagger-rs/commit/8ed06476e56f3290a419d2a67e7f25da575c63ad))
- update changelog ([`09aa658`](https://github.com/kjuulh/dagger-rs/commit/09aa658b6fb3c1e9a2de668c4a69bbe5be13202f))
- Adjusting changelogs prior to release of dagger-sdk v0.2.10 ([`b436f27`](https://github.com/kjuulh/dagger-rs/commit/b436f27a535f085bb8a4e66c7c4b3df461e74c21))
- Adjusting changelogs prior to release of dagger-sdk v0.2.10, dagger-rs v0.2.10 ([`577a293`](https://github.com/kjuulh/dagger-rs/commit/577a293c6777b9305a4f5fc7c3abee4aff4d74b5))
- Adjusting changelogs prior to release of dagger-sdk v0.2.10, dagger-rs v0.2.10 ([`76bb1fc`](https://github.com/kjuulh/dagger-rs/commit/76bb1fcedd03bd2d3b1e0f841f10325e4a85e108))
- Release dagger-rs v0.2.10 ([`dc3487b`](https://github.com/kjuulh/dagger-rs/commit/dc3487b840beb9543699f72d4282147e4ebc72f2))
</details>
## v0.2.10
([`577a293`](https://github.com/kjuulh/dagger-rs/commit/577a293c6777b9305a4f5fc7c3abee4aff4d74b5))
- Adjusting changelogs prior to release of dagger-sdk v0.2.10, dagger-rs
## v0.2.10
([`76bb1fc`](https://github.com/kjuulh/dagger-rs/commit/76bb1fcedd03bd2d3b1e0f841f10325e4a85e108))
- Release dagger-rs v0.2.10
([`dc3487b`](https://github.com/kjuulh/dagger-rs/commit/dc3487b840beb9543699f72d4282147e4ebc72f2))
</details>
## v0.2.10
([`577a293`](https://github.com/kjuulh/dagger-rs/commit/577a293c6777b9305a4f5fc7c3abee4aff4d74b5))
- Adjusting changelogs prior to release of dagger-sdk v0.2.10, dagger-rs
## v0.2.10
([`76bb1fc`](https://github.com/kjuulh/dagger-rs/commit/76bb1fcedd03bd2d3b1e0f841f10325e4a85e108))
- Release dagger-rs v0.2.10
([`dc3487b`](https://github.com/kjuulh/dagger-rs/commit/dc3487b840beb9543699f72d4282147e4ebc72f2))
</details>
## v0.2.9 (2023-02-20)
### Bug Fixes
- <csr-id-75bc17e57db222492c6ffd2dfe80208d2bda75c9/> Fix async panic on blocking
#19 Replaced internal threads with tokio spawn functions
### Commit Statistics
<csr-read-only-do-not-edit/>
- 2 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **Uncategorized**
- Release dagger-core v0.2.3, dagger-sdk v0.2.9, dagger-rs v0.2.10 ([`82de43a`](https://github.com/kjuulh/dagger-rs/commit/82de43aa91d6a5e09a247d1959137fdc36a40d35))
- Fix async panic on blocking #19 ([`75bc17e`](https://github.com/kjuulh/dagger-rs/commit/75bc17e57db222492c6ffd2dfe80208d2bda75c9))
</details>
## v0.2.8 (2023-02-19) ## v0.2.8 (2023-02-19)
@ -15,7 +161,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<csr-read-only-do-not-edit/> <csr-read-only-do-not-edit/>
- 1 commit contributed to the release. - 2 commits contributed to the release.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org). - 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages - 0 issues like '(#ID)' were seen in commit messages
@ -26,6 +172,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<details><summary>view details</summary> <details><summary>view details</summary>
* **Uncategorized** * **Uncategorized**
- Release dagger-sdk v0.2.8, dagger-codegen v0.2.5 ([`0499024`](https://github.com/kjuulh/dagger-rs/commit/04990247ba8e9d0555847f582fef14849dbedebf))
- add documentation strings ([`978ede6`](https://github.com/kjuulh/dagger-rs/commit/978ede68ae52f5b5150a2aa45b8d6e1fbbbee2f4)) - add documentation strings ([`978ede6`](https://github.com/kjuulh/dagger-rs/commit/978ede68ae52f5b5150a2aa45b8d6e1fbbbee2f4))
</details> </details>
@ -37,8 +184,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### New Features ### New Features
- <csr-id-9be6f435d9ea39f31a8906e55dbd3e8b1e5ec598/> Use async runtime instead of blocking. - <csr-id-9be6f435d9ea39f31a8906e55dbd3e8b1e5ec598/> Use async runtime instead
Default to using async runtime instead of blocking. I.e. of blocking. Default to using async runtime instead of blocking. I.e.
```rust ```rust
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
@ -109,8 +256,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### New Features ### New Features
- <csr-id-f29ff836cfd72d5e051ca6a71a230ba1e9933091/> without Some in _opts functions - <csr-id-f29ff836cfd72d5e051ca6a71a230ba1e9933091/> without Some in _opts
Option has been removed as a wrapper around opts. This makes it much functions Option has been removed as a wrapper around opts. This makes it much
more convenient to use more convenient to use
```rust ```rust
@ -119,12 +266,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
client.container_opts(ContainerOpts{}) client.container_opts(ContainerOpts{})
``` ```
The same options are still available, either an empty object can be The same options are still available, either an empty object can be passed, or
passed, or a non _opts function can be used a non _opts function can be used
- <csr-id-9762da895a164e30c5dc60e89a83e934ceae47ab/> with _opts methods - <csr-id-9762da895a164e30c5dc60e89a83e934ceae47ab/> with _opts methods Now all
Now all opt values enter into a _opts function instead of the original. opt values enter into a _opts function instead of the original. This avoids a
This avoids a lot of verbosity for both None in the case opts are lot of verbosity for both None in the case opts are unwanted, and Some() if
unwanted, and Some() if they actually are. they actually are.
They are used like so: They are used like so:
@ -134,13 +281,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
``` ```
Some from opts will be removed in a future commit/pr Some from opts will be removed in a future commit/pr
- <csr-id-94336d06378f035464e233b921dc3858070f582d/> move to &str instead of String and introduce builder. - <csr-id-94336d06378f035464e233b921dc3858070f582d/> move to &str instead of
This will make the api much easier to use, as we can now rely on "" String and introduce builder. This will make the api much easier to use, as we
instead of "".into() for normal string values. can now rely on "" instead of "".into() for normal string values.
Introduced builder as well, which makes it much easier to use *Opts, as Introduced builder as well, which makes it much easier to use *Opts, as it can
it can handle the building of that, and get the benefits from String -> handle the building of that, and get the benefits from String -> &str, as that
&str, as that is currently not allowed for optional values is currently not allowed for optional values
### Bug Fixes ### Bug Fixes
@ -176,7 +323,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bug Fixes ### Bug Fixes
- <csr-id-7d04ab1240e497e7804fed23a378d28c78f50a0a/> readme dagger-rs -> dagger-sdk - <csr-id-7d04ab1240e497e7804fed23a378d28c78f50a0a/> readme dagger-rs ->
dagger-sdk
### Commit Statistics ### Commit Statistics
@ -204,8 +352,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- <csr-id-19ed6c267f779b72430422c463ceed553f6fc618/> re-export through lib.rs - <csr-id-19ed6c267f779b72430422c463ceed553f6fc618/> re-export through lib.rs
this means that you can now use dagger_sdk::connect() instead of this means that you can now use dagger_sdk::connect() instead of
dagger_sdk::client::connect(); dagger_sdk::client::connect();
- <csr-id-de063eae858eb3335d2558a57ee6a88689635200/> with return result instead of unwrap - <csr-id-de063eae858eb3335d2558a57ee6a88689635200/> with return result instead
- <csr-id-5d667369900a47d3a6015cd3814c240bc5c54436/> remove unnecessary option returns of unwrap
- <csr-id-5d667369900a47d3a6015cd3814c240bc5c54436/> remove unnecessary option
returns
### Commit Statistics ### Commit Statistics

View File

@ -1,6 +1,6 @@
[package] [package]
name = "dagger-sdk" name = "dagger-sdk"
version = "0.2.8" version = "0.2.12"
edition = "2021" edition = "2021"
readme = "README.md" readme = "README.md"
license-file = "LICENSE.MIT" license-file = "LICENSE.MIT"
@ -11,7 +11,7 @@ publish = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
dagger-core = { path = "../dagger-core", version = "^0.2.2" } dagger-core = { path = "../dagger-core", version = "^0.2.6" }
base64 = "0.21.0" base64 = "0.21.0"
eyre = "0.6.8" eyre = "0.6.8"

View File

@ -2,7 +2,7 @@ use dagger_sdk::HostDirectoryOpts;
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
let host_source_dir = client.host().directory_opts( let host_source_dir = client.host().directory_opts(
"examples/build-the-application/app", "examples/build-the-application/app",

View File

@ -2,7 +2,7 @@ use rand::Rng;
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
let host_source_dir = client.host().directory_opts( let host_source_dir = client.host().directory_opts(
"./examples/caching/app", "./examples/caching/app",

View File

@ -4,7 +4,7 @@ use rand::Rng;
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
let context_dir = client let context_dir = client
.host() .host()

View File

@ -1,6 +1,6 @@
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
let version = client let version = client
.container() .container()

View File

@ -3,7 +3,7 @@ use rand::Rng;
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
let host_source_dir = client.host().directory_opts( let host_source_dir = client.host().directory_opts(
"examples/publish-the-application/app", "examples/publish-the-application/app",

View File

@ -3,7 +3,7 @@ use rand::Rng;
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
let output = "examples/publish-the-application/app/build"; let output = "examples/publish-the-application/app/build";
let host_source_dir = client.host().directory_opts( let host_source_dir = client.host().directory_opts(

View File

@ -2,7 +2,7 @@ use dagger_sdk::HostDirectoryOpts;
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?; let client = dagger_sdk::connect().await?;
let host_source_dir = client.host().directory_opts( let host_source_dir = client.host().directory_opts(
"examples/test-the-application/app", "examples/test-the-application/app",

View File

@ -13,9 +13,9 @@ use crate::querybuilder::query;
pub type DaggerConn = Arc<Query>; pub type DaggerConn = Arc<Query>;
pub fn connect() -> eyre::Result<DaggerConn> { pub async fn connect() -> eyre::Result<DaggerConn> {
let cfg = Config::default(); let cfg = Config::default();
let (conn, proc) = DaggerEngine::new().start(&cfg)?; let (conn, proc) = DaggerEngine::new().start(&cfg).await?;
Ok(Arc::new(Query { Ok(Arc::new(Query {
conn, conn,
@ -44,8 +44,8 @@ pub fn graphql_client(conn: &ConnectParams) -> gql_client::Client {
mod test { mod test {
use super::connect; use super::connect;
#[test] #[tokio::test]
fn test_connect() { async fn test_connect() {
let _ = connect().unwrap(); let _ = connect().await.unwrap();
} }
} }

View File

@ -3,8 +3,8 @@ use crate::querybuilder::Selection;
use dagger_core::connect_params::ConnectParams; use dagger_core::connect_params::ConnectParams;
use derive_builder::Builder; use derive_builder::Builder;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::process::Child;
use std::sync::Arc; use std::sync::Arc;
use tokio::process::Child;
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CacheId(String); pub struct CacheId(String);
@ -22,8 +22,8 @@ pub struct SecretId(String);
pub struct SocketId(String); pub struct SocketId(String);
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct BuildArg { pub struct BuildArg {
pub name: String,
pub value: String, pub value: String,
pub name: String,
} }
pub struct CacheVolume { pub struct CacheVolume {
pub proc: Arc<Child>, pub proc: Arc<Child>,
@ -35,7 +35,7 @@ impl CacheVolume {
pub async fn id( pub async fn id(
&self, &self,
) -> eyre::Result<CacheId> { ) -> eyre::Result<CacheId> {
let mut query = self.selection.select("id"); let query = self.selection.select("id");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -216,7 +216,7 @@ impl Container {
pub async fn default_args( pub async fn default_args(
&self, &self,
) -> eyre::Result<Vec<String>> { ) -> eyre::Result<Vec<String>> {
let mut query = self.selection.select("defaultArgs"); let query = self.selection.select("defaultArgs");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -239,7 +239,7 @@ impl Container {
pub async fn entrypoint( pub async fn entrypoint(
&self, &self,
) -> eyre::Result<Vec<String>> { ) -> eyre::Result<Vec<String>> {
let mut query = self.selection.select("entrypoint"); let query = self.selection.select("entrypoint");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -258,7 +258,7 @@ impl Container {
pub fn env_variables( pub fn env_variables(
&self, &self,
) -> Vec<EnvVariable> { ) -> Vec<EnvVariable> {
let mut query = self.selection.select("envVariables"); let query = self.selection.select("envVariables");
return vec![EnvVariable { return vec![EnvVariable {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -274,7 +274,7 @@ impl Container {
pub fn exec( pub fn exec(
&self, &self,
) -> Container { ) -> Container {
let mut query = self.selection.select("exec"); let query = self.selection.select("exec");
return Container { return Container {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -321,7 +321,7 @@ impl Container {
pub async fn exit_code( pub async fn exit_code(
&self, &self,
) -> eyre::Result<isize> { ) -> eyre::Result<isize> {
let mut query = self.selection.select("exitCode"); let query = self.selection.select("exitCode");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -405,7 +405,7 @@ impl Container {
pub fn fs( pub fn fs(
&self, &self,
) -> Directory { ) -> Directory {
let mut query = self.selection.select("fs"); let query = self.selection.select("fs");
return Directory { return Directory {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -417,7 +417,7 @@ impl Container {
pub async fn id( pub async fn id(
&self, &self,
) -> eyre::Result<ContainerId> { ) -> eyre::Result<ContainerId> {
let mut query = self.selection.select("id"); let query = self.selection.select("id");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -436,7 +436,7 @@ impl Container {
pub fn labels( pub fn labels(
&self, &self,
) -> Vec<Label> { ) -> Vec<Label> {
let mut query = self.selection.select("labels"); let query = self.selection.select("labels");
return vec![Label { return vec![Label {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -448,7 +448,7 @@ impl Container {
pub async fn mounts( pub async fn mounts(
&self, &self,
) -> eyre::Result<Vec<String>> { ) -> eyre::Result<Vec<String>> {
let mut query = self.selection.select("mounts"); let query = self.selection.select("mounts");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -499,7 +499,7 @@ impl Container {
pub async fn platform( pub async fn platform(
&self, &self,
) -> eyre::Result<Platform> { ) -> eyre::Result<Platform> {
let mut query = self.selection.select("platform"); let query = self.selection.select("platform");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -546,7 +546,7 @@ impl Container {
pub fn rootfs( pub fn rootfs(
&self, &self,
) -> Directory { ) -> Directory {
let mut query = self.selection.select("rootfs"); let query = self.selection.select("rootfs");
return Directory { return Directory {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -559,7 +559,7 @@ impl Container {
pub async fn stderr( pub async fn stderr(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("stderr"); let query = self.selection.select("stderr");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -568,7 +568,7 @@ impl Container {
pub async fn stdout( pub async fn stdout(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("stdout"); let query = self.selection.select("stdout");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -576,7 +576,7 @@ impl Container {
pub async fn user( pub async fn user(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("user"); let query = self.selection.select("user");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -588,7 +588,7 @@ impl Container {
pub fn with_default_args( pub fn with_default_args(
&self, &self,
) -> Container { ) -> Container {
let mut query = self.selection.select("withDefaultArgs"); let query = self.selection.select("withDefaultArgs");
return Container { return Container {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -1188,7 +1188,7 @@ impl Container {
pub async fn workdir( pub async fn workdir(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("workdir"); let query = self.selection.select("workdir");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1298,7 +1298,7 @@ impl Directory {
pub fn docker_build( pub fn docker_build(
&self, &self,
) -> Container { ) -> Container {
let mut query = self.selection.select("dockerBuild"); let query = self.selection.select("dockerBuild");
return Container { return Container {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -1345,7 +1345,7 @@ impl Directory {
pub async fn entries( pub async fn entries(
&self, &self,
) -> eyre::Result<Vec<String>> { ) -> eyre::Result<Vec<String>> {
let mut query = self.selection.select("entries"); let query = self.selection.select("entries");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1397,7 +1397,7 @@ impl Directory {
pub async fn id( pub async fn id(
&self, &self,
) -> eyre::Result<DirectoryId> { ) -> eyre::Result<DirectoryId> {
let mut query = self.selection.select("id"); let query = self.selection.select("id");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1703,7 +1703,7 @@ impl EnvVariable {
pub async fn name( pub async fn name(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("name"); let query = self.selection.select("name");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1711,7 +1711,7 @@ impl EnvVariable {
pub async fn value( pub async fn value(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("value"); let query = self.selection.select("value");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1727,7 +1727,7 @@ impl File {
pub async fn contents( pub async fn contents(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("contents"); let query = self.selection.select("contents");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1746,7 +1746,7 @@ impl File {
pub async fn id( pub async fn id(
&self, &self,
) -> eyre::Result<FileId> { ) -> eyre::Result<FileId> {
let mut query = self.selection.select("id"); let query = self.selection.select("id");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1754,7 +1754,7 @@ impl File {
pub fn secret( pub fn secret(
&self, &self,
) -> Secret { ) -> Secret {
let mut query = self.selection.select("secret"); let query = self.selection.select("secret");
return Secret { return Secret {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -1766,7 +1766,7 @@ impl File {
pub async fn size( pub async fn size(
&self, &self,
) -> eyre::Result<isize> { ) -> eyre::Result<isize> {
let mut query = self.selection.select("size"); let query = self.selection.select("size");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1806,7 +1806,7 @@ impl GitRef {
pub async fn digest( pub async fn digest(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("digest"); let query = self.selection.select("digest");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1818,7 +1818,7 @@ impl GitRef {
pub fn tree( pub fn tree(
&self, &self,
) -> Directory { ) -> Directory {
let mut query = self.selection.select("tree"); let query = self.selection.select("tree");
return Directory { return Directory {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -1878,7 +1878,7 @@ impl GitRepository {
pub async fn branches( pub async fn branches(
&self, &self,
) -> eyre::Result<Vec<String>> { ) -> eyre::Result<Vec<String>> {
let mut query = self.selection.select("branches"); let query = self.selection.select("branches");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -1916,7 +1916,7 @@ impl GitRepository {
pub async fn tags( pub async fn tags(
&self, &self,
) -> eyre::Result<Vec<String>> { ) -> eyre::Result<Vec<String>> {
let mut query = self.selection.select("tags"); let query = self.selection.select("tags");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2029,7 +2029,7 @@ impl Host {
pub fn workdir( pub fn workdir(
&self, &self,
) -> Directory { ) -> Directory {
let mut query = self.selection.select("workdir"); let query = self.selection.select("workdir");
return Directory { return Directory {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2074,7 +2074,7 @@ impl HostVariable {
pub fn secret( pub fn secret(
&self, &self,
) -> Secret { ) -> Secret {
let mut query = self.selection.select("secret"); let query = self.selection.select("secret");
return Secret { return Secret {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2086,7 +2086,7 @@ impl HostVariable {
pub async fn value( pub async fn value(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("value"); let query = self.selection.select("value");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2102,7 +2102,7 @@ impl Label {
pub async fn name( pub async fn name(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("name"); let query = self.selection.select("name");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2110,7 +2110,7 @@ impl Label {
pub async fn value( pub async fn value(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("value"); let query = self.selection.select("value");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2126,7 +2126,7 @@ impl Project {
pub fn extensions( pub fn extensions(
&self, &self,
) -> Vec<Project> { ) -> Vec<Project> {
let mut query = self.selection.select("extensions"); let query = self.selection.select("extensions");
return vec![Project { return vec![Project {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2138,7 +2138,7 @@ impl Project {
pub fn generated_code( pub fn generated_code(
&self, &self,
) -> Directory { ) -> Directory {
let mut query = self.selection.select("generatedCode"); let query = self.selection.select("generatedCode");
return Directory { return Directory {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2150,7 +2150,7 @@ impl Project {
pub async fn install( pub async fn install(
&self, &self,
) -> eyre::Result<bool> { ) -> eyre::Result<bool> {
let mut query = self.selection.select("install"); let query = self.selection.select("install");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2158,7 +2158,7 @@ impl Project {
pub async fn name( pub async fn name(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("name"); let query = self.selection.select("name");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2166,7 +2166,7 @@ impl Project {
pub async fn schema( pub async fn schema(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("schema"); let query = self.selection.select("schema");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2174,7 +2174,7 @@ impl Project {
pub async fn sdk( pub async fn sdk(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("sdk"); let query = self.selection.select("sdk");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2248,7 +2248,7 @@ impl Query {
pub fn container( pub fn container(
&self, &self,
) -> Container { ) -> Container {
let mut query = self.selection.select("container"); let query = self.selection.select("container");
return Container { return Container {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2287,7 +2287,7 @@ impl Query {
pub async fn default_platform( pub async fn default_platform(
&self, &self,
) -> eyre::Result<Platform> { ) -> eyre::Result<Platform> {
let mut query = self.selection.select("defaultPlatform"); let query = self.selection.select("defaultPlatform");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2299,7 +2299,7 @@ impl Query {
pub fn directory( pub fn directory(
&self, &self,
) -> Directory { ) -> Directory {
let mut query = self.selection.select("directory"); let query = self.selection.select("directory");
return Directory { return Directory {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2391,7 +2391,7 @@ impl Query {
pub fn host( pub fn host(
&self, &self,
) -> Host { ) -> Host {
let mut query = self.selection.select("host"); let query = self.selection.select("host");
return Host { return Host {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2495,7 +2495,7 @@ impl Query {
pub fn socket( pub fn socket(
&self, &self,
) -> Socket { ) -> Socket {
let mut query = self.selection.select("socket"); let query = self.selection.select("socket");
return Socket { return Socket {
proc: self.proc.clone(), proc: self.proc.clone(),
@ -2537,7 +2537,7 @@ impl Secret {
pub async fn id( pub async fn id(
&self, &self,
) -> eyre::Result<SecretId> { ) -> eyre::Result<SecretId> {
let mut query = self.selection.select("id"); let query = self.selection.select("id");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2545,7 +2545,7 @@ impl Secret {
pub async fn plaintext( pub async fn plaintext(
&self, &self,
) -> eyre::Result<String> { ) -> eyre::Result<String> {
let mut query = self.selection.select("plaintext"); let query = self.selection.select("plaintext");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }
@ -2561,7 +2561,7 @@ impl Socket {
pub async fn id( pub async fn id(
&self, &self,
) -> eyre::Result<SocketId> { ) -> eyre::Result<SocketId> {
let mut query = self.selection.select("id"); let query = self.selection.select("id");
query.execute(&graphql_client(&self.conn)).await query.execute(&graphql_client(&self.conn)).await
} }

View File

@ -2,7 +2,7 @@ use dagger_sdk::{connect, ContainerExecOptsBuilder};
#[tokio::test] #[tokio::test]
async fn test_example_container() { async fn test_example_container() {
let client = connect().unwrap(); let client = connect().await.unwrap();
let alpine = client.container().from("alpine:3.16.2"); let alpine = client.container().from("alpine:3.16.2");

View File

@ -13,11 +13,11 @@ impl Cli {
}) })
} }
pub fn execute(self, args: &[&str]) -> eyre::Result<()> { pub async fn execute(self, args: &[&str]) -> eyre::Result<()> {
let matches = self.cmd.get_matches_from(args); let matches = self.cmd.get_matches_from(args);
match matches.subcommand() { match matches.subcommand() {
Some(("generate", args)) => cli_generate::GenerateCommand::exec(args)?, Some(("generate", args)) => cli_generate::GenerateCommand::exec(args).await?,
_ => eyre::bail!("command missing"), _ => eyre::bail!("command missing"),
} }

View File

@ -17,12 +17,12 @@ impl GenerateCommand {
clap::Command::new("generate").arg(Arg::new("output").long("output")) clap::Command::new("generate").arg(Arg::new("output").long("output"))
} }
pub fn exec(arg_matches: &ArgMatches) -> eyre::Result<()> { pub async fn exec(arg_matches: &ArgMatches) -> eyre::Result<()> {
let cfg = Config::default(); let cfg = Config::default();
let (conn, _proc) = Engine::new().start(&cfg)?; let (conn, _proc) = Engine::new().start(&cfg).await?;
let session = Session::new(); let session = Session::new();
let req = session.start(&cfg, &conn)?; let req = session.start(&cfg, &conn)?;
let schema = session.schema(req)?; let schema = session.schema(req).await?;
let code = generate( let code = generate(
schema.into_schema().schema.unwrap(), schema.into_schema().schema.unwrap(),
Arc::new(RustGenerator {}), Arc::new(RustGenerator {}),

View File

@ -3,14 +3,15 @@ use cli::Cli;
pub mod cli; pub mod cli;
mod cli_generate; mod cli_generate;
fn main() -> eyre::Result<()> { #[tokio::main]
async fn main() -> eyre::Result<()> {
color_eyre::install().unwrap(); color_eyre::install().unwrap();
let args = std::env::args(); let args = std::env::args();
let args = args.collect::<Vec<String>>(); let args = args.collect::<Vec<String>>();
let args = args.iter().map(|s| s.as_str()).collect::<Vec<&str>>(); let args = args.iter().map(|s| s.as_str()).collect::<Vec<&str>>();
Cli::new()?.execute(args.as_slice())?; Cli::new()?.execute(args.as_slice()).await?;
Ok(()) Ok(())
} }