Skip to content

Commit

Permalink
Add error label to workflow run (#299)
Browse files Browse the repository at this point in the history
* add error label to workflow rung

* add  migration

* fix lint migration

* if error is none empty string
  • Loading branch information
rzlim08 authored Apr 19, 2024
1 parent e2cc6f1 commit a34b728
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 3 deletions.
1 change: 1 addition & 0 deletions workflows/api/helpers/workflow_run.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion workflows/api/loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ async def handle_message(event: WorkflowStatusMessage) -> None:
if workflow_run:
workflow_run.status = WorkflowRunStatus.FAILED
if event.error:
workflow_run.error_message = event.error
workflow_run.error_label = event.error
workflow_run.error_message = event.error_message or ""
await self.session.commit()

return handle_message
Expand Down
7 changes: 7 additions & 0 deletions workflows/api/schema.graphql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions workflows/api/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,15 @@
"ofType": null
}
},
{
"args": [],
"name": "errorLabel",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"args": [],
"name": "errorMessage",
Expand Down Expand Up @@ -2722,6 +2731,15 @@
"ofType": null
}
},
{
"defaultValue": null,
"name": "errorLabel",
"type": {
"kind": "INPUT_OBJECT",
"name": "StrComparators",
"ofType": null
}
},
{
"defaultValue": null,
"name": "errorMessage",
Expand Down Expand Up @@ -4158,6 +4176,15 @@
"ofType": null
}
},
{
"defaultValue": null,
"name": "errorLabel",
"type": {
"kind": "ENUM",
"name": "orderBy",
"ofType": null
}
},
{
"defaultValue": null,
"name": "errorMessage",
Expand Down Expand Up @@ -4476,6 +4503,15 @@
"ofType": null
}
},
{
"args": [],
"name": "errorLabel",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"args": [],
"name": "errorMessage",
Expand Down Expand Up @@ -4612,6 +4648,15 @@
"ofType": null
}
},
{
"args": [],
"name": "errorLabel",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"args": [],
"name": "errorMessage",
Expand Down Expand Up @@ -4732,6 +4777,9 @@
{
"name": "status"
},
{
"name": "errorLabel"
},
{
"name": "errorMessage"
},
Expand Down Expand Up @@ -7207,6 +7255,15 @@
"ofType": null
}
},
{
"defaultValue": "null",
"name": "errorLabel",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
{
"defaultValue": "null",
"name": "errorMessage",
Expand Down
9 changes: 9 additions & 0 deletions workflows/api/types/workflow_run.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions workflows/api/validators/workflow_run.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion workflows/cerbos/policies/workflow_run.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto-generated by running 'make codegen'. Do not edit.
# Make changes to the template codegen/templates/cerbos/policies/class_name.yaml.j2 instead.
# Make changes to the template template workflows_templates/cerbos/policies/workflow_run.yaml.j2 instead.
# yaml-language-server: $schema=https://api.cerbos.dev/latest/cerbos/policy/v1/Policy.schema.json
apiVersion: api.cerbos.dev/v1
resourcePolicy:
Expand Down
3 changes: 2 additions & 1 deletion workflows/cerbos/policies/workflow_run_entity_input.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Make changes to the template codegen/templates/cerbos/policies/class_name.yaml.j2 instead.
# Auto-generated by running 'make codegen'. Do not edit.
# Make changes to the template workflows_templates/cerbos/policies/workflow_run_entity_input.yaml.j2 instead.
# yaml-language-server: $schema=https://api.cerbos.dev/latest/cerbos/policy/v1/Policy.schema.json
apiVersion: api.cerbos.dev/v1
resourcePolicy:
Expand Down
13 changes: 13 additions & 0 deletions workflows/cli/gql_schema.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a34b728

Please sign in to comment.