Repository navigation
feat(docker): user-set vs runtime config + persist HJSON comments - #590
Open
madejackson wants to merge 2 commits into
Open
madejackson wants to merge 2 commits into
madejackson wants to merge 2 commits into
Conversation
madejackson
force-pushed
the
pr/hjson-comments
branch
from
September 1, 2026 17:35
c9be3be to
f2e5fbc
Compare
madejackson
force-pushed
the
pr/hjson-comments
branch
3 times, most recently
from
September 5, 2026 15:22
693cf5e to
8ecf449
Compare
madejackson
added a commit
to aseracorp/Cosmos-Server
that referenced
this pull request
Sep 8, 2026
…n-comments Both stacked PRs share mount/volume/export code and depend on the same dependency chain (azukaar#573 lowercase CosmosMount, azukaar#585 DurationStr). Resolve the additive conflicts: - mount.go: take azukaar#599's superset (SubPath/ReadOnly/NoCopy + helpers) - volumes.jsx / newServiceForm.jsx: azukaar#599's Subpath/Read-only/NoCopy columns and file-picker 'any' (for file subpaths) layered on azukaar#590's lowercase fields - api_blueprint.go: keep azukaar#590's omitempty tags (hide empty fields in the compose editor) + healthcheck nil-guard refactor; keep azukaar#599's ValidateMountConflicts + volume-subpath auto-create block - export.go: keep azukaar#590's FormatShmSize + healthcheck pointer alloc; take azukaar#599's HostConfig.Mounts/FromDockerMount volume export (subpath-preserving) - regenerate api-docs + go-sdk from merged code (CosmosMount fields, DurationStr healthcheck fields, mount readOnly/subpath/noCopy) Verified: go build ./... , go test ./src/..., vite client-build all pass.
madejackson
added a commit
to aseracorp/Cosmos-Server
that referenced
this pull request
Sep 9, 2026
…path (azukaar#599) Reconcile the clean azukaar#599 branch (built on upstream, minus generated files) with azukaar#590's stacked feature work. Shared files take the canonical union: azukaar#590's omitempty/shm_size/strslice + azukaar#599's subpath/nocopy. Verified: go build ./..., docker tests pass.
madejackson
force-pushed
the
pr/hjson-comments
branch
from
September 30, 2026 09:10
bfeb700 to
b513b0a
Compare
madejackson
force-pushed
the
pr/hjson-comments
branch
2 times, most recently
from
October 9, 2026 11:35
1b01a13 to
d82778f
Compare
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: madejackson.
|
madejackson
force-pushed
the
pr/hjson-comments
branch
from
October 9, 2026 12:35
a48fc52 to
a1da076
Compare
madejackson
force-pushed
the
pr/hjson-comments
branch
from
October 9, 2026 15:33
a1da076 to
61ed93e
Compare
Contributor
Author
|
Rebased this branch on top of the updated #584 ( |
Replace raw JSON.stringify output with HJSON (hjson.github.io) in the compose editor, docker-compose JSON import, API config preview modals and the event explorer: unquoted keys, always-quoted string values, trailing separators, no escaping noise. The compose editor/import parse HJSON on submit (JSON first, HJSON fallback — a superset), so users can paste either. Pure frontend preprocessing: the backend still receives and emits JSON. Includes a Prism grammar that keeps the familiar editor colors with HJSON: keys red, string values green, numbers/booleans/null purple, comments and multiline strings/block-comments grey/green. Strings containing #, // or : stay single quoted strings; comments containing ':' stay comments. Files: - client/src/utils/hjson.jsx (new): toHjson + parseJsonOrHjson - client/src/utils/hjsonGrammar.js (new): Prism HJSON grammar - newService.jsx / docker-compose.jsx: init/parse as JSON-or-HJSON - apiModal.jsx / eventsExplorer.jsx: render payloads/events as HJSON - package.json / package-lock.json: add hjson dependency
madejackson
force-pushed
the
pr/hjson-comments
branch
from
October 12, 2026 07:18
61ed93e to
67d8005
Compare
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.
Config vs runtime values + HJSON comment persistence in the compose editor
This PR is the combined follow-up to the HJSON display work: it shows the user-set config (instead of the live runtime state) and preserves HJSON comments in the compose editor.
🧩 Dependencies (all required — merge these first, in any order)
This branch is stacked on the following PRs. Each is needed because the code here builds on types/behavior they introduce:
hjson.jsx,toHjson,parseJsonOrHjson) that the compose editor edits inDurationStr/FormatDurationused by the export/diff codeContainerRefToName, depends_on label handling, network-mode ref resolutionCosmosMount(lowercase volume fields) used byexport.goShmSize/ByteSizebyte-size string handlingstrslice.StrSliceexec/shell form forcommand/entrypoint1️⃣ Show user-set vs image-default config
Currently the compose editor always shows the live Docker runtime state, mixing user-set values with image-Dockerfile defaults (ENV, CMD, EXPOSE, HEALTHCHECK, WORKDIR, USER) and Cosmos bookkeeping labels.
ExportContainerRuntime: exports only explicitly-set settings by diffingContainerInspectagainstImageInspectWithRaw:cosmos.compose.*(the internal per-node HJSON comment labels — returned separately via thecommentsfield, not as user config). All other labels — including othercosmos.*/cosmos-*bookkeeping (cosmos.stack,cosmos-stack,cosmos.stack.main,cosmos-stack-main,cosmos-network-name, …) andcom.docker.compose.*— are kept. The internalcom.docker.compose.depends_onlabel is still stripped (its data is exposed via thedepends_onfield).ExportContainerRoute:?from=initial(default) = diff;?from=runtime= full live statecompose-editorgets a themed "Show runtime values" switch that re-fetches;newService.jsxre-syncs the editor when theserviceprop changes; empty fields (ports: [],routes: null, etc.) hidden viaomitempty.2️⃣ Persist HJSON comments in
cosmos.compose.*labelsComments aren't representable in JSON, so the editor previously lost them on save.
extractComments()builds anode-path → commentmap;injectComments()restores them;create()sends$$comments; export returnscomments.src/docker/comments.gostores each comment ascosmos.compose.<path>label and reads them back;CreateServiceRouteextracts$$comments;ExportContainerRoutereturns the map.Notes
unstable, GitHub will show only this PR's delta.services.web.image).