Compare commits

...

28 Commits

Author SHA1 Message Date
cc81124f89 Release dagger-sdk v0.2.4 2023-02-19 15:34:07 +01:00
7d04ab1240 fix(sdk): readme dagger-rs -> dagger-sdk 2023-02-19 15:33:48 +01:00
92350306b3 Release dagger-sdk v0.2.3, dagger-codegen v0.2.3, dagger-rs v0.2.9 2023-02-19 15:30:08 +01:00
19ed6c267f feat(sdk): re-export through lib.rs
this means that you can now use dagger_sdk::connect() instead of
dagger_sdk::client::connect();
2023-02-19 15:29:03 +01:00
de063eae85 feat(sdk): with return result instead of unwrap 2023-02-19 15:29:03 +01:00
5d66736990 feat(core,sdk): remove unnecessary option returns 2023-02-19 15:29:03 +01:00
9ada74960a feat(ci): add gha caching 2023-02-19 14:41:23 +01:00
90ab2e2b7d feat: clear release-cycle roadmap item 2023-02-19 14:37:23 +01:00
818ef6f74d feat(ci): lint pr 2023-02-19 12:57:32 +01:00
691ecfbf52 feat(ci): ci with dagger v0.2.2 2023-02-19 12:44:03 +01:00
e921ba1363 Release dagger-sdk v0.2.2 2023-02-19 12:30:59 +01:00
1638f15fba Release dagger-core v0.2.2, dagger-codegen v0.2.2, dagger-rs v0.2.8 2023-02-19 12:27:28 +01:00
10bc6f3846 fix(sdk): fixed fmt errors 2023-02-19 12:23:20 +01:00
6e5f407432 feat(sdk): update to dagger v0.3.12 2023-02-19 12:23:20 +01:00
3cb83bb79c with bin cache 2023-02-19 11:47:55 +01:00
Renovate Bot
199fe16dbf fix(deps): update rust crate dagger-sdk to 0.2.1 2023-02-18 17:34:50 +01:00
3cfd032a85 add cache 2023-02-18 17:13:41 +01:00
83ae5b476a fix(ci): fix github secret naming 2023-02-18 17:05:40 +01:00
60dfad0aaa run everywhere 2023-02-18 17:04:40 +01:00
25fb9d4f24 fix(ci): with secret 2023-02-18 17:03:37 +01:00
f42da8416a feat(ci): with sccache 2023-02-18 16:57:35 +01:00
98781f2496 test change 2023-02-18 16:06:34 +01:00
aa0c397b15 Release dagger-sdk v0.2.1 2023-02-18 16:05:10 +01:00
11a5247933 add dagger-sdk changelog 2023-02-18 16:04:39 +01:00
20c71189f6 Release dagger-rs v0.2.7, dagger-sdk v0.2.1 2023-02-18 16:03:59 +01:00
d72313051b fix: with test changes 2023-02-18 15:57:16 +01:00
a2036838de Release dagger-rs v0.2.6 2023-02-18 15:19:42 +01:00
4ebe0d12b5 fix: cleanup 2023-02-18 15:19:38 +01:00
30 changed files with 859 additions and 356 deletions

View File

@@ -1,8 +1,14 @@
name: ci
on:
pull_request:
push:
branches:
- "main"
env:
CARGO_TERM_COLOR: always
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
_EXPERIMENTAL_DAGGER_CACHE_CONFIG: type=gha;mode=max
jobs:
deploy:
runs-on: ubuntu-latest
@@ -11,5 +17,16 @@ jobs:
uses: actions/checkout@v3
- name: Update rust toolchain
run: rustup update stable && rustup default stable
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: "~/.cargo/bin/\n~/.cargo/registry/index/\n~/.cargo/registry/cache/\n~/.cargo/git/db/\ntarget/"
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
- name: Run dagger [CI]
run: cargo run -p ci -- pr

15
.github/workflows/lint-pr.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: "Lint PR"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -5,10 +5,107 @@ 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-17)
## v0.2.9 (2023-02-19)
### New Features
- <csr-id-19ed6c267f779b72430422c463ceed553f6fc618/> re-export through lib.rs
this means that you can now use dagger_sdk::connect() instead of
dagger_sdk::client::connect();
### 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**
- re-export through lib.rs ([`19ed6c2`](https://github.com/kjuulh/dagger-rs/commit/19ed6c267f779b72430422c463ceed553f6fc618))
</details>
## v0.2.8 (2023-02-19)
### New Features
- <csr-id-f42da8416a5450c7c3c924353c3cc9112afd18f0/> with sccache
### 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**
- with sccache ([`f42da84`](https://github.com/kjuulh/dagger-rs/commit/f42da8416a5450c7c3c924353c3cc9112afd18f0))
- test change ([`98781f2`](https://github.com/kjuulh/dagger-rs/commit/98781f2496deaea4bc13c9e90e60543b7daac9d7))
</details>
## v0.2.7 (2023-02-18)
### Bug Fixes
- <csr-id-d72313051b9b46a6eeaa909a11850b3d8fc75e81/> with test changes
### 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**
- with test changes ([`d723130`](https://github.com/kjuulh/dagger-rs/commit/d72313051b9b46a6eeaa909a11850b3d8fc75e81))
</details>
## v0.2.6 (2023-02-18)
With smart releaser
### Bug Fixes
- <csr-id-4ebe0d12b50028a8b79d8c76a2257c9c2b7b3429/> cleanup
### 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**
- cleanup ([`4ebe0d1`](https://github.com/kjuulh/dagger-rs/commit/4ebe0d12b50028a8b79d8c76a2257c9c2b7b3429))
</details>
## v0.2.5 (2023-02-18)
### Bug Fixes

32
Cargo.lock generated
View File

@@ -114,7 +114,7 @@ version = "0.1.0"
dependencies = [
"clap",
"color-eyre",
"dagger-sdk 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dagger-sdk 0.2.2",
"eyre",
]
@@ -245,10 +245,10 @@ dependencies = [
[[package]]
name = "dagger-codegen"
version = "0.2.1"
version = "0.2.3"
dependencies = [
"convert_case",
"dagger-core 0.2.1",
"dagger-core 0.2.2",
"eyre",
"genco",
"itertools",
@@ -259,9 +259,7 @@ dependencies = [
[[package]]
name = "dagger-core"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02a16b0e83ae5b88a3d4e2f3cf5149932cfcb3113e67f5579372e25d5dab5b53"
version = "0.2.2"
dependencies = [
"clap",
"dirs",
@@ -283,7 +281,9 @@ dependencies = [
[[package]]
name = "dagger-core"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7efe798e1fe0d882e335aab8928d5deaafb0d27869b69ec7e9e4686548e11753"
dependencies = [
"clap",
"dirs",
@@ -305,12 +305,12 @@ dependencies = [
[[package]]
name = "dagger-rs"
version = "0.2.5"
version = "0.2.9"
dependencies = [
"clap",
"color-eyre",
"dagger-codegen",
"dagger-core 0.2.1",
"dagger-core 0.2.2",
"dirs",
"eyre",
"flate2",
@@ -330,16 +330,17 @@ dependencies = [
[[package]]
name = "dagger-sdk"
version = "0.2.0"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1562df6d7d47fbb891331896ec9c04da1db129c1a9f073c40c33ab918f06e99"
dependencies = [
"base64",
"dagger-core 0.2.1",
"dagger-core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"eyre",
"futures",
"genco",
"gql_client",
"pretty_assertions",
"rand",
"serde",
"serde_json",
"tokio",
@@ -347,17 +348,16 @@ dependencies = [
[[package]]
name = "dagger-sdk"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e454c49b81feeb5c4057f54223cb8d7618e5d015ed835c3f3fa231fefa04e833"
version = "0.2.4"
dependencies = [
"base64",
"dagger-core 0.2.0",
"dagger-core 0.2.2",
"eyre",
"futures",
"genco",
"gql_client",
"pretty_assertions",
"rand",
"serde",
"serde_json",
"tokio",

View File

@@ -1,6 +1,6 @@
[package]
name = "dagger-rs"
version = "0.2.5"
version = "0.2.9"
edition = "2021"
readme = "README.md"
license-file = "LICENSE.MIT"
@@ -19,8 +19,8 @@ members = [
]
[dependencies]
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.1" }
dagger-core = { path = "crates/dagger-core", version = "^0.2.1" }
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.3" }
dagger-core = { path = "crates/dagger-core", version = "^0.2.2" }
clap = "4.1.6"
dirs = "4.0.0"

View File

@@ -21,7 +21,7 @@ See [dagger-sdk](./crates/dagger-sdk/README.md)
- [x] Context
- [x] Deserializer for nested response (bind)
- [x] Add codegen to hook into querier
- [ ] fix build / release cycle
- [x] fix build / release cycle
- [ ] general api stabilisation
- [x] document usage
- [ ] make async variant

View File

@@ -8,5 +8,5 @@ edition = "2021"
[dependencies]
clap = "4.1.6"
color-eyre = "0.6.2"
dagger-sdk = "0.2.0"
dagger-sdk = "0.2.2"
eyre = "0.6.8"

View File

@@ -8,14 +8,17 @@ fn main() -> eyre::Result<()> {
let matches = clap::Command::new("ci")
.subcommand_required(true)
.subcommand(clap::Command::new("pr"))
.subcommand(clap::Command::new("release"))
.get_matches();
let client = dagger_sdk::client::connect()?;
let base = select_base_image(client.clone());
match matches.subcommand() {
Some(("pr", _)) => return validate_pr(client, base),
Some(("pr", _)) => {
let base = select_base_image(client.clone());
return validate_pr(client, base);
}
Some(("release", subm)) => return release(client, subm),
Some(_) => {
panic!("invalid subcommand selected!")
}
@@ -25,6 +28,51 @@ fn main() -> eyre::Result<()> {
}
}
fn release(client: Arc<Query>, subm: &clap::ArgMatches) -> Result<(), color_eyre::Report> {
let src_dir = client.host().directory(
".".into(),
Some(HostDirectoryOpts {
exclude: Some(vec!["target/".into()]),
include: None,
}),
);
let base_image = client
.container(None)
.from("rust:latest".into())
.with_workdir("app".into())
.with_mounted_directory("/app/".into(), src_dir.id());
let container = base_image
.with_exec(
vec![
"cargo".into(),
"install".into(),
"cargo-smart-release".into(),
],
None,
)
.with_exec(
vec![
"cargo".into(),
"smart-release".into(),
"--execute".into(),
"--allow-fully-generated-changelogs".into(),
"--no-changelog-preview".into(),
"dagger-rs".into(),
"dagger-sdk".into(),
],
None,
);
let exit = container.exit_code();
if exit != 0 {
eyre::bail!("container failed with non-zero exit code");
}
println!("released pr succeeded!");
Ok(())
}
fn get_dependencies(client: Arc<Query>) -> Container {
let cargo_dir = client.host().directory(
".".into(),
@@ -49,11 +97,66 @@ fn get_dependencies(client: Arc<Query>) -> Container {
let cache_cargo_index_dir = client.cache_volume("cargo_index".into());
let cache_cargo_deps = client.cache_volume("cargo_deps".into());
let cache_cargo_bin = client.cache_volume("cargo_bin_cache".into());
let minio_url = "https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz".into();
let base_image = client
.container(None)
.from("rust:latest".into())
.with_workdir("app".into())
.with_exec(vec!["apt-get".into(), "update".into()], None)
.with_exec(
vec![
"apt-get".into(),
"install".into(),
"--yes".into(),
"libpq-dev".into(),
"wget".into(),
],
None,
)
.with_exec(vec!["wget".into(), minio_url], None)
.with_exec(
vec![
"tar".into(),
"xzf".into(),
"sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz".into(),
],
None,
)
.with_exec(
vec![
"mv".into(),
"sccache-v0.3.3-x86_64-unknown-linux-musl/sccache".into(),
"/usr/local/bin/sccache".into(),
],
None,
)
.with_exec(
vec!["chmod".into(), "+x".into(), "/usr/local/bin/sccache".into()],
None,
)
.with_env_variable("RUSTC_WRAPPER".into(), "/usr/local/bin/sccache".into())
.with_env_variable(
"AWS_ACCESS_KEY_ID".into(),
std::env::var("AWS_ACCESS_KEY_ID").unwrap_or("".into()),
)
.with_env_variable(
"AWS_SECRET_ACCESS_KEY".into(),
std::env::var("AWS_SECRET_ACCESS_KEY").unwrap_or("".into()),
)
.with_env_variable("SCCACHE_BUCKET".into(), "sccache".into())
.with_env_variable("SCCACHE_REGION".into(), "auto".into())
.with_env_variable(
"SCCACHE_ENDPOINT".into(),
"https://api-minio.front.kjuulh.io".into(),
)
.with_mounted_cache("~/.cargo/bin".into(), cache_cargo_bin.id(), None)
.with_mounted_cache("~/.cargo/registry/index".into(), cache_cargo_bin.id(), None)
.with_mounted_cache("~/.cargo/registry/cache".into(), cache_cargo_bin.id(), None)
.with_mounted_cache("~/.cargo/git/db".into(), cache_cargo_bin.id(), None)
.with_mounted_cache("target/".into(), cache_cargo_bin.id(), None)
.with_exec(
vec!["cargo".into(), "install".into(), "cargo-chef".into()],
None,

View File

@@ -5,6 +5,57 @@ 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.3 (2023-02-19)
### New Features
- <csr-id-de063eae858eb3335d2558a57ee6a88689635200/> with return result instead of unwrap
- <csr-id-5d667369900a47d3a6015cd3814c240bc5c54436/> remove unnecessary option returns
### 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**
- with return result instead of unwrap ([`de063ea`](https://github.com/kjuulh/dagger-rs/commit/de063eae858eb3335d2558a57ee6a88689635200))
- remove unnecessary option returns ([`5d66736`](https://github.com/kjuulh/dagger-rs/commit/5d667369900a47d3a6015cd3814c240bc5c54436))
</details>
## v0.2.2 (2023-02-19)
### New Features
- <csr-id-6e5f4074329ab0462445b31d4153f8497c483438/> update to dagger v0.3.12
### 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.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))
</details>
## v0.2.1 (2023-02-18)
<csr-id-6afe141d34308f18f9d46419931d2c9b822a7aef/>
@@ -21,7 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<csr-read-only-do-not-edit/>
- 34 commits contributed to the release over the course of 20 calendar days.
- 35 commits contributed to the release over the course of 20 calendar days.
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
- 2 unique issues were worked on: [#5](https://github.com/kjuulh/dagger-rs/issues/5), [#6](https://github.com/kjuulh/dagger-rs/issues/6)
@@ -36,6 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* **[#6](https://github.com/kjuulh/dagger-rs/issues/6)**
- feature/add impl ([`4a4c03f`](https://github.com/kjuulh/dagger-rs/commit/4a4c03f3c2ee7f6268c65976715e70767b4ea78d))
* **Uncategorized**
- Release dagger-core v0.2.1, dagger-codegen v0.2.1, dagger-rs v0.2.1 ([`1332bc8`](https://github.com/kjuulh/dagger-rs/commit/1332bc842ce2ea0254c651419813b63b36ca590c))
- add changelogs ([`a064684`](https://github.com/kjuulh/dagger-rs/commit/a064684fcf80196188a57d9ff9067c0b5769fb09))
- Adjusting changelogs prior to release of dagger-core v0.2.1, dagger-codegen v0.2.1, dagger-rs v0.2.1 ([`f4a20fd`](https://github.com/kjuulh/dagger-rs/commit/f4a20fda79063b29829cc899793775ba8cb17214))
- remove toolchain ([`f034528`](https://github.com/kjuulh/dagger-rs/commit/f03452840cf9260cd1d5e5aa8d7ee2897384c745))

View File

@@ -1,6 +1,6 @@
[package]
name = "dagger-codegen"
version = "0.2.1"
version = "0.2.3"
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.1" }
dagger-core = { path = "../dagger-core", version = "^0.2.2" }
eyre = "0.6.8"
genco = "0.17.3"

View File

@@ -1,12 +1,12 @@
use convert_case::{Case, Casing};
use dagger_core::introspection::FullTypeFields;
use dagger_core::introspection::{FullTypeFields, TypeRef};
use genco::prelude::rust;
use genco::quote;
use genco::tokens::quoted;
use crate::functions::{
type_field_has_optional, type_ref_is_list_of_objects, type_ref_is_object,
type_ref_is_optional, CommonFunctions,
type_field_has_optional, type_ref_is_list_of_objects, type_ref_is_object, type_ref_is_optional,
CommonFunctions,
};
use crate::utility::OptionExt;
@@ -37,7 +37,7 @@ pub fn format_function(funcs: &CommonFunctions, field: &FullTypeFields) -> Optio
let output_type = field
.type_
.pipe(|t| &t.type_ref)
.pipe(|t| funcs.format_output_type(t));
.pipe(|t| render_output_type(funcs, t));
Some(quote! {
$(signature)(
@@ -67,7 +67,7 @@ fn render_required_args(_funcs: &CommonFunctions, field: &FullTypeFields) -> Opt
let name = &s.input_value.name;
Some(quote! {
query = query.arg($(quoted(name)), $(n)).unwrap();
query = query.arg($(quoted(name)), $(n));
})
})
})
@@ -98,7 +98,7 @@ fn render_optional_args(_funcs: &CommonFunctions, field: &FullTypeFields) -> Opt
Some(quote! {
if let Some($(&n)) = opts.$(&n) {
query = query.arg($(quoted(name)), $(&n)).unwrap();
query = query.arg($(quoted(name)), $(&n));
}
})
})
@@ -122,6 +122,20 @@ fn render_optional_args(_funcs: &CommonFunctions, field: &FullTypeFields) -> Opt
}
}
fn render_output_type(funcs: &CommonFunctions, type_ref: &TypeRef) -> rust::Tokens {
let output_type = funcs.format_output_type(type_ref);
if type_ref_is_object(type_ref) || type_ref_is_list_of_objects(type_ref) {
return quote! {
$(output_type)
};
}
quote! {
eyre::Result<$output_type>
}
}
fn render_execution(funcs: &CommonFunctions, field: &FullTypeFields) -> rust::Tokens {
if let Some(true) = field.type_.pipe(|t| type_ref_is_object(&t.type_ref)) {
let output_type = funcs.format_output_type(&field.type_.as_ref().unwrap().type_ref);
@@ -163,7 +177,7 @@ fn render_execution(funcs: &CommonFunctions, field: &FullTypeFields) -> rust::To
let graphql_client = rust::import("crate::client", "graphql_client");
quote! {
query.execute(&$graphql_client(&self.conn)).unwrap().unwrap()
query.execute(&$graphql_client(&self.conn))
}
}

View File

@@ -10,7 +10,7 @@ fn render_enum_values(values: &FullType) -> Option<rust::Tokens> {
.map(|values| {
values
.into_iter()
.map(|val| quote! { $(val.name.as_ref()) })
.map(|val| quote! { $(val.name.as_ref()), })
})
.flatten()
.collect::<Vec<_>>();
@@ -25,7 +25,10 @@ fn render_enum_values(values: &FullType) -> Option<rust::Tokens> {
}
pub fn render_enum(t: &FullType) -> eyre::Result<rust::Tokens> {
let serialize = rust::import("serde", "Serialize");
Ok(quote! {
#[derive($serialize)]
pub enum $(t.name.as_ref()) {
$(render_enum_values(t))
}

View File

@@ -5,6 +5,30 @@ 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.2 (2023-02-19)
### New Features
- <csr-id-6e5f4074329ab0462445b31d4153f8497c483438/> update to dagger v0.3.12
### 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**
- update to dagger v0.3.12 ([`6e5f407`](https://github.com/kjuulh/dagger-rs/commit/6e5f4074329ab0462445b31d4153f8497c483438))
</details>
## v0.2.1 (2023-02-18)
### Bug Fixes
@@ -15,7 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<csr-read-only-do-not-edit/>
- 15 commits contributed to the release over the course of 19 calendar days.
- 16 commits contributed to the release over the course of 19 calendar days.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 2 unique issues were worked on: [#5](https://github.com/kjuulh/dagger-rs/issues/5), [#6](https://github.com/kjuulh/dagger-rs/issues/6)
@@ -30,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* **[#6](https://github.com/kjuulh/dagger-rs/issues/6)**
- feature/add impl ([`4a4c03f`](https://github.com/kjuulh/dagger-rs/commit/4a4c03f3c2ee7f6268c65976715e70767b4ea78d))
* **Uncategorized**
- Release dagger-core v0.2.1, dagger-codegen v0.2.1, dagger-rs v0.2.1 ([`1332bc8`](https://github.com/kjuulh/dagger-rs/commit/1332bc842ce2ea0254c651419813b63b36ca590c))
- add changelogs ([`a064684`](https://github.com/kjuulh/dagger-rs/commit/a064684fcf80196188a57d9ff9067c0b5769fb09))
- Adjusting changelogs prior to release of dagger-core v0.2.1, dagger-codegen v0.2.1, dagger-rs v0.2.1 ([`f4a20fd`](https://github.com/kjuulh/dagger-rs/commit/f4a20fda79063b29829cc899793775ba8cb17214))
- with publish ([`989d5bc`](https://github.com/kjuulh/dagger-rs/commit/989d5bc26036d46a199d939b5cbbe72aff2f8fb1))

View File

@@ -1,6 +1,6 @@
[package]
name = "dagger-core"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
readme = "README.md"
license-file = "LICENSE.MIT"

View File

@@ -12,7 +12,7 @@ impl Engine {
}
fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, Child)> {
let cli = Downloader::new("0.3.10".into())?.get_cli()?;
let cli = Downloader::new("0.3.12".into())?.get_cli()?;
let cli_session = CliSession::new();

View File

@@ -0,0 +1,158 @@
# 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.2.4 (2023-02-19)
### Bug Fixes
- <csr-id-7d04ab1240e497e7804fed23a378d28c78f50a0a/> readme dagger-rs -> dagger-sdk
### 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**
- readme dagger-rs -> dagger-sdk ([`7d04ab1`](https://github.com/kjuulh/dagger-rs/commit/7d04ab1240e497e7804fed23a378d28c78f50a0a))
</details>
## v0.2.3 (2023-02-19)
### New Features
- <csr-id-19ed6c267f779b72430422c463ceed553f6fc618/> re-export through lib.rs
this means that you can now use dagger_sdk::connect() instead of
dagger_sdk::client::connect();
- <csr-id-de063eae858eb3335d2558a57ee6a88689635200/> with return result instead of unwrap
- <csr-id-5d667369900a47d3a6015cd3814c240bc5c54436/> remove unnecessary option returns
### Commit Statistics
<csr-read-only-do-not-edit/>
- 4 commits contributed to the release.
- 3 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-sdk v0.2.3, dagger-codegen v0.2.3, dagger-rs v0.2.9 ([`9235030`](https://github.com/kjuulh/dagger-rs/commit/92350306b3f0da40b4fc6dcaffcd90b891e83f70))
- re-export through lib.rs ([`19ed6c2`](https://github.com/kjuulh/dagger-rs/commit/19ed6c267f779b72430422c463ceed553f6fc618))
- with return result instead of unwrap ([`de063ea`](https://github.com/kjuulh/dagger-rs/commit/de063eae858eb3335d2558a57ee6a88689635200))
- remove unnecessary option returns ([`5d66736`](https://github.com/kjuulh/dagger-rs/commit/5d667369900a47d3a6015cd3814c240bc5c54436))
</details>
## v0.2.2 (2023-02-19)
### New Features
- <csr-id-6e5f4074329ab0462445b31d4153f8497c483438/> update to dagger v0.3.12
### Bug Fixes
- <csr-id-10bc6f3846b65cc82c2fb343d8cfe921784bef1b/> fixed fmt errors
### 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-sdk v0.2.2 ([`e921ba1`](https://github.com/kjuulh/dagger-rs/commit/e921ba13638987ccf5beaa48c4be9be5fd879bd0))
- 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))
- fixed fmt errors ([`10bc6f3`](https://github.com/kjuulh/dagger-rs/commit/10bc6f3846b65cc82c2fb343d8cfe921784bef1b))
- update to dagger v0.3.12 ([`6e5f407`](https://github.com/kjuulh/dagger-rs/commit/6e5f4074329ab0462445b31d4153f8497c483438))
</details>
## v0.2.1 (2023-02-18)
### Bug Fixes
- <csr-id-789b0e69c8c53d0e86d9cec89ab5345507aad514/> update all dependencies
### Commit Statistics
<csr-read-only-do-not-edit/>
- 40 commits contributed to the release over the course of 20 calendar days.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 2 unique issues were worked on: [#5](https://github.com/kjuulh/dagger-rs/issues/5), [#6](https://github.com/kjuulh/dagger-rs/issues/6)
### Commit Details
<csr-read-only-do-not-edit/>
<details><summary>view details</summary>
* **[#5](https://github.com/kjuulh/dagger-rs/issues/5)**
- update all dependencies ([`789b0e6`](https://github.com/kjuulh/dagger-rs/commit/789b0e69c8c53d0e86d9cec89ab5345507aad514))
* **[#6](https://github.com/kjuulh/dagger-rs/issues/6)**
- feature/add impl ([`4a4c03f`](https://github.com/kjuulh/dagger-rs/commit/4a4c03f3c2ee7f6268c65976715e70767b4ea78d))
* **Uncategorized**
- Release dagger-sdk v0.2.1 ([`aa0c397`](https://github.com/kjuulh/dagger-rs/commit/aa0c397b15566840eb59ca6186c083f631cc460b))
- add dagger-sdk changelog ([`11a5247`](https://github.com/kjuulh/dagger-rs/commit/11a5247933736bc6a4c5300c29599c88597fefb7))
- Release dagger-rs v0.2.7, dagger-sdk v0.2.1 ([`20c7118`](https://github.com/kjuulh/dagger-rs/commit/20c71189f6d5d978286ee16f8e958c6045756d80))
- Adjusting changelogs prior to release of dagger-core v0.2.1, dagger-codegen v0.2.1, dagger-rs v0.2.1 ([`f4a20fd`](https://github.com/kjuulh/dagger-rs/commit/f4a20fda79063b29829cc899793775ba8cb17214))
- with actual versions ([`7153c24`](https://github.com/kjuulh/dagger-rs/commit/7153c24f0105a05f170efd10ef2535d83ce0c87e))
- with publish ([`989d5bc`](https://github.com/kjuulh/dagger-rs/commit/989d5bc26036d46a199d939b5cbbe72aff2f8fb1))
- with repo ([`e5383b5`](https://github.com/kjuulh/dagger-rs/commit/e5383b51f3b290a87b729929c377e93bda3873e0))
- with wildcard version ([`533b9df`](https://github.com/kjuulh/dagger-rs/commit/533b9dfef0165c514127a8437d08daf52adf5739))
- cargo version 0.2.0 ([`bec62de`](https://github.com/kjuulh/dagger-rs/commit/bec62de62ff5638428174e232a36eee3ddd0f5ef))
- bump version ([`36b0ecd`](https://github.com/kjuulh/dagger-rs/commit/36b0ecdabf4c220cffb2d0660fb6480387e3249a))
- document usage ([`578c2a6`](https://github.com/kjuulh/dagger-rs/commit/578c2a68830eb40da888823a8770af4a764ed4c7))
- fix all clippy ([`6be8482`](https://github.com/kjuulh/dagger-rs/commit/6be8482b461e098384bbf1371ed7d67b259197fa))
- add with dockerfile ([`0cbd179`](https://github.com/kjuulh/dagger-rs/commit/0cbd1790b0b4030c68f0a0dd619325da26f14f60))
- with caching ([`728840c`](https://github.com/kjuulh/dagger-rs/commit/728840ca8e48b8bec66da4e5fa677bfa60d1d147))
- add more quickstart ([`59e2572`](https://github.com/kjuulh/dagger-rs/commit/59e2572173872c8091a0613a387a01e0cccc51bf))
- build the application ([`d894def`](https://github.com/kjuulh/dagger-rs/commit/d894def70c85ff2fc567bf614e3be6f4134965e2))
- add test-the-application ([`cb9a4dd`](https://github.com/kjuulh/dagger-rs/commit/cb9a4dd84fc13ef03ca3ad539646e95c3c047676))
- with println ([`d1726a0`](https://github.com/kjuulh/dagger-rs/commit/d1726a052a6dc4e57f364864446cab3cbda7e0bf))
- unpack response ([`3b5b59b`](https://github.com/kjuulh/dagger-rs/commit/3b5b59ba1c20cc68218dc5c0af18ff7a78f6953d))
- tested full flow initially ([`7a008be`](https://github.com/kjuulh/dagger-rs/commit/7a008be59e5ca183809e5840cdfae1d87665aa20))
- move code to dagger-core ([`ec0d0b2`](https://github.com/kjuulh/dagger-rs/commit/ec0d0b22e646c97acb3ce93f3afb3ddb8590e68f))
- with selection impl default ([`9f0021b`](https://github.com/kjuulh/dagger-rs/commit/9f0021b7086046c80b3f455f205149e03eb72da2))
- fix warnings ([`2b49f9c`](https://github.com/kjuulh/dagger-rs/commit/2b49f9c19098d96df2bb735253710774b0831c94))
- fix test ([`03366b7`](https://github.com/kjuulh/dagger-rs/commit/03366b7c5b3cce5ec42b5c7655843170236c56a1))
- test marshaller ([`c5dfceb`](https://github.com/kjuulh/dagger-rs/commit/c5dfcebaad9c255b10ba8c6e4d4dba00821c8941))
- test marshaller ([`c4ec6f0`](https://github.com/kjuulh/dagger-rs/commit/c4ec6f0c976ce0af2e05e818731b5e2bed7f0522))
- implement sort by name and type ([`d9b51c1`](https://github.com/kjuulh/dagger-rs/commit/d9b51c1ac90c00fb3af24332b6140e1201bc9be7))
- fix optional types for real ([`26069a8`](https://github.com/kjuulh/dagger-rs/commit/26069a82a69ec7265216c8ddaceb37228dd0fb81))
- fix description ([`f4581ba`](https://github.com/kjuulh/dagger-rs/commit/f4581ba4cd1693a906eaf6c58054398ceae3bfac))
- with proper optional types ([`f4a812a`](https://github.com/kjuulh/dagger-rs/commit/f4a812a7d24e9e09cb4e3cbde56ee0b3ac774b62))
- set proper option type ([`8549cfc`](https://github.com/kjuulh/dagger-rs/commit/8549cfc3a7d9f831febaeadc22db36604e465ea8))
- add fields ([`496a687`](https://github.com/kjuulh/dagger-rs/commit/496a687bc34f7c58cc86df60c183be741b0b8a9c))
- add input_fields ([`d2cddff`](https://github.com/kjuulh/dagger-rs/commit/d2cddff365c636feceb3f20a73df812fcab11a19))
- with objects ([`5fef514`](https://github.com/kjuulh/dagger-rs/commit/5fef5148010f384d0158361d64b8e17d357d4819))
- with enum ([`2a1f7c3`](https://github.com/kjuulh/dagger-rs/commit/2a1f7c3f2666f1f4caebf7c22707709741c2cfad))
- with codegen output ([`0bf6b0e`](https://github.com/kjuulh/dagger-rs/commit/0bf6b0e91ecc31c1f6b51338234137eb185810a0))
- split out codegen parts ([`3263f1d`](https://github.com/kjuulh/dagger-rs/commit/3263f1d589aee78065401c666533cb0cbadd06ce))
- add dagger-sdk ([`9dccb83`](https://github.com/kjuulh/dagger-rs/commit/9dccb83d94a720dd58deffe9f3e5aaea784336f3))
</details>

View File

@@ -1,6 +1,6 @@
[package]
name = "dagger-sdk"
version = "0.2.0"
version = "0.2.4"
edition = "2021"
readme = "README.md"
license-file = "LICENSE.MIT"
@@ -12,7 +12,7 @@ publish = true
[dependencies]
base64 = "0.21.0"
dagger-core = { path = "../dagger-core", version = "^0.2.1" }
dagger-core = { path = "../dagger-core", version = "^0.2.2" }
eyre = "0.6.8"
futures = "0.3.26"

View File

@@ -1,4 +1,4 @@
# dagger-rs
# dagger-sdk
A dagger sdk written in rust for rust.
@@ -19,20 +19,20 @@ The examples match the folder name in each directory in examples
Simply install like:
```bash
cargo install dagger-sdk
cargo add dagger-sdk
```
### Usage
```rust
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let version = client
.container(None)
.from("golang:1.19".into())
.with_exec(vec!["go".into(), "version".into()], None)
.stdout();
.stdout()?;
println!("Hello from Dagger and {}", version.trim());

View File

@@ -1,7 +1,7 @@
use dagger_sdk::gen::HostDirectoryOpts;
use dagger_sdk::HostDirectoryOpts;
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory(
"examples/build-the-application/app".into(),
@@ -14,7 +14,7 @@ fn main() -> eyre::Result<()> {
let source = client
.container(None)
.from("node:16".into())
.with_mounted_directory("/src".into(), host_source_dir.id());
.with_mounted_directory("/src".into(), host_source_dir.id()?);
let runner = source
.with_workdir("/src".into())

View File

@@ -1,8 +1,8 @@
use dagger_sdk::gen::HostDirectoryOpts;
use dagger_sdk::HostDirectoryOpts;
use rand::Rng;
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory(
"./examples/caching/app".into(),
@@ -12,12 +12,12 @@ fn main() -> eyre::Result<()> {
}),
);
let node_cache = client.cache_volume("node".into()).id();
let node_cache = client.cache_volume("node".into()).id()?;
let source = client
.container(None)
.from("node:16".into())
.with_mounted_directory("/src".into(), host_source_dir.id())
.with_mounted_directory("/src".into(), host_source_dir.id()?)
.with_mounted_cache("/src/node_modules".into(), node_cache, None);
let runner = source
@@ -43,11 +43,11 @@ fn main() -> eyre::Result<()> {
let ref_ = client
.container(None)
.from("nginx".into())
.with_directory("/usr/share/nginx/html".into(), build_dir.id(), None)
.with_directory("/usr/share/nginx/html".into(), build_dir.id()?, None)
.publish(
format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()),
None,
);
)?;
println!("published image to: {}", ref_);

View File

@@ -1,10 +1,9 @@
use rand::Rng;
fn main() -> eyre::Result<()> {
let mut rng = rand::thread_rng();
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let context_dir = client
.host()
@@ -12,11 +11,11 @@ fn main() -> eyre::Result<()> {
let ref_ = client
.container(None)
.build(context_dir.id(), None)
.build(context_dir.id()?, None)
.publish(
format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()),
None,
);
)?;
println!("published image to: {}", ref_);

View File

@@ -1,11 +1,11 @@
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let version = client
.container(None)
.from("golang:1.19".into())
.with_exec(vec!["go".into(), "version".into()], None)
.stdout();
.stdout()?;
println!("Hello from Dagger and {}", version.trim());

View File

@@ -1,8 +1,8 @@
use dagger_sdk::gen::HostDirectoryOpts;
use dagger_sdk::HostDirectoryOpts;
use rand::Rng;
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory(
"examples/publish-the-application/app".into(),
@@ -15,7 +15,7 @@ fn main() -> eyre::Result<()> {
let source = client
.container(None)
.from("node:16".into())
.with_mounted_directory("/src".into(), host_source_dir.id());
.with_mounted_directory("/src".into(), host_source_dir.id()?);
let runner = source
.with_workdir("/src".into())
@@ -40,11 +40,11 @@ fn main() -> eyre::Result<()> {
let ref_ = client
.container(None)
.from("nginx".into())
.with_directory("/usr/share/nginx/html".into(), build_dir.id(), None)
.with_directory("/usr/share/nginx/html".into(), build_dir.id()?, None)
.publish(
format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()),
None,
);
)?;
println!("published image to: {}", ref_);

View File

@@ -1,8 +1,8 @@
use dagger_sdk::gen::HostDirectoryOpts;
use dagger_sdk::HostDirectoryOpts;
use rand::Rng;
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let output = "examples/publish-the-application/app/build";
let host_source_dir = client.host().directory(
@@ -16,7 +16,7 @@ fn main() -> eyre::Result<()> {
let source = client
.container(None)
.from("node:16".into())
.with_mounted_directory("/src".into(), host_source_dir.id());
.with_mounted_directory("/src".into(), host_source_dir.id()?);
let runner = source
.with_workdir("/src".into())
@@ -44,13 +44,13 @@ fn main() -> eyre::Result<()> {
.from("nginx".into())
.with_directory(
"/usr/share/nginx/html".into(),
client.host().directory(output.into(), None).id(),
client.host().directory(output.into(), None).id()?,
None,
)
.publish(
format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()),
None,
);
)?;
println!("published image to: {}", ref_);

View File

@@ -1,7 +1,7 @@
use dagger_sdk::gen::HostDirectoryOpts;
use dagger_sdk::HostDirectoryOpts;
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory(
"examples/test-the-application/app".into(),
@@ -14,7 +14,7 @@ fn main() -> eyre::Result<()> {
let source = client
.container(None)
.from("node:16".into())
.with_mounted_directory("/src".into(), host_source_dir.id());
.with_mounted_directory("/src".into(), host_source_dir.id()?);
let runner = source
.with_workdir("/src".into())
@@ -30,7 +30,7 @@ fn main() -> eyre::Result<()> {
],
None,
)
.stderr();
.stderr()?;
println!("{}", out);

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,6 @@
pub mod client;
pub mod gen;
mod client;
mod gen;
mod querybuilder;
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
pub use client::*;
pub use gen::*;

View File

@@ -46,13 +46,13 @@ impl Selection {
}
}
pub fn arg<S>(&self, name: &str, value: S) -> eyre::Result<Selection>
pub fn arg<S>(&self, name: &str, value: S) -> Selection
where
S: Serialize,
{
let mut s = self.clone();
let val = serde_json::to_string(&value)?;
let val = serde_json::to_string(&value).unwrap();
match s.args.as_mut() {
Some(args) => {
@@ -65,7 +65,7 @@ impl Selection {
}
}
Ok(s)
s
}
pub fn build(&self) -> eyre::Result<String> {
@@ -93,7 +93,7 @@ impl Selection {
Ok(fields.join("{") + &"}".repeat(fields.len() - 1))
}
pub fn execute<D>(&self, gql_client: &gql_client::Client) -> eyre::Result<Option<D>>
pub fn execute<D>(&self, gql_client: &gql_client::Client) -> eyre::Result<D>
where
D: for<'de> Deserialize<'de>,
{
@@ -111,7 +111,7 @@ impl Selection {
let resp: Option<D> = self.unpack_resp(resp)?;
Ok(resp)
Ok(resp.unwrap())
}
fn path(&self) -> Vec<Selection> {
@@ -171,10 +171,8 @@ mod tests {
.select("core")
.select("image")
.arg("ref", "alpine")
.unwrap()
.select("file")
.arg("path", "/etc/alpine-release")
.unwrap();
.arg("path", "/etc/alpine-release");
let query = root.build().unwrap();
@@ -190,10 +188,8 @@ mod tests {
.select("core")
.select("image")
.arg("ref", "alpine")
.unwrap()
.select_with_alias("foo", "file")
.arg("path", "/etc/alpine-release")
.unwrap();
.arg("path", "/etc/alpine-release");
let query = root.build().unwrap();
@@ -208,10 +204,8 @@ mod tests {
let root = query()
.select("a")
.arg("arg", "one")
.unwrap()
.select("b")
.arg("arg", "two")
.unwrap();
.arg("arg", "two");
let query = root.build().unwrap();
@@ -222,7 +216,7 @@ mod tests {
fn test_vec_arg() {
let input = vec!["some-string"];
let root = query().select("a").arg("arg", input).unwrap();
let root = query().select("a").arg("arg", input);
let query = root.build().unwrap();
assert_eq!(query, r#"query{a(arg:["some-string"])}"#.to_string())
@@ -232,7 +226,7 @@ mod tests {
fn test_ref_slice_arg() {
let input = &["some-string"];
let root = query().select("a").arg("arg", input).unwrap();
let root = query().select("a").arg("arg", input);
let query = root.build().unwrap();
assert_eq!(query, r#"query{a(arg:["some-string"])}"#.to_string())
@@ -242,7 +236,7 @@ mod tests {
fn test_stringb_arg() {
let input = "some-string".to_string();
let root = query().select("a").arg("arg", input).unwrap();
let root = query().select("a").arg("arg", input);
let query = root.build().unwrap();
assert_eq!(query, r#"query{a(arg:"some-string")}"#.to_string())
@@ -275,7 +269,7 @@ mod tests {
})),
};
let root = query().select("a").arg("arg", input).unwrap();
let root = query().select("a").arg("arg", input);
let query = root.build().unwrap();
assert_eq!(

View File

@@ -1,5 +1,4 @@
use dagger_sdk::client::connect;
use dagger_sdk::gen::ContainerExecOpts;
use dagger_sdk::{connect, ContainerExecOpts};
#[test]
fn test_example_container() {
@@ -15,7 +14,8 @@ fn test_example_container() {
redirect_stderr: None,
experimental_privileged_nesting: None,
}))
.stdout();
.stdout()
.unwrap();
assert_eq!(out, "3.16.2\n".to_string())
}

View File

@@ -4,7 +4,6 @@ pub mod cli;
mod cli_generate;
fn main() -> eyre::Result<()> {
// again
color_eyre::install().unwrap();
let args = std::env::args();