feat(compose): add opt-in flag to strip top-level version from compose#479
Open
3alpha wants to merge 1 commit into
Open
feat(compose): add opt-in flag to strip top-level version from compose#4793alpha wants to merge 1 commit into
3alpha wants to merge 1 commit into
Conversation
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.
|
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.
Hash: (by dappnodebot/build-action) |
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.
Summary
strip_compose_versionoption to thebuildandpublishcommands that removes the obsolete top-levelversionfield from compose files during file validation.stripComposeVersionhelper insrc/files/compose.Motivation
The top-level
versionfield 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 usingReflect.deleteProperty(shared@dappnode/typesstill declaresversionas required).src/files/compose/index.ts: export the new helper.src/tasks/buildAndUpload/getFileValidationTask.ts: threadstripComposeVersionthroughgetFileValidationTask→validatePackageFiles→validateVariantFiles.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_versionon 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 testDAPPNODE_SDK_BUILD ./my-pkg --strip_compose_version(or equivalent) and confirm the resulting compose no longer carriesversion.