-
Notifications
You must be signed in to change notification settings - Fork 34
feat: allow times to be <= 0 to simulate endless trigger
#134
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
Conversation
|
I think we need to update docs about this config? |
I've updated the corresponding documentation. Could you please take another look when you have a moment to see if it meets the requirements |
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.
Pull Request Overview
This PR adds support for a stop-on-reach-times configuration option in the trigger phase to control whether the trigger should stop when the retry count is reached. The default value is false to maintain backward compatibility with existing test cases that rely on the previous behavior (as described in #132).
Key changes:
- Added
stop-on-reach-timesconfiguration field with a default value offalse - Modified the HTTP trigger action to respect this configuration when deciding whether to stop execution
- Updated documentation to reflect the new configuration option
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/config/e2eConfig.go | Added StopOnReachTimes boolean field to the Trigger struct |
| internal/components/trigger/http.go | Added stopOnReachTimes field and logic to conditionally stop execution when times is reached |
| docs/en/setup/Configuration-File.md | Documented the new stop-on-reach-times configuration option with default value |
| commands/trigger/trigger.go | Passed the StopOnReachTimes value to the HTTP action constructor |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
That looks weird to me. Do we need to fix many test cases? Can we fix them with some script? |
After the GHA run, I've identified approximately 10 test cases that require modification and I suspect there might be more to it. On one hand, we could simply set the times value in all trigger configurations to a very high number. This would make the triggers run continuously throughout the entire end-to-end test verification period, behave as before. However, this adjustment seems a bit odd, doesn't it?? On the other hand, having the trigger run continuously is acceptable and works fine in other scenarios. The specific issue here is with the alert recovery detection scenario(#13539). This scenario requires a defined recovery time window, meaning the trigger needs to stop after a certain number of runs to accurately assess recovery. Therefore, my proposal is to add a new configuration option to explicitly control whether the trigger stops after reaching the specified times value. This provides the necessary flexibility for the alert recovery use case without affecting other scenarios. Looking forward to your suggestions on this approach. |
|
The
I think we can set the times to a non-positive value like (-1 or 0) to indicate never stop (if this doesn't already exist). Instead of adding a config |
Thanks for the feedback! I'll work on a revision and submit it later. |
I've pushed new commits to address the points you raised. Please take another look when you have a moment, and let me know if anything else needs adjustment. @kezhenxu94 |
kezhenxu94
left a comment
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!
stop-on-reach-times configuration in the trigger phasetimes to be <= 0 to simulate endless trigger
Since some existing test cases rely on the behavior described in #132, we need to maintain compatibility with them to avoid extensive modifications to the e2e tests. Correspondingly, we will only modify the necessary test cases by explicitly setting the
stop-on-reach-timesconfiguration to true