fix: Prevent unnecessary CaC writes for Project updates#238
Open
HuyPhanNguyen wants to merge 1 commit into
Open
fix: Prevent unnecessary CaC writes for Project updates#238HuyPhanNguyen wants to merge 1 commit into
HuyPhanNguyen wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original PR by @kube89 recreated here to handle GH Actions auth issues with the forked repository. Commits & contribution preserved.
Fixes #232
Summary
Fixes several Config as Code update issues affecting octopusdeploy_project. The provider previously attempted DeploymentSettings writes for every Config as Code project update, even when only database-backed project fields changed. This caused updates to fail when the default branch was protected and could also leave projects partially updated if the default branch was changed to one without valid OCL. The provider now distinguishes between Project updates and DeploymentSettings updates, and validates default branch changes before modifying the project.
Changes
Result
Database-backed project updates no longer perform unnecessary Config as Code writes, allowing them to succeed against protected branches. Default branch changes are now validated before the project is updated, preventing partially persisted project state when the target branch does not contain valid Config as Code configuration, while preserving existing behaviour for intentional DeploymentSettings updates.