Skip to content

v1.0.2

Compare
Choose a tag to compare
@TanmoySG TanmoySG released this 07 Nov 20:03
· 9 commits to main since this release
ecf3bef

What's Changed

  • [bug fix] Step retries for max retry even if step state is not error by @TanmoySG in #17

A step would retry for all errors for MaxRunAttempts even when step moved out of Error State.

Cause

  • shouldRetry returns true if step.StepOpts.RetryAllErrors is set to true, without checking if step.stepResult.StepState is in Error state.
	if step.StepOpts.RetryAllErrors {
		return true
	}

Fix

  • Adding check for step.stepResult.StepState to be StepStateError in addition to the RetryAllErrors fixes this bug.
	if step.stepResult.StepState == StepStateError && step.StepOpts.RetryAllErrors {
		return true
	}

In addition step.StepOpts.MaxRunAttempts == step.stepRunProgress.runCount has been removed from shouldExit


This pull request includes changes to the go_steps.go file to enhance the retry and exit logic for steps. The most important changes include adding a condition to check the step state before retrying and refactoring the exit logic to use a switch statement.

Enhancements to retry logic:

  • go_steps.go: Updated the shouldRetry method to include a condition that checks if the step state is StepStateError before retrying.

Refactoring exit logic:

  • go_steps.go: Refactored the shouldExit method to use a switch statement for better readability and removed the redundant return statement.

Full Changelog: v1.0.1...v1.0.2