Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docker/docker-compose-dev-essentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,9 @@ volumes:
redis_data:
prompt_studio_data:
rabbitmq_data:

networks:
default:
# Match docker-compose.yaml so standalone `up` uses unstract-network, not
# docker_default. Traefik is configured with --providers.docker.network below.
name: unstract-network
30 changes: 30 additions & 0 deletions workers/tests/test_dev_essentials_compose_network.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Guard: dev essentials compose must declare unstract-network when run alone."""

from __future__ import annotations

from pathlib import Path

import pytest

yaml = pytest.importorskip("yaml")

REPO_ROOT = Path(__file__).resolve().parents[2]
ESSENTIALS_COMPOSE = REPO_ROOT / "docker" / "docker-compose-dev-essentials.yaml"
EXPECTED_NETWORK = "unstract-network"


def test_dev_essentials_compose_declares_unstract_network():
doc = yaml.safe_load(ESSENTIALS_COMPOSE.read_text())
networks = doc.get("networks") or {}
default = networks.get("default") or {}
assert default.get("name") == EXPECTED_NETWORK
Comment on lines +16 to +20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Docker-only PRs skip these checks

These tests will not run on future PRs that change only docker/docker-compose-dev-essentials.yaml. CI excludes docker/** from the unit job, and the e2e job does not run unit-workers, where these tests are collected. Add a CI path that runs these checks when the guarded Compose file changes, so a network-name regression cannot bypass them.

Prompt To Fix With AI
This is a comment left during a code review.
Path: workers/tests/test_dev_essentials_compose_network.py
Line: 16-20

Comment:
**Docker-only PRs skip these checks**

These tests will not run on future PRs that change only `docker/docker-compose-dev-essentials.yaml`. CI excludes `docker/**` from the unit job, and the e2e job does not run `unit-workers`, where these tests are collected. Add a CI path that runs these checks when the guarded Compose file changes, so a network-name regression cannot bypass them.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code



def test_dev_essentials_traefik_targets_unstract_network():
doc = yaml.safe_load(ESSENTIALS_COMPOSE.read_text())
command = doc["services"]["reverse-proxy"]["command"]
if isinstance(command, list):
joined = " ".join(command)
else:
joined = str(command)
assert f"--providers.docker.network={EXPECTED_NETWORK}" in joined