Repository navigation
chore: deprecate instance maxRetries - #1448
Conversation
| @@ -1452,7 +1452,7 @@ public StepSettings withRecovery(RecoverStrategy<?> recovery, Object stepLambda) | |||
| * @return MaxRetries strategy. | |||
| */ | |||
| public MaxRetries maxRetries(int maxRetries) { | |||
There was a problem hiding this comment.
I wonder if we should do the opposite? See my reasoning in #1444 (comment)
maxRetries is the only instance method that is used as a factory method, aside from some top level effects, stepEffects and settings, Well, pauseSetting might be another one.
maxRetries is used like with for example:
defaultStepRecovery(RecoverStrategy<?> recoverStrategy)
I would find it more natural to type defaultStepRecovery(RecoverStrategy. and then complete that with IDE code completion. I wouldn't know that maxRetries exists as instance method unless looking at docs.
There was a problem hiding this comment.
instance methods also have the drawback that we can't really add new methods, because they could name clash with existing user code
There was a problem hiding this comment.
Ok, did the other way around. The instance one is deprecated now.
There was a problem hiding this comment.
I need to check the AGENTS.md though. I think we added some notice about it there as well.
35950fb to
d21e16a
Compare
octonato
left a comment
There was a problem hiding this comment.
Changed now all references to the now deprecated maxRetries by an explicit usage of the static one from RecoverStrategy.
Also removed the notice we had in the AGENTS.md.
We have seen that code assistants get confused with the static
RecoveryStrategy.maxRetriesand theWorkflow.maxRetries.RecoveryStrategy.maxRetriesis a legacy method that were useful with the old Workflow API.This PR deprecates the static one..