-
Notifications
You must be signed in to change notification settings - Fork 409
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(iteration): Pointless waiting before a known timeout #27
Conversation
@Addono Could you please help with reviewing this? |
Hey! Thanks for the well documented and clean PR! Looks good and nearly ready to be merged in.
However, after having this script in the wild for many years, I'm sure there's someone who depends on this undocumented behavior 😦 . So there's this trade off ⚖️ between maintaining backwards compatibility and fixing bugs. So I just added support for creating GitHub releases on Then a new PR with 9964904 can be made which will trigger a new major release with this new behavior. We're still not completely out of the woods, since I expect that many places will just pull in the latest version of the script from When you create the PR for 9964904, could you then have a commit message something like this:
(I'm mostly interested in the BREAKING CHANGE part, since it will cause the major bump we need for this commit.) |
9964904
to
988d3f0
Compare
Thanks for your outstandingly well-documented PR! 🚀 |
🎉 This PR is included in version 1.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Every time a timeout occurs, there is one second consumed for nothing.
Illustration
Since there is no attempt made after the third waiting, the outcome of such 3-seconds execution depends entirely on the first three attempts. And a known failure is always projected to one second later into the future, despite the insignificance of further waiting.
With 23bbf6d, there will be a fourth attempt:
It is more natural to use TIMEOUT + 1 as the maximum number of attempts.
Other changes
22d68b4 - feat(option): Restrict the timeout input to non-negative integers
526918b - feat(option): Support more conventional formats in the option parser
This is what I created this PR for in the first place.
9964904 - fix(command): Restore environment variables before calling
exec
By using positional parameters, we avoid transferring the problem endlessly to other variables: