Repository navigation
fix!: make DeploymentConfig fields non-optional - #31689
Draft
DanielleMaywood wants to merge 1 commit into
Draft
DanielleMaywood wants to merge 1 commit into
DanielleMaywood wants to merge 1 commit into
Conversation
codersdk.DeploymentConfig.Values is now a DeploymentValues instead of a pointer, and neither field is omitempty. The server always sets both, so the JSON response is unchanged, and the generated TypeScript type now marks both fields as required. The frontend's hand-written DeploymentConfig, added in 2023 when the type generator could not emit this type, is removed in favor of the generated one. BREAKING CHANGE: Go SDK callers that treat DeploymentConfig.Values as a pointer must use the value directly.
This was referenced Nov 3, 2026
This branch has not been deployed
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.
Makes
codersdk.DeploymentConfigdescribe what the server actually sends, so the frontend can use the generated type instead of a hand-written copy.codersdk.DeploymentConfig.Valuesis nowDeploymentValuesinstead of*DeploymentValues, and neitherconfignoroptionsisomitempty. The generated TypeScript type now has both fields as required.GET /api/v2/deployment/configreturns the same JSON as before. The handler always set both fields. It now writes a*DeploymentConfig: if it wrote the struct by value, the embedded values would not be addressable, soencoding/jsonwould skip serpent's pointer-receiverMarshalJSONand send fields such asaccess_urlas raw objects.TestDeploymentValuescatches this. I also checked that the marshalled bytes match the old struct shape exactly.site/src/api/api.tsno longer declares its ownDeploymentConfig. feat: refactor deployment config #6347 added that copy in March 2023, when it removed the generated type. chore: support external types in typescript codegen #9633 brought the generated type back in September 2023, but the copy stayed. Because the generatedoptionsisreadonly, the deployment settings views anduseDeploymentOptionsnow acceptreadonly SerpentOption[]. The?.afterconfigis removed where it became redundant.Breaking (Go SDK only): code that treats
DeploymentConfig.Valuesas a pointer must use the value directly. For example,dc.Values != nilno longer compiles, and&dc.Valuesreplacesdc.Valueswhere a*DeploymentValuesis needed. The HTTP API does not change.This PR is the base of a stack that ends in #31634, which replaces knip with fallow.
Stack plan
DeploymentConfigfields are non-optional and the hand-written frontend type is removed.chore(site): fixes for the dead code and import cycle that fallow found and knip did not.make lintgates site changes withfallow audit.