feat: accept and ignore the service-level profiles key#32
Merged
Conversation
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
Accept a service-level
profiles:key instead of hard-rejecting it. A profiled service is now accepted, warnsservice '<name>': ignoring 'profiles', and has no effect on the emitted script.Design:
planning/changes/2026-07-10.04-profiles.md.Why ignore is the faithful mapping (not a cop-out)
compose2pod's run set is fully determined by
--targetplus itsdepends_onclosure (startup_order), with nodocker compose up-style "start all active services" mode. Two Compose rules make ignoringprofilescorrect here:--target Xon a profiledXrunsX, exactly as Compose would.depends_ondependency that must run. Either wayprofileschanges nothing about what compose2pod emits.Previously
profileswas in none of the accepted sets, so_validate_serviceraisedunsupported key 'profiles'and any real compose file using profiles failed to convert.Change
One production line: add
"profiles"toIGNORED_SERVICE_KEYSincompose2pod/parsing.py(joiningports,restart,stdin_open,tty,stop_signal,stop_grace_period). No changes toemit.py,graph.py,keys.py,store.py, or the CLI. No--profileflag and no shape validation ofprofiles— both deliberate non-goals (no observable effect in the single-target model; consistent with the other never-emitted ignored keys).Documented divergence
If the target
depends_ona member whose profile Compose would leave disabled, compose2pod runs it anyway (the closure is authoritative). This matches the user's explicitdepends_onintent and compose2pod's "run the target plus its dependency closure" contract — it is more permissive than Compose, never a silent drop. Recorded inarchitecture/supported-subset.md.Testing
just test-ciat 100% coverage (267 tests),just lint-ciclean,just check-planningOK. New tests:validate()accepts and warns; the emitted script is byte-identical with vs without aprofileskey on an in-closure service (proving inertness); a profiled service outside the closure is not run (asserted via the container nametest-pod-debug-tools, since every service name still appears as an--add-hostalias); and--targeton a profiled service still emits it.