Skip to content

Conversation

@N-lson
Copy link
Contributor

@N-lson N-lson commented Dec 18, 2025

The ConversionState is a read-only property that isn't required to be sent to the Octopus server. Creating a new instance of this type using NewGitPersistenceSettings will default both of the properties in ConversionState to false, which may not align with the value that is in Octopus. Since we marshal all the properties out to the JSON payload sent to the server, this triggers a server error due to the mismatching conversion state properties which Octopus treats as attempting to be modified.

This PR removes these fields from MarshalJSON as these fields aren't required to be sent to Octopus, nor does it make much sense to be sending back read-only fields in the payload.

This won't be a breaking change for 99.9% of use cases:

  • Reading: The API response will still include these properties as UnmarshalJSON is unchanged.
  • Modifying: The API request will no longer include this property which is the fix as we should no longer be sending mismatching values
  • If there is a consumer of the client that calls json.Marshal externally, this would be a breaking change as the properties will no longer show up. ❓ Is this a concern? I don't expect anyone to be doing this.

Relates to OctopusDeploy/terraform-provider-octopusdeploy#24

@domenicsim1
Copy link
Contributor

As a possible breaking change, this is fine as long as we release it as minor update 👍

@N-lson N-lson merged commit 7409a7a into main Dec 18, 2025
6 checks passed
@N-lson N-lson deleted the nelson/no-conversion-state branch December 18, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants