Open midigofrank opened 2 weeks ago
A fix for this from @stuartc (assumed) is that we should quote special strings that contain yaml-controlled characters. This might be a fix on the CLI
This needs to be applied to condition expressions. for example where the user has !state.path
as a condition expression, and we are trying to deploy, we get an error that says "field can't be blank" (See below).
{
"errors": {
"workflows": {
"WF2.1-Get Patients from CommCare": {
"edges": {
"GET by IHS->GET by NIK": {
"condition_expression": [
"This field can't be blank."
]
},
"GET by NIK->GET by GDN": {
"condition_expression": [
"This field can't be blank."
]
},
"GET by NIK->Process next step": {
"condition_expression": [
"This field can't be blank."
]
}
}
}
}
}
}
In the ExportUtils module, when building the workflow YAML keys, if the name contains any characters other than [A-Za-z-_]
then wrap the key in double quotes.
@christad92 your example is super interesting, but I think its a different code path; we need to test this out (it looks like an error on push).
@christad92 could you give a list of values or keys that we believe are culprits here, things that when parsed by the CLI produce values or keys that are either not valid YAML or incorrect. Your condition_expression
example there is 👌 .
@stuartc these are two issues we found.
Projects having workflows with special YAML characters like
:
fails to pullYaml does not do well with special characters and that means cli pull and deploy operations will always run into an error when a project has workflows with those characters in names.
There are two ways to do this, enforce some data validation on lightning or do data manipulation. I'd default validation because data manipulation might be expensive with multiple edge cases to deal with/test.