-
-
Notifications
You must be signed in to change notification settings - Fork 62
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: skip sources when their parent source failed #396
Conversation
401e08b
to
8aafcaa
Compare
I think you are solving half of the problem here. I see two scenarios that we need to cover
In the second scenario, I think before executing a source, we need to validate that sources listed in the dependency list succeeded. Something like
|
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 think that the pull request in the current stage, fully solve the problem
8aafcaa
to
a9fc9ea
Compare
Good catch, thanks! Implemented (same idea with the loop, sligthly different if cases) WDYT? |
Let me rebase @olblak (in the next 5 min) |
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
162803f
to
0484096
Compare
@olblak ready to review :) |
for _, parentSource := range source.Config.DependsOn { | ||
if p.Sources[parentSource].Result != result.SUCCESS { | ||
logrus.Warningf("Parent source[%q] did not succeed. Skipping execution of the source[%q]", parentSource, id) | ||
shouldRunSource = false |
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.
What do you think to break early if we identify that a "source" failed.
shouldRunSource = false | |
shouldRunSource = false | |
break |
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 am wondering if we need to explicitly set the current source result to result.Failure
if one of the dependency failed.
Such as
shouldRunSource = false | |
shouldRunSource = false | |
source.Result = result.FAILURE |
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 am wondering if we need to explicitly set the current source result to result.Failure if one of the dependency failed.
That feels weird since the source was not run (e.g. skipped).
Do not forget that, as for today, the default state of a source is "skipped", which is the reason why no state change is done here (otherwise I would have set it to "skipped" instead of whatever default, because it's not run).
I vote for reporting "skipped, but I don't mind enforcing the "skipped" status here (even if it's the default), so a change of the default would not break it. WDYT ?
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.
What do you think to break early if we identify that a "source" failed.
Could be discussed, but not in the scope of this PR, because it would be a breaking change in the UX behavior. Do you mind raising an issue on that topicas enhancement?
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.
Thanks for the pull request, I made minor suggestions that I don't consider blocker for merging.
Feel free to proceed
@olblak thanks for the review. I've answered to your 2 elements: both are outside of the scope of the PR but are legit questions (and worth an issue). I'm merging (as it's expected to be minor) since I got your approval, don't hesitate to open issues on the topic, or revert the PR if you see something we missed :) |
Fix #285
When a source, referenced through a template function
{{ source `<source id>` }}
on another source, is failing,then the "children" sources are now skipped with an error message.
No worry for conditions: if any source fail, then the condition are never run.
Test
To test this pull request, you can run the following commands:
example of output:
Additional Information
Tradeoff
Potential improvement