Skip to content

Commit

Permalink
fix: issue in hello world macro (#43)
Browse files Browse the repository at this point in the history
* fix: issues in hello world macro

* chore: removed curly bracket

* chore: update validation for custom struct
  • Loading branch information
shanithkk authored May 16, 2024
1 parent 5eccf20 commit 51eefb4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tempfile = "3.2.0"
itertools = "0.12.1"
walkdir = "2"
anyhow = "1.0.65"
echo-library = "0.0.4"
echo-library = { path = "../echo-library" }
composer-primitives = "0.0.3"
sys-info = "0.9.1"

Expand Down
2 changes: 1 addition & 1 deletion echo-library/src/common/parse_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ sp-runtime = { version = \"6.0.0\", default-features = false, git = \"https://gi
pub fn generate_cargo_toml_dependencies(workflow: &Workflow) -> String {
let mut dependency_map = HashMap::new();

let hello_world_dependency = "hello_world_macro = {git= \"https://github.com/HugoByte/aurras.git\", branch = \"next\", package = \"hello_world_macro\"}"
let hello_world_dependency = "hello_world_macro = \"0.0.1\""
.to_string();

dependency_map.insert("hello_world", hello_world_dependency);
Expand Down
15 changes: 11 additions & 4 deletions echo-library/src/common/starlark_modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ pub fn starlark_workflow_module(builder: &mut GlobalsBuilder) {
) -> anyhow::Result<Task> {
if kind == "openwhisk" || kind == "polkadot" {
if attributes.is_none() {
return Err(anyhow!("Attributes are mandatory for kind: openwhisk or polkadot"));
return Err(anyhow!(
"Attributes are mandatory for kind: openwhisk or polkadot"
));
}
}

let mut input_arguments: Vec<Input> = serde_json::from_str(&input_arguments.to_json()?)
.map_err(|err| anyhow!("Failed to parse input arguments: {}", err))?;

Expand Down Expand Up @@ -174,8 +176,13 @@ pub fn starlark_workflow_module(builder: &mut GlobalsBuilder) {
return Err(anyhow!("Value must be either true or false"));
}
}

_ => return Err(anyhow!("Unsupported input type for default value")),
RustType::HashMap(_, _) => {}
RustType::List(_) => {}
RustType::Tuple(_, _) => {}
RustType::Struct(_) => {}
_ => {
return Err(anyhow!("Unsupported input type for default value"));
}
}

Some(value_str)
Expand Down

0 comments on commit 51eefb4

Please sign in to comment.