zed/crates/dev_container
Phil Schalm 6a8eb56faf
dev_container: Build the primary compose service when runServices omits it (#61434)
# Objective

- Fix a bug that caused a dev container configuration which used both a
docker-compose file _and_ `runServices` to incorrectly drop the primary
service.

## Solution

- Disclosure: Claude wrote the Rust but I understand the implementation
- Prior to the change, `run_services` was passed unchanged. However, the
dev container CLI adds the primary if it hasn't been specified - [ref
this
code](f683c29f64/src/spec-node/dockerCompose.ts (L276-L281))

This PR updates Zed to adhere to that behaviour

## Testing

- I tested both manually against a minimal reproduction case, as well as
a live configuration that was the original reason for creating this PR
- I tested this on OS X. While I believe the PR is far enough abstracted
from the platform, it's always possible that Windows is doing something
weird. I don't expect that, however.
- To reproduce either use the following [sample
repo](https://github.com/user-attachments/files/30256541/devcontainer-repro.zip)
or attempt to build a **clean** docker container for a dev container
configuration which utilizes both `runServices` as well as a
`docker-compose.yml` file.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Dev containers: Fix for docker compose behaviour that caused
`runServices` to not implicitly include the primary service if it wasn't
explicitly listed

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
2026-07-23 05:11:37 +00:00
..
src dev_container: Build the primary compose service when runServices omits it (#61434) 2026-07-23 05:11:37 +00:00
Cargo.toml Support local devcontainer features (#55225) 2026-05-26 07:13:00 +00:00
LICENSE-GPL Devcontainer setup modal (#47021) 2026-01-16 15:20:48 -08:00