feat(compose): consume network config, preserve source networks, validate refs, and support multi-file encrypted discovery - #66
Merged
Conversation
…date refs, and support multi-file encrypted discovery - Thread stack.network into GenerateOptions as required networkName; remove hardcoded NETWORK_NAME constant - Preserve non-default merged source networks; config wins for logical default key - Add collectAllServiceNetworkRefs for list and map syntax validation - Reject dangling network references and network_mode plus networks coexistence - Invalid stacks excluded from generated output, disk, render, and deploy - Use Stack "name": reason error format for reload.ts compatibility - Fix stackctl init to write traefik-public default instead of empty string - Change secrets.encryptedFileName to string | string[] for multi-file discovery - Add normalizeEncryptedFileNames with typed result object - Update findEncryptedEnvFiles to accept filename list - Resolve config before discovery in deployPipeline - No-config fallback to [.env.enc] for encrypt/decrypt/clean/check - No-argument encrypt derives plaintext names from configured encrypted names - Fix secrets CLI dispatch to use new Command() pattern for Cliffy compatibility - Map secrets config failures to ExitCode.UserConfigError - Update README, migration.md, codemaps, and AGENTS.md for all behavior changes - 427 tests pass, fmt:check, lint, and type-check clean Closes #65
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
Resolves #65: Compose generation hardcodes network topology and encrypted env discovery, blocking stock adoption.
Changes
Network generation (gaps 1-3):
stack.networkintoGenerateOptionsas requirednetworkName; removed hardcodedNETWORK_NAMEconstantdefaultkeycollectAllServiceNetworkRefsin newsrc/compose/networks.tsfor list and map syntax validationnetwork_modeplusnetworkscoexistence with distinct errorsgenerated,files, disk, render, and deployStack "name": reasonerror format forreload.tsextractStackFromErrorcompatibilitystackctl initwithout--detectto writenetwork: "traefik-public"instead of empty stringEncrypted env discovery (gap 4):
secrets.encryptedFileNametype tostring | string[]for multi-file supportnormalizeEncryptedFileNameswith typed{ filenames, errors }result objectfindEncryptedEnvFilesto accept a filename list; defaults to[".env.enc"]deployPipeline[".env.enc"]for encrypt/decrypt/clean/check (bypassesresolveConfig)new Command()pattern for Cliffy compatibilityExitCode.UserConfigError(2)Documentation:
.env.enc-only limitation as known follow-updoctor --fix-volumesas not yet implementedstack.networkDriveras reserved for future useValidation
deno task fmt:check: passed (70 files)deno task lint: passed (60 files)deno task check: passeddeno task test: 427 passed, 0 failedBreaking changes
These are intentional behavioral changes within 0.x versioning:
network_modeplus explicitnetworksare now rejectedNETWORK_NAMEconstant removed; generation requiresstack.networkin configsecrets encryptnow discovers plaintext files from configured encrypted namesKnown limitations
doctorencrypted-file checks support only.env.enc(follow-up issue planned)doctor --fix-volumesremains a stubstack.networkDriveris reserved, no consumer in this release