Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: compose-spec/compose-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.16.0
Choose a base ref
...
head repository: compose-spec/compose-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.17.0
Choose a head ref
  • 8 commits
  • 18 files changed
  • 3 contributors

Commits on Jul 12, 2023

  1. loader: path resolution consistency (#425)

    Move the project working directory absolute path resolution to
    `ResolveRelativePaths` and remove redundant local volume (a
    rarely used way of creating bind mounts) absolute path resolution
    from the normalization method.
    
    Signed-off-by: Milas Bowman <milas.bowman@docker.com>
    milas authored Jul 12, 2023
    Configuration menu
    Copy the full SHA
    2cef411 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2023

  1. loader: consistently resolve build.context path

    When using `extends.file` to load a service from another Compose
    file, if the `build.context` field wasn't explicitly set, it would
    get ignored by the path resolution.
    
    As a result, the build context would end up as the working directory
    of the _root_ Compose file instead of the working directory of the
    _loaded_ Compose file.
    
    This was because the relative path resolution logic ignored empty
    `build.context` values. Unfortunately, removing that restriction
    is itself not sufficient, as it then attempted to verify that the
    local path existed in an attempt to avoid unintentionally joining
    the working directory with a remote context value (e.g.
    `/foo/https://github.com/my/repo.git`).
    
    This is problematic because the working directory itself might be
    relative (rooted to an unknown location that is != `.`), so it
    will be resolved relative to the current process working directory,
    and thus fail the existence check.
    
    In practice, this happens when using `extends.file`, where we do
    resolve paths but intentionally pass a potentially relative value
    for the working dir, thus making it unsafe to be doing real
    filesystem operations here.
    
    In fact, even if a context was specified, it was possible to break
    this by running Compose from a different directory than the _root_
    Compose file while specifying the path to it.
    
    As there's no formal specification for determining local path vs.
    remote build contexts (see discussion in #385), I'm simply
    eliminating the existence check. This COULD mean that Compose
    begins to erroneously consider remote context values as local paths
    if builders add new unsupported syntaxes, but I think it's fair for
    us to be more restrictive.
    
    Additionally, I've ensured that when path resolution is happening,
    it _always_ resolves the `build.context` to an absolute path for
    consistency. In particular, this should help make it easier to
    use the output of `docker compose config` from arbitrary working
    directories.
    
    There's a new test that covers the `extends.file` + `build.context`
    behavior, and everal existing test adjustments to account for the
    fact that Compose was emitting relative `build.context` paths from
    `docker compose config` despite everything else being absolute
    (such as volumes).
    
    Fixes docker/for-mac#6912.
    
    Signed-off-by: Milas Bowman <milas.bowman@docker.com>
    milas committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    ba2b641 View commit details
    Browse the repository at this point in the history
  2. load: fix windows tests

    Various places were using absolute Unix paths, which don't work
    on Windows.
    
    Signed-off-by: Milas Bowman <milas.bowman@docker.com>
    milas committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    2c14f1c View commit details
    Browse the repository at this point in the history
  3. filter depends_on services when required is not set

    Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
    glours committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    27cae8c View commit details
    Browse the repository at this point in the history
  4. add support of healthcheck.start_interval attribut

    Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
    glours committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    e9919f6 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2023

  1. Configuration menu
    Copy the full SHA
    e4d696a View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. Merge pull request #432 from glours/filter-non-required-dependencies

    filter depends_on services when required is not set
    glours authored Jul 18, 2023
    Configuration menu
    Copy the full SHA
    4c1837e View commit details
    Browse the repository at this point in the history
  2. Merge pull request #434 from milas/extends-file-build-context

    loader: consistently resolve `build.context` path
    glours authored Jul 18, 2023
    Configuration menu
    Copy the full SHA
    95ac1be View commit details
    Browse the repository at this point in the history
Loading