-
-
Notifications
You must be signed in to change notification settings - Fork 705
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
feat(script): add repeat interval for script failure and exec-if #2630
Conversation
691b04c
to
837c2f7
Compare
Codecov Report
@@ Coverage Diff @@
## master #2630 +/- ##
==========================================
- Coverage 11.90% 11.89% -0.01%
==========================================
Files 153 153
Lines 11318 11320 +2
==========================================
Hits 1347 1347
- Misses 9971 9973 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Looks good! Thanks 😃
As for the timing inconsistencies, you're right, the updates not being synchronized with the script runner are an issue. The intervals themselves are all accurate because this is all running synchronously, the updates are the issue. I think the following solution could work: The script module shouldn't should arbitrarily call the This way, we make state-changes in the script module explicit (everytime the callback is called) and the script module doesn't read inaccurate data (in your example, the script module read the wrong exit code because the What do you think about this? Do you want to tackle this? |
I think I should, yeah. I'll make a separate PR for these changes. |
Appreciate it 🙂 |
What type of PR is this? (check all applicable)
Description
Added repeat interval for script failure (
interval-fail
) andexec-if
(interval-if
), both falling back tointerval
if not specified. The implementation is straightforward, current configurations retain their behaviour.Related Issues & Documents
Closes #943, #2606
Documentation (check all applicable)
The following should be added to Modules/script/Basic Settings:
Additional notes
One thing I've discovered is that the whole exit-code mechanism is not very reliable due to the fact that script invocations and output updates are not synchronized in any way. Here's a sample config to describe the problem:
The script prints it's
%counter%
with date in seconds and fails every other time. Expected output isgreen-red-green-red...
.Here's an example of the output I've got:
As you can see
2
was considered "successful" by formatting, but applied the correct inteval, because it's actually controlled byscript_runner
. What actually happened is this:The same is for
4-5
and6-7
.My point is, it may be confusing for users if their scripts go for (probably longer)
interval-fail
while being displayed as successful. It's also not an expected behavior really and performs poorly with "flickering" scripts like the one in the example. At the same time I'm not sure If we could do something about it.Sorry for not noticing this before #2596.