fix(code-server): merge settings with existing instead of skipping#953
Merged
Conversation
The code-server module had two settings bugs matching issue #447: User settings were only written when the file did not exist, and machine settings always overwrote the entire file. Port the merge_settings function from the vscode-web module so both User and Machine settings are deep-merged (jq, python3 fallback). Switch from fragile escaped-JSON to base64 encoding. Add integration tests for create, merge, and machine-merge paths. Update README and variable descriptions to document the new behaviour. Also remove the stale python3-fallback comment from vscode-web run.sh.
DevelopmentCats
approved these changes
Jul 9, 2026
DevelopmentCats
left a comment
Collaborator
There was a problem hiding this comment.
LGTM I tested everything and the merges work fine with both python and jq
rodmk
added a commit
to rodmk/registry
that referenced
this pull request
Jul 9, 2026
Resolve conflicts against the latest main: - code-server/run.sh: keep both coder#953's new settings-merge logic (base64 SETTINGS_B64/MACHINE_SETTINGS_B64 + merge_settings) and this branch's JSONC parsing (strip_jsonc_for_extensions) + null-safe recommendations query. Auto-merged cleanly. - code-server/README.md: version pins resolved to 1.5.2 (latest release tag v1.5.1 + patch), keeping upstream's coder#953 README content outside the version lines. - vscode-web/README.md: corrected version pins to 1.6.1 (latest release tag v1.6.0 + patch); the previous 1.6.2 was one ahead of the released baseline and would have failed the version-bump CI check. Validation after merge: bun run fmt:ci, shellcheck, terraform test (code-server 8/8, vscode-web 3/3), bun test (code-server 8/8, vscode-web 7/7), and the 25-case JSONC matrix (GNU/BSD/BusyBox sed) all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Description
The code-server module had the same settings bug reported in #447 for vscode-web: User settings were only written when the file did not exist (silently skipped otherwise), and Machine settings always overwrote the entire file, destroying any existing settings.
This PR ports the
merge_settingsapproach already used in the vscode-web module (added in #758) to code-server, so both modules handle settings the same way.Type of Change
Module Information
Path:
registry/coder/modules/code-serverWhat Changed
run.shmerge_settings()function (identical to vscode-web).merge_settings()usesjq -s '.[0] * .[1]'for deep merge, falls back to python3, and preserves existing settings with a warning if neither tool is available.replace(jsonencode(...))) to base64 encoding.{}) are now skipped entirely instead of writing an empty object.main.tflocalsblock withsettings_b64andmachine_settings_b64.SETTINGS/MACHINE_SETTINGStemplate vars with base64 variants.settingsandmachine_settingsvariable descriptions to document merge behaviour.main.test.tsbeforeAll,afterEachcleanup, timeout).README.mdjq/python3requirement warning (matching vscode-web).Testing & Validation
bun test)bun fmt)terraform testpassRelated Issues
Closes #447