Skip to content

Commit

Permalink
feat(deployments): print error in describe if any (#171)
Browse files Browse the repository at this point in the history
Include error field in GraphQL schema and CLI output to log
deployment errors if present. Enhances error observability
during deployment descriptions.
  • Loading branch information
steebchen authored Feb 10, 2025
1 parent 8f1753e commit a854370
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/src/command/deployments/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ impl DescribeArgs {

// convert config of type String to &str
print_config_file(&deployment.config.config_file);

if deployment.error.is_some() {
println!("\n─────────────── ERROR INFO ───────────────");
println!("Error: {}", deployment.error.unwrap());
println!("\n─────────────── ERROR INFO ───────────────");
}
}

Ok(())
Expand Down
237 changes: 237 additions & 0 deletions slot/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7669,6 +7669,18 @@
"ofType": null
}
},
{
"args": [],
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "error",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"args": [
{
Expand Down Expand Up @@ -8775,6 +8787,18 @@
"description": null,
"isDeprecated": false,
"name": "disabled"
},
{
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "error"
},
{
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "deleted"
}
],
"fields": [],
Expand Down Expand Up @@ -10144,6 +10168,172 @@
"ofType": null
}
},
{
"defaultValue": null,
"description": "error field predicates",
"name": "error",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorNEQ",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorIn",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
},
{
"defaultValue": null,
"description": null,
"name": "errorNotIn",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
},
{
"defaultValue": null,
"description": null,
"name": "errorGT",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorGTE",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorLT",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorLTE",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorContains",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorHasPrefix",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorHasSuffix",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorIsNil",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorNotNil",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorEqualFold",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "errorContainsFold",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": "teams edge predicates",
Expand Down Expand Up @@ -14891,6 +15081,53 @@
}
}
},
{
"args": [
{
"defaultValue": null,
"description": null,
"name": "addresses",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
}
}
],
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "priceByAddresses",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Price",
"ofType": null
}
}
}
}
},
{
"args": [
{
Expand Down
1 change: 1 addition & 0 deletions slot/src/graphql/deployments/describe.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ query DescribeDeployment($project: String!, $service: DeploymentService!) {
branch
tier
version
error
config {
configFile
}
Expand Down

0 comments on commit a854370

Please sign in to comment.