Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move compose code to a separate module #650

Merged
merged 26 commits into from
Dec 23, 2022

Conversation

mdelapenya
Copy link
Member

@mdelapenya mdelapenya commented Dec 3, 2022

What does this PR do?

It moves compose code to its own module. For that, we had to do a few things:

  • convert a private func to log Docker info into public, so that compose is able to print Docker info at the startup
  • copy LoggerOptions to Compose module, so that it still compiles
  • add a few public Setters in the DockerContainer and DockerProvider structs in order to set the Docker provider at the container, and the logger and Docker client at the provider. This has been done this way to not break the public APIs for non-compose users.
  • unfortunately, those compose users in v0.16.0 have to update their go.mod files including the new compose module.
  • unfortunately again, those non-compose users in v0.16.0 ve to update their go.mod files, removing the replace directive we added. The only replace directive that must be kept is the one with Docker.
    • the Docker replacement is needed because the Stop function calls ContainerStop, which in the fixed, old version of Docker needs a third parameter of the container.StopOptions; on the contrary without the replacement the function simply accepts a timeout.

For that we have also updated the install instructions for both modules (main one and compose) in the docs site.

Why is it important?

We want to streamline the consumption of the library, and adding the replace directive impacted users in a way that they were not able to simply use it. It was documented, but again, it should be simpler to consume the library.

Related issues

@mdelapenya mdelapenya requested a review from a team as a code owner December 3, 2022 08:11
@mdelapenya mdelapenya added breaking change Causing compatibility issues. dependencies Dependencies or external services labels Dec 3, 2022
@mdelapenya mdelapenya self-assigned this Dec 3, 2022
* main:
  chore: generate dependabot configs for examples (testcontainers#654)
  chore: format dependabot using go-yaml indents (testcontainers#658)
  chore(deps): bump github.com/docker/compose/v2 from 2.12.2 to 2.14.0 (testcontainers#657)
  chore(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1 (#583)
  chore(deps): bump github.com/cenkalti/backoff/v4 from 4.1.3 to 4.2.0 (testcontainers#656)
  chore: remove quotes from dependabot updates (testcontainers#655)
  fix: do not create garbage in examples nav bar (testcontainers#652)
  chore(deps): bump github.com/containerd/containerd from 1.6.8 to 1.6.10 (#621)
  chore(deps): bump golang.org/x/sys from 0.1.0 to 0.3.0 (testcontainers#651)
* main:
  chore(deps): bump google.golang.org/api in /examples/pubsub (testcontainers#685)
  chore(deps): bump google.golang.org/api in /examples/spanner (testcontainers#684)
  chore(deps): bump google.golang.org/grpc in /examples/firestore (testcontainers#686)
  chore(deps): bump google.golang.org/api in /examples/bigtable (testcontainers#680)
  chore(deps): bump google.golang.org/api in /examples/datastore (testcontainers#678)
  chore(deps): bump golang.org/x/text from 0.3.7 to 0.5.0 (testcontainers#660)
  chore(deps): bump github.com/magiconair/properties from 1.8.6 to 1.8.7 (testcontainers#677)
  chore: postgres example (testcontainers#674)
  Add bigtable example (testcontainers#676)
  chore(deps): bump github.com/containerd/containerd from 1.6.10 to 1.6.12 (testcontainers#675)
  chore: run go mod tidy in examples (testcontainers#672)
  Improve datastore, firestore, pubsub and spanner tests (testcontainers#670)
  chore: group dependabot updates (testcontainers#668)
  chore: update mkdocs format to go-yaml v3 (testcontainers#667)
* main:
  chore(deps): bump google.golang.org/api in /examples/firestore (testcontainers#683)
  chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#688)
* main:
  chore(deps): bump google.golang.org/api from 0.104.0 to 0.105.0 (testcontainers#699)
* main:
  chore: reduce concurrent builds (testcontainers#702)
  chore: add mysql example (testcontainers#700)
@mdelapenya mdelapenya marked this pull request as ready for review December 20, 2022 07:37
@mdelapenya mdelapenya requested a review from a team December 20, 2022 07:37
* main:
  chore: bump transitive dependencies (#527)
* main:
  docs: refine onboarding process with quickstart guide (testcontainers#706)
  chore: move redis-specific tests to the example module (testcontainers#701)
@netlify
Copy link

netlify bot commented Dec 23, 2022

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 4e04b0b
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/63a55e3499564800092ca278
😎 Deploy Preview https://deploy-preview-650--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@mdelapenya mdelapenya merged commit 10c899c into testcontainers:main Dec 23, 2022
@mdelapenya mdelapenya deleted the compose-module branch December 23, 2022 15:52
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Jan 4, 2023
* main: (44 commits)
  feat: support passing registry credentials to the reaper (testcontainers#647)
  fix: close response body in http strategy (testcontainers#718)
  chore: move e2e module to postgres example module (testcontainers#717)
  chore: bump containerd transitive dep in examples (testcontainers#715)
  chore(deps): bump github.com/containerd/containerd from 1.6.12 to 1.6.14 (testcontainers#703)
  chore(deps): bump github.com/compose-spec/compose-go in /modules/compose (testcontainers#710)
  chore: bump testcontainers-go to 0.17.0 in examples (testcontainers#714)
  chore(deps): bump github.com/docker/compose/v2 in /modules/compose (testcontainers#711)
  chore: support running MySQL compose in ARM (testcontainers#712)
  chore: simplify compose replace directives (testcontainers#713)
  chore: add compose module to dependabot (testcontainers#709)
  chore: move compose code to a separate module (testcontainers#650)
  docs: refine onboarding process with quickstart guide (testcontainers#706)
  chore: move redis-specific tests to the example module (testcontainers#701)
  chore: bump transitive dependencies (#527)
  chore: reduce concurrent builds (testcontainers#702)
  chore: add mysql example (testcontainers#700)
  chore(deps): bump google.golang.org/api from 0.104.0 to 0.105.0 (testcontainers#699)
  chore(deps): bump google.golang.org/api in /examples/firestore (testcontainers#683)
  chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#688)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Causing compatibility issues. dependencies Dependencies or external services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Move compose code to a separate Go module
1 participant