-
Notifications
You must be signed in to change notification settings - Fork 203
feat: --retry [<COUNT>] flag and --no-retry deprecation
#1603
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
base: main
Are you sure you want to change the base?
Conversation
|
It doesn't seem like a good idea to do unattended retries to me. If a step fails, it's expected for the user to do something. Do you have a situation where it is desired to do unattended retries? This seems a bit like an XY-problem. |
|
this is meant for fixing issues which are usually resolved after retrying (for example unstable internet connection which causes a step to fail and pass on 2nd retry for example). of course default behavior hasn't changed and user is still prompted what they want to do if |
|
Okay, network conditions is fair; not every tool has this built-in. But don't we want "ask after 2 retries", instead of "skip after 2 retries"? Or possibly both? |
|
yes, this would make a lot of sense. i was thinking about asking after all retries fail by default, skip only if a flag such as |
--retry [<COUNT>] command and --no-retry deprecation--retry [<COUNT>] flag and --no-retry deprecation
FYI: I don't think it's a good idea to use |
|
agree + |
|
(I was thinking I agree One thing I don't understand is your definition of the retry count. You're using |
|
alright I'll make as for examples:
|
|
also (i missed that), yes maybe my code is poorly written but this happens here: 5c21ae6#diff-68c6f449503a33c74a15800c0a9c8fd34028465a06edcac92b32bbb9db64bbceR80 edit: |
|
this is the behaviour as of the latest commit in this PR:
in cli:
now, i updated the example config file idk if it's descriptive enough tho |
|
Is there a reason to have a default for
Oh okay, I just skimmed your code and probably misunderstood. I'm not really a fan of the disparity between the config file and the CLI in your explanation. I had the following in mind:
I changed Feel free to argumentate your current proposal, it just doesn't seem very intuitive to me. |
|
your reasoning for this is actually way better than what i could come up with, so this is how it works now:
|
What does this PR do
Standards checklist
CONTRIBUTING.mdThis PR enhances the
--no-retryflag by implementing--retry [<COUNT>]flag to enable automatic retries of failed steps.--no-retrywas kept to stay compatible with old scripts and is equivalent to--retry 0. It also supports permanent configuration from the config file:How it works
if a step fails:
topgrade(no flag, no config.toml entry):topgrade --retry 0(or set in the config):topgrade --retry 5(or set in the config):Feedback needed
Should this be made to work with
-yflag (eg. automatically continue after retrying if-yis set, otherwise prompt the user)?