Skip to content

Conversation

@aggrand
Copy link

@aggrand aggrand commented Nov 14, 2025

what

This modifies the divergence checking behavior to assume divergence unless proven otherwise. On any errors it will say that there is a divergence.

why

The documentation on the merge checkout strategy describe the issue where a failure to use the updated main branch can delete resources that are configured on the main branch. Depending on the resource in question, this could be an unforseeable change that could have disastrous consequences. The existing behavior seemed to assume safety unless proven unsafe. It would be incredibly bad for a series of poorly-timed transient network failures on fetches to result in an apply that destroys resources. Our usage prioritizes safety and we would prefer that the plan/apply bail if it cannot establish safety.

I realize that this is an opinionated change, but I suspect that most people who go out of their way to enable the merge strategy and undiverged requirement are expecting to make their processes as safe as possible. I was surprised by the behavior. If preferred, I could also lock this behavior behind an option. I'm not sure to what extent this would be a breaking change.

tests

references

@dosubot dosubot bot added feature New functionality/enhancement go Pull requests that update Go code labels Nov 14, 2025
@github-actions github-actions bot removed the feature New functionality/enhancement label Nov 14, 2025
@aggrand aggrand changed the title feat: Assume divergence until established otherwise fix: Assume divergence until established otherwise Nov 14, 2025
@lukemassa
Copy link
Contributor

lukemassa commented Nov 16, 2025

This makes sense to me, could you include a note to the docs that this is the expected behavior?

@github-actions github-actions bot added the docs Documentation label Nov 18, 2025
@aggrand aggrand force-pushed the stronger-undiverged-guarantee branch from 91e7846 to a23681f Compare November 18, 2025 20:30
@aggrand
Copy link
Author

aggrand commented Nov 18, 2025

@lukemassa thank you; I have updated the PR to include a note in the docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants