feat: errorExpression for http steps (#6356)#6414
Conversation
Signed-off-by: Zoey Sheffield <zoey.sheffield@anaplan.com>
Signed-off-by: Zoey Sheffield <zoey.sheffield@anaplan.com>
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Zoey Sheffield <zoey.sheffield@anaplan.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6414 +/- ##
==========================================
+ Coverage 58.30% 58.36% +0.06%
==========================================
Files 500 500
Lines 41920 42018 +98
==========================================
+ Hits 24441 24525 +84
- Misses 16011 16024 +13
- Partials 1468 1469 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thank you @zoeyfyi! I only looked at docs so far -- which look good overall. My only ask would be to see if this feature can be worked into an example. As you had called out in the original issue, expr lang features like nil coalescing play a particularly important role here. Or expressions that check response code first to determine if a body from which to extract information may even exist may also be realistic. @fuskovic would you mind reviewing the implementation please? |
Signed-off-by: Zoey Sheffield <zoey.sheffield@anaplan.com>
Description
Closes #6356
Adds
errorExpressionto ahttpsteps config. If ahttpstep reaches a terminal failure (i.e.failureExpressionevaluates to true) we attempt to extract an error message from the response by evaluatingerrorExpression. If evaluation fails, fall back to the original error message, otherwise we add the extracted error message to the message to the promotion step result.Checklist
Eligibility
kind/proposal,needs discussion,needs research,maintainer only,area/security,size/large,size/x-large,size/xx-large).Quality
AI Use Disclosure
This PR was written:
Sign-Off
All commits:
git commit -s) (required)git commit -S) (encouraged)