Skip to content

composer: lossless long-syntax import/export, long-syntax-aware valid… - #5

Merged
casablanque-code merged 1 commit into
mainfrom
sprint/compose-fidelity
Oct 14, 2026
Merged

casablanque-code merged 1 commit into
mainfrom
sprint/compose-fidelity

Conversation

@casablanque-code

@casablanque-code casablanque-code commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

…ation

Import/export:

  • ports/volumes lists mixing short and long syntax are split instead of parked wholesale in Extra; ExportYAML merges both back into one list. Previously adding a short entry through the form to a service that had long-syntax entries emitted the 'ports'/'volumes' key twice.
  • A build set through the form now replaces a build mapping kept from import (was a duplicate 'build' key); same rule for healthcheck.
  • healthcheck: add start_period/start_interval (were silently dropped on round trip). Blocks with disable:, no test, a string test or unknown keys are kept verbatim instead of being narrowed to HealthCheck.
  • environment mapping form: 'FOO: ""' now becomes 'FOO=' (empty string) and only a null value becomes pass-through 'FOO'.
  • Unmodeled keys are exported in sorted order, so saving is deterministic.

Validation (own semantic checks now also see what lives in Extra):

  • build mapping without image no longer errors with 'image or build required'.
  • image together with build is no longer an error: it is valid per the Compose Specification (image names the built image).
  • service_healthy, 'database has no healthcheck' and 'database has no volumes' consider healthchecks/volumes kept in Extra.
  • docker.sock mounts and all-interfaces ports are detected in long syntax too.
  • validate start_period / start_interval durations.

New views on ServiceConfig: HasBuild, HasHealthCheck, HasVolumes, PortStrings, VolumeStrings.

What changed

How to test

Checklist

  • make lint / npm run lint passes
  • make test / npm test passes
  • Documentation updated (if needed)
  • Commits follow Conventional Commits

…ation

Import/export:
- ports/volumes lists mixing short and long syntax are split instead of
  parked wholesale in Extra; ExportYAML merges both back into one list.
  Previously adding a short entry through the form to a service that had
  long-syntax entries emitted the 'ports'/'volumes' key twice.
- A build set through the form now replaces a build mapping kept from
  import (was a duplicate 'build' key); same rule for healthcheck.
- healthcheck: add start_period/start_interval (were silently dropped on
  round trip). Blocks with disable:, no test, a string test or unknown
  keys are kept verbatim instead of being narrowed to HealthCheck.
- environment mapping form: 'FOO: ""' now becomes 'FOO=' (empty string)
  and only a null value becomes pass-through 'FOO'.
- Unmodeled keys are exported in sorted order, so saving is deterministic.

Validation (own semantic checks now also see what lives in Extra):
- build mapping without image no longer errors with 'image or build
  required'.
- image together with build is no longer an error: it is valid per the
  Compose Specification (image names the built image).
- service_healthy, 'database has no healthcheck' and 'database has no
  volumes' consider healthchecks/volumes kept in Extra.
- docker.sock mounts and all-interfaces ports are detected in long
  syntax too.
- validate start_period / start_interval durations.

New views on ServiceConfig: HasBuild, HasHealthCheck, HasVolumes,
PortStrings, VolumeStrings.
@casablanque-code
casablanque-code merged commit 2fdde9f into main Oct 14, 2026
4 checks passed
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.

1 participant