Skip to content
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(resource/pipeline): fix permit_restart_from_failed_steps = false #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

masontikhonov
Copy link

@masontikhonov masontikhonov commented Mar 19, 2025

What

This fixes permit_restart_from_failed_steps = false behavior in pipeline resource.

Warning

BREAKING CHANGE!
Previously, permit_restart_from_failed_steps = false resulted in “Permit restart pipeline from failed step: Use account settings”.
From now on, permit_restart_from_failed_steps = false will result in “Permit restart pipeline from failed step: Forbid

Note

In Codefresh API, permit_restart_from_failed_steps = null means “Use account settings”, and permit_restart_from_failed_steps = false means “Forbid”.
However in terraform-plugin-sdk which is currently in use, it is not possible to distinguish between nullish/falsy and not set value.
This means, we have to choose between providing an option to FORBID restart from failed steps; and an option to inherit account settings.
We chose providing options for explicit control over pipeline resource, allowing to the end user either PERMIT or FORBID restart from failed steps.

Fixes #CR-26963

Notes

Checklist

@masontikhonov masontikhonov self-assigned this Mar 19, 2025
@masontikhonov
Copy link
Author

/test

@masontikhonov masontikhonov requested a review from ATGardner March 19, 2025 14:22
@masontikhonov masontikhonov marked this pull request as ready for review March 19, 2025 14:22
`permit_restart_from_failed_steps` property of pipeline spec behaves differently when omit vs set to `false`. This means we should not omit `false` value while sending requests to API.

Fixes #CR-26963
@masontikhonov masontikhonov force-pushed the CR-26963-fix-restart-from-failed-steps branch from 9ac80ec to 2adecb7 Compare March 19, 2025 16:46
@masontikhonov masontikhonov marked this pull request as draft March 19, 2025 16:46
@masontikhonov
Copy link
Author

/test

@masontikhonov masontikhonov changed the title fix(resource/pipeline): fix permit_restart_from_failed_steps to JSON fix(resource/pipeline): fix permit_restart_from_failed_steps = false Mar 19, 2025
@masontikhonov masontikhonov marked this pull request as ready for review March 19, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant