Skip to content

ci: Switch docker compose to extends#2205

Open
thompson-tomo wants to merge 10 commits intoopen-telemetry:mainfrom
thompson-tomo:switch_to_extends
Open

ci: Switch docker compose to extends#2205
thompson-tomo wants to merge 10 commits intoopen-telemetry:mainfrom
thompson-tomo:switch_to_extends

Conversation

@thompson-tomo
Copy link
Copy Markdown
Contributor

This moves from using yaml anchors to using extends due to anchors not working across files.

This is necessary for further splitting of the docker-compose.yml so that examples can reside within the appropriate folder.

…metry#1984)

* Add commit id into source code url to enable removal on deprecation. open-telemetry#1961

* ensure compliance with rubocop

* switch to tags

* typo fix

* Update source code URI in net_ldap gemspec metadata
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Docker Compose setup to replace YAML anchors with extends, enabling service config reuse across multiple compose files as the project moves toward further splitting docker-compose.yml.

Changes:

  • Added a new docker-base.yml defining a reusable base service configuration.
  • Updated docker-compose.yml services to extends from docker-base.yml instead of using YAML anchors.
  • Included docker-base.yml in the top-level compose include list.
Show a summary per file
File Description
docker-compose.yml Switches services from YAML anchor merging to extends and adds docker-base.yml to include.
docker-base.yml Introduces the shared base service definition (and a bundle volume definition).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml
Comment thread docker-base.yml
thompson-tomo and others added 3 commits April 19, 2026 00:54
@github-actions github-actions bot added the ci label Apr 18, 2026
Copy link
Copy Markdown
Contributor

@arielvalentin arielvalentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 This review was generated with AI assistance (GitHub Copilot CLI). Findings were validated locally by running docker compose config and diffing the resolved output between main and this branch.

Summary

The extends migration is the right direction for enabling per-gem compose files. Most services translate correctly. However, I found two behavioral regressions when comparing the resolved docker compose config output between main and this branch.


🚫 Issue 1: base is exposed as a runnable service

Because docker-base.yml appears in both the include: block and as an extends.file target, base becomes a first-class service:

$ docker compose config --services | grep base
base

docker compose up would attempt to start it. On main, the config lived under x-shared-config (an extension field ignored by Compose).

Fix: Remove - ./docker-base.yml from the include: list. The extends.file directive references the file directly and does not require include.


🚫 Issue 2: ex-instrumentation-pg-testtmpfs not cleared

With YAML anchors (<<: *base), writing tmpfs: [] replaces the parent value. With extends, sequences are merged, so tmpfs: [] is silently ignored and /tmp remains a tmpfs from the parent.

Verified locally with docker compose config:

main This PR
tmpfs [] (cleared) - /tmp (inherited)
postgres_socket:/tmp ✅ present ❌ removed
postgres_socket:/var/run/postgresql ✅ present ✅ present

The tests use TCP (TEST_POSTGRES_HOST=postgres) so this likely does not break anything today, but it is an unintended semantic change for a mechanical refactor.

Fix: Use tmpfs: !reset [] to properly clear the inherited value under extends. If socket-based connectivity parity is desired, also restore the postgres_socket:/tmp volume mount.


✅ Everything else looks good

  • All 22 CI checks pass
  • docker compose config validates cleanly
  • All other service translations are semantically equivalent
  • The extends pattern sets up well for the stated goal of splitting compose files per-gem

@thompson-tomo
Copy link
Copy Markdown
Contributor Author

Both fixes implemented @arielvalentin. What I wasn't aware of was the reset option for tmpfs hence the change in mounts which has been reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants