Skip to content

feat(compose): add opt-in flag to strip top-level version from compose#479

Open
3alpha wants to merge 1 commit into
masterfrom
feat/strip-compose-version
Open

feat(compose): add opt-in flag to strip top-level version from compose#479
3alpha wants to merge 1 commit into
masterfrom
feat/strip-compose-version

Conversation

@3alpha

@3alpha 3alpha commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a new strip_compose_version option to the build and publish commands that removes the obsolete top-level version field from compose files during file validation.
  • Plumb the flag through the build/publish commands and the file validation task.
  • Introduce stripComposeVersion helper in src/files/compose.
  • Add unit tests covering the helper and the build command flag wiring.

Motivation

The top-level version field in Docker Compose is obsolete. This change introduces an opt-in flag so packages can be validated and built with the field stripped while support for versionless compose files is being tested. Existing packages keep validating against the current schema because the behavior is opt-in.

Changes

  • src/files/compose/stripComposeVersion.ts: new helper using Reflect.deleteProperty (shared @dappnode/types still declares version as required).
  • src/files/compose/index.ts: export the new helper.
  • src/tasks/buildAndUpload/getFileValidationTask.ts: thread stripComposeVersion through getFileValidationTaskvalidatePackageFilesvalidateVariantFiles.
  • src/tasks/buildAndUpload/{index,types}.ts, src/tasks/publish/{index,types}.ts: forward the new flag.
  • src/commands/build/{index,handler,types}.ts, src/commands/publish/{index,handler,types}.ts: expose --strip_compose_version on the CLI.
  • test/files/compose/stripComposeVersion.test.ts: unit tests for the helper.
  • test/commands/build.test.ts: extend CLI tests to cover the new flag.

Test plan

  • npm test
  • Manual: run DAPPNODE_SDK_BUILD ./my-pkg --strip_compose_version (or equivalent) and confirm the resulting compose no longer carries version.

Add a new strip_compose_version option to the build and publish commands
that removes the obsolete top-level version field from compose files
during file validation.

* Plumb the flag through build/publish commands and the file validation
  task.
* Introduce stripComposeVersion helper in src/files/compose.
* Add unit tests covering the helper and the build command flag wiring.

Behavior is opt-in while support for versionless compose files is being
tested, so existing packages keep validating against the current
schema.
@3alpha
3alpha requested a review from a team as a code owner July 23, 2026 09:26
@github-actions

Copy link
Copy Markdown

Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 94ac79c

This is a development version and should only be installed for testing purposes.

  1. Package dappnodesdk.public.dappnode.eth

Install link

Hash: /ipfs/QmVt9jLYviV3Hfd1HYvSQandyqTrv7F9EsKyV7GUxkN21M

(by dappnodebot/build-action)

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