Compare commits

...

23 Commits

Author SHA1 Message Date
88b055cb47 Release dagger-sdk v0.2.14 2023-02-22 23:09:36 +01:00
e331ca0035 chore(sdk): fix whitespace 2023-02-22 23:09:20 +01:00
456f48389b Release dagger-codegen v0.2.8, dagger-sdk v0.2.13 2023-02-22 22:38:42 +01:00
7c3654d276 chore(sdk): ran clippy 2023-02-22 22:38:33 +01:00
266ad32dff feat(sdk): with clone 2023-02-22 22:38:15 +01:00
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
16 changed files with 827 additions and 855 deletions

56
Cargo.lock generated
View File

@@ -114,7 +114,7 @@ version = "0.1.0"
dependencies = [
"clap",
"color-eyre",
"dagger-sdk 0.2.9",
"dagger-sdk",
"eyre",
"tokio",
]
@@ -246,10 +246,10 @@ dependencies = [
[[package]]
name = "dagger-codegen"
version = "0.2.5"
version = "0.2.8"
dependencies = [
"convert_case",
"dagger-core 0.2.3",
"dagger-core",
"eyre",
"genco",
"itertools",
@@ -260,32 +260,7 @@ dependencies = [
[[package]]
name = "dagger-core"
version = "0.2.3"
dependencies = [
"clap",
"dirs",
"eyre",
"flate2",
"genco",
"graphql-introspection-query",
"graphql_client",
"hex",
"hex-literal",
"platform-info",
"reqwest",
"serde",
"serde_json",
"sha2",
"tar",
"tempfile",
"tokio",
]
[[package]]
name = "dagger-core"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e18641c2b159006cab7d750c05d3272f0cabfe9532df20b47076353aa73bf1e"
version = "0.2.6"
dependencies = [
"clap",
"dirs",
@@ -313,7 +288,7 @@ dependencies = [
"clap",
"color-eyre",
"dagger-codegen",
"dagger-core 0.2.3",
"dagger-core",
"dirs",
"eyre",
"flate2",
@@ -334,27 +309,10 @@ dependencies = [
[[package]]
name = "dagger-sdk"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8480af5a914d5ada1ff7fb8665b99b393e076acf8138af982170b2071cb3a9e3"
version = "0.2.14"
dependencies = [
"base64",
"dagger-core 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"derive_builder",
"eyre",
"futures",
"gql_client",
"serde",
"serde_json",
"tokio",
]
[[package]]
name = "dagger-sdk"
version = "0.2.10"
dependencies = [
"base64",
"dagger-core 0.2.3",
"dagger-core",
"derive_builder",
"eyre",
"futures",

View File

@@ -28,14 +28,11 @@ eyre = "0.6.8"
flate2 = { version = "1.0.25", features = ["zlib"] }
genco = "0.17.3"
graphql-introspection-query = "0.2.0"
graphql_client = { version = "0.12.0", features = [
"reqwest",
"reqwest-blocking",
] }
graphql_client = { version = "0.12.0", features = ["reqwest"] }
hex = "0.4.3"
hex-literal = "0.3.4"
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_json = "1.0.93"
sha2 = "0.10.6"

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]
clap = "4.1.6"
color-eyre = "0.6.2"
dagger-sdk = "0.2.6"
dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.14" }
eyre = "0.6.8"
tokio = { version = "1.25.0", features = ["full"] }

View File

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

View File

@@ -5,6 +5,85 @@ 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.2.8 (2023-02-22)
### New Features
- <csr-id-266ad32dff4c8957c7cdd291f9ef6f8a8c1d055c/> with clone
### Commit Statistics
<csr-read-only-do-not-edit/>
- 1 commit contributed to the release.
- 2 days passed between releases.
- 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**
- with clone ([`266ad32`](https://github.com/kjuulh/dagger-rs/commit/266ad32dff4c8957c7cdd291f9ef6f8a8c1d055c))
</details>
## v0.2.7 (2023-02-20)
### Bug Fixes
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
### 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.6, dagger-codegen v0.2.7, dagger-sdk v0.2.12 ([`7179f8b`](https://github.com/kjuulh/dagger-rs/commit/7179f8b598ef04e62925e39d3f55740253c01686))
- 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)
### New Features
@@ -15,21 +94,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
```rust
fn main() -> eyre::Result<()> {
// ...
// ...
client.container().from("rust").publish("somewhere")?;
client.container().from("rust").publish("somewhere")?;
// ...
// ...
}
// to
async fn main() -> eyre::Result<()> {
// ...
// ...
client.container().from("rust").publish("somewhere").await?;
client.container().from("rust").publish("somewhere").await?;
// ...
// ...
}
```
@@ -37,7 +116,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<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).
- 0 issues like '(#ID)' were seen in commit messages
@@ -48,6 +127,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<details><summary>view details</summary>
* **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))
- Use async runtime instead of blocking. ([`9be6f43`](https://github.com/kjuulh/dagger-rs/commit/9be6f435d9ea39f31a8906e55dbd3e8b1e5ec598))
</details>

View File

@@ -1,6 +1,6 @@
[package]
name = "dagger-codegen"
version = "0.2.5"
version = "0.2.8"
edition = "2021"
readme = "README.md"
license-file = "LICENSE.MIT"
@@ -11,7 +11,7 @@ publish = true
[dependencies]
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"
genco = "0.17.3"

View File

@@ -1,9 +1,8 @@
use dagger_core::introspection::{FullType, FullTypeFields, FullTypeFieldsArgs};
use genco::prelude::rust;
use genco::quote;
use itertools::Itertools;
use crate::functions::{type_ref_is_optional, CommonFunctions};
use crate::functions::CommonFunctions;
use crate::rust::functions::{
field_options_struct_name, format_function, format_name, format_optional_args,
format_struct_comment, format_struct_name,
@@ -12,11 +11,12 @@ use crate::utility::OptionExt;
pub fn render_object(funcs: &CommonFunctions, t: &FullType) -> eyre::Result<rust::Tokens> {
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 arc = rust::import("std::sync", "Arc");
Ok(quote! {
#[derive(Debug, Clone)]
pub struct $(t.name.pipe(|s| format_name(s))) {
pub proc: $arc<$child>,
pub selection: $selection,

View File

@@ -5,6 +5,88 @@ 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.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
@@ -16,7 +98,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<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).
- 0 issues like '(#ID)' were seen in commit messages
@@ -27,6 +109,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<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>

View File

@@ -1,6 +1,6 @@
[package]
name = "dagger-core"
version = "0.2.3"
version = "0.2.6"
edition = "2021"
readme = "README.md"
license-file = "LICENSE.MIT"
@@ -16,14 +16,11 @@ eyre = "0.6.8"
flate2 = { version = "1.0.25", features = ["zlib"] }
genco = "0.17.3"
graphql-introspection-query = "0.2.0"
graphql_client = { version = "0.12.0", features = [
"reqwest",
"reqwest-blocking",
] }
graphql_client = { version = "0.12.0", features = ["reqwest"] }
hex = "0.4.3"
hex-literal = "0.3.4"
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_json = "1.0.93"
sha2 = "0.10.6"

View File

@@ -1,11 +1,12 @@
use std::{
fs::canonicalize,
io::{BufRead, BufReader},
path::PathBuf,
process::{Child, Stdio},
process::Stdio,
sync::Arc,
};
use tokio::io::AsyncBufReadExt;
use crate::{config::Config, connect_params::ConnectParams};
#[derive(Clone, Debug)]
@@ -24,7 +25,7 @@ impl CliSession {
&self,
config: &Config,
cli_path: &PathBuf,
) -> eyre::Result<(ConnectParams, Child)> {
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
self.inner.connect(config, cli_path).await
}
}
@@ -37,13 +38,13 @@ impl InnerCliSession {
&self,
config: &Config,
cli_path: &PathBuf,
) -> eyre::Result<(ConnectParams, Child)> {
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
let proc = self.start(config, cli_path)?;
let params = self.get_conn(proc).await?;
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()];
if let Some(workspace) = &config.workdir_path {
let abs_path = canonicalize(workspace)?;
@@ -54,7 +55,7 @@ impl InnerCliSession {
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
.to_str()
.ok_or(eyre::anyhow!("could not get string from path"))?,
@@ -72,8 +73,8 @@ impl InnerCliSession {
async fn get_conn(
&self,
mut proc: std::process::Child,
) -> eyre::Result<(ConnectParams, std::process::Child)> {
mut proc: tokio::process::Child,
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
let stdout = proc
.stdout
.take()
@@ -87,25 +88,20 @@ impl InnerCliSession {
let (sender, mut receiver) = tokio::sync::mpsc::channel(1);
tokio::spawn(async move {
let stdout_bufr = BufReader::new(stdout);
for line in stdout_bufr.lines() {
let out = line.as_ref().unwrap();
if let Ok(conn) = serde_json::from_str::<ConnectParams>(&out) {
let mut stdout_bufr = tokio::io::BufReader::new(stdout).lines();
while let Ok(Some(line)) = stdout_bufr.next_line().await {
if let Ok(conn) = serde_json::from_str::<ConnectParams>(&line) {
sender.send(conn).await.unwrap();
}
if let Ok(line) = line {
println!("dagger: {}", line);
}
println!("dagger: {}", line);
}
});
tokio::spawn(async move {
let stderr_bufr = BufReader::new(stderr);
for line in stderr_bufr.lines() {
if let Ok(line) = line {
println!("dagger: {}", line);
}
//panic!("could not start dagger session: {}", out)
let mut stdout_bufr = tokio::io::BufReader::new(stderr).lines();
while let Ok(Some(line)) = stdout_bufr.next_line().await {
println!("dagger: {}", line);
}
});

View File

@@ -149,7 +149,7 @@ impl Downloader {
let expected_checksum = self.expected_checksum().await?;
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 {
eyre::bail!("downloaded CLI binary checksum doesn't match checksum from checksums.txt")
@@ -190,17 +190,13 @@ impl Downloader {
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 resp = reqwest::blocking::get(&archive_url)?;
let mut resp = resp.error_for_status()?;
let mut bytes = vec![];
let lines = resp.read_to_end(&mut bytes)?;
if lines == 0 {
eyre::bail!("nothing was downloaded")
}
let resp = reqwest::get(&archive_url).await?;
let resp = resp.error_for_status()?;
let bytes = resp.bytes().await?;
let mut hasher = sha2::Sha256::new();
hasher.update(bytes.as_slice());
hasher.update(&bytes);
let res = hasher.finalize();
println!("{}", hex::encode(&res));
@@ -209,7 +205,7 @@ impl Downloader {
// TODO: Nothing for now
todo!()
} else {
self.extract_from_tar(bytes.as_slice(), dest)?;
self.extract_from_tar(&bytes, dest)?;
}
Ok(hex::encode(res))

View File

@@ -1,4 +1,4 @@
use std::process::Child;
use crate::{
cli_session::CliSession, config::Config, connect_params::ConnectParams, downloader::Downloader,
@@ -11,7 +11,7 @@ impl Engine {
Self {}
}
async 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().await?;
let cli_session = CliSession::new();
@@ -19,7 +19,7 @@ impl Engine {
Ok(cli_session.connect(cfg, &cli).await?)
}
pub async 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
self.from_cli(cfg).await
}

View File

@@ -6,6 +6,113 @@ 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.2.14 (2023-02-22)
### Chore
- <csr-id-e331ca003546f4ebe00f33b65c3b45c6b0586514/> fix whitespace
### 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 whitespace ([`e331ca0`](https://github.com/kjuulh/dagger-rs/commit/e331ca003546f4ebe00f33b65c3b45c6b0586514))
</details>
## v0.2.13 (2023-02-22)
<csr-id-7c3654d276bb5f66e692a210cb60cdf46b19e226/>
<csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/>
### Chore
- <csr-id-7c3654d276bb5f66e692a210cb60cdf46b19e226/> ran clippy
- <csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/> ran clippy
### New Features
- <csr-id-266ad32dff4c8957c7cdd291f9ef6f8a8c1d055c/> with clone
### Bug Fixes
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
### Commit Statistics
<csr-read-only-do-not-edit/>
- 7 commits contributed to the release over the course of 2 calendar days.
- 2 days passed between releases.
- 4 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-codegen v0.2.8, dagger-sdk v0.2.13 ([`456f483`](https://github.com/kjuulh/dagger-rs/commit/456f48389b5514d7f743a600a7732fb02dd87418))
- ran clippy ([`7c3654d`](https://github.com/kjuulh/dagger-rs/commit/7c3654d276bb5f66e692a210cb60cdf46b19e226))
- with clone ([`266ad32`](https://github.com/kjuulh/dagger-rs/commit/266ad32dff4c8957c7cdd291f9ef6f8a8c1d055c))
- Release dagger-core v0.2.6, dagger-codegen v0.2.7, dagger-sdk v0.2.12 ([`7179f8b`](https://github.com/kjuulh/dagger-rs/commit/7179f8b598ef04e62925e39d3f55740253c01686))
- 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.12 (2023-02-20)
<csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/>
### Chore
- <csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/> ran clippy
### Bug Fixes
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
## 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
@@ -18,7 +125,7 @@ Alignment release
<csr-read-only-do-not-edit/>
- 7 commits contributed to the release.
- 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
@@ -29,6 +136,7 @@ Alignment release
<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))

View File

@@ -1,6 +1,6 @@
[package]
name = "dagger-sdk"
version = "0.2.10"
version = "0.2.14"
edition = "2021"
readme = "README.md"
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
[dependencies]
dagger-core = { path = "../dagger-core", version = "0.2.3" }
dagger-core = { path = "../dagger-core", version = "^0.2.6" }
base64 = "0.21.0"
eyre = "0.6.8"

File diff suppressed because it is too large Load Diff