Conversation
With `include`'d Compose files, it's important to know the origin of each service to be able to properly resolve paths to them, for example. A new `FileMeta` field on the `Project` type provides detailed access to the underlying file structure/hierarchy. This replaces `IncludeReferences` and `ComposeFiles`, which were inconsistent and not comprehensive. Signed-off-by: Milas Bowman <milas.bowman@docker.com>
0200ca4 to
1d1b9f4
Compare
|
Open to suggestions here: I actually originally had this as an entirely separate object returned along with the project, but ergonomically that's impractical to propagate deep down into Compose itself. Hopefully this is a reasonable compromise. I'd love to revamp all this soon 🙃 |
|
LGTM in terms of codebase
About this assumption: included service should have all path resolved already when resource is copied into project, so why is this needed? |
|
@ndeloof IIUC, in the case of service managed by the |
|
ok, so basically because we miss https://github.com/compose-spec/compose-go/pull/461/files#diff-3e93eb737303c2fd36bba9ddd3b891ad9fb906fda7dbf9e377ceacb5b89bd943R118-R124 by using a custom extension, make more sense now |
With
include'd Compose files, it's important to know the origin of each service to be able to properly resolve paths to them, for example.A new
FileMetafield on theProjecttype provides detailed access to the underlying file structure/hierarchy.This replaces
IncludeReferencesandComposeFiles, which were inconsistent and not comprehensive.What Problem Does This Solve
In Compose itself, when we use
x-fields for non-stable features, the "load" logic lives in thedocker/composecodebase until stabilized.That means it needs to resolve in relative paths there --
compose-gocan't help because it doesn't know about the fields to begin with. However, if they came from an included file,IncludeReferenceshas theProjectDirectoryBUT there's no way to know where a service came from! TheFileMetatree combinesComposeFiles+IncludeReferencesand, critically, additionally populates service back-references.