-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support searching for multiple error messages when retriggering a job #161
Conversation
rerun-failed-run/action.yml
Outdated
IFS=$'\n' | ||
for line in $multiline_variable | ||
do | ||
json_array+="\"error$counter\": \"$line\", " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really see why produce a map here ({"error1": "...", "error2": ...}
) if it's much easier to make a flat list of strings (["...", "..."]
), like this:
multiline_variable=$(cat << EOF
Process completed with exit code 88
Process completed, with exit code 99
EOF
)
result="["
for line in $multiline_variable
do
result+="\"$line\","
done
result=$(echo $result | sed '$ s/,$//g')
result+="]"
echo $result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this actually makes much more sense, will address this
51c9d6a
to
23e92d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for all the detailed explanations and tests 🙇
I have added some comments directly in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for taking my suggestions into account.
It's all good for me 🚀
Description
This pr adds changes which enable specifying multiple error messages to search for when attempting to retrigger a github run.
Related
https://github.com/camunda/team-infrastructure/issues/572
Tests
Test 1: The workflow wont get retriggered if none of the error messages have been encountered
Commit
Test workflow invoking the composite action
Workflow run
Test 2: One of the error messages is encountered in the logs
Commit
Test workflow invoking the composite action
Workflow runs 1 and 2
Test 3: Single line error messages are still working
Commit
Test workflow invoking the composite action
Workflow runs 1 and 2
Test 4: Triggering the workflow through the webmodeler repo with multiple error messages retriggers the action if it fails
PR https://github.com/camunda/web-modeler/pull/8087
Commit https://github.com/camunda/web-modeler/pull/8087/commits/ad8e1be1c12f0f98a70c71f1bf01c7c0225cad68
Test workflow invoking the composite action
Workflow run attempt 1 and attempt 2