-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: Consider onExit children of Retry nodes #6451
Conversation
Signed-off-by: Simon Behar <[email protected]>
Signed-off-by: Simon Behar <[email protected]>
@sarabala1979 Please review |
Codecov Report
@@ Coverage Diff @@
## master #6451 +/- ##
==========================================
+ Coverage 48.35% 48.49% +0.14%
==========================================
Files 259 260 +1
Lines 18682 18756 +74
==========================================
+ Hits 9033 9096 +63
- Misses 8660 8665 +5
- Partials 989 995 +6
Continue to review full report at Codecov.
|
Signed-off-by: Simon Behar <[email protected]>
var childrenIds []string | ||
for i := -1; i >= -len(node.Children); i-- { | ||
node := getChildNodeIndex(node, nodes, i) | ||
if strings.HasSuffix(node.Name, ".onExit") { |
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.
Do we need nil
here?
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.
Great catch!
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.
We technically don't, because the only time getChildNodeIndex
returns nil
is when len(node.Children) == 0
, but since this is inside the for loop guarded by that it should never happen. However, getChildNodeIndex
could change under us so it's always safer to add a nil check.
Signed-off-by: Simon Behar <[email protected]>
@simster7 do you want to include this PR on v3.1.4? |
Sure |
This PR will be included in 3.2 because of it uses 3.2 code |
Fixes: #6301
Checklist:
Tips:
git commit --signoff
.make pre-commit -B
to fix codegen or lint problems.