Skip to content

fix(compose): avoid fixed Admin UI container name - #551

Merged
hedhoud merged 1 commit into
linagora:feat/admin-uifrom
hedhoud:fix/admin-ui-compose-container-name
Jun 23, 2026
Merged

fix(compose): avoid fixed Admin UI container name#551
hedhoud merged 1 commit into
linagora:feat/admin-uifrom
hedhoud:fix/admin-ui-compose-container-name

Conversation

@hedhoud

@hedhoud hedhoud commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Why

The Admin UI should be able to start from more than one compose project on the same machine. A fixed Docker container name makes that fragile: if the name already exists, the stack fails before the UI starts.

What changed

This lets Docker Compose generate the Admin UI container name from the compose project, while keeping the existing Admin UI port behavior driven by the environment.

Validation

  • Added a regression test for the Admin UI compose service.
  • Verified the compose render still publishes the configured Admin UI port.

Closes #550

Summary by CodeRabbit

  • Chores
    • Updated the admin UI deployment settings to avoid using a fixed container name, improving flexibility when running multiple instances.
  • Tests
    • Added a unit test to verify the admin UI compose configuration no longer specifies a fixed container name and that its port mapping defaults to 8081 when not overridden.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 23f5489f-64e7-4fc2-97d1-f30f3cb5ac63

📥 Commits

Reviewing files that changed from the base of the PR and between bc2ab8f and 2f0019d.

📒 Files selected for processing (2)
  • infra/compose/docker-compose.yaml
  • tests/unit/infra/test_admin_ui_compose.py
💤 Files with no reviewable changes (1)
  • infra/compose/docker-compose.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/unit/infra/test_admin_ui_compose.py

📝 Walkthrough

Walkthrough

The pull request removes the fixed container_name from the admin-ui Docker Compose service and adds a unit test that checks the service omits container_name and keeps the expected ${ADMIN_UI_PORT:-8081}:80 port mapping.

Changes

Admin UI compose service

Layer / File(s) Summary
Admin UI compose service shape
infra/compose/docker-compose.yaml, tests/unit/infra/test_admin_ui_compose.py
The admin-ui service no longer declares container_name, and a new pytest check parses the compose file to enforce that absence and the existing port mapping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibbled one name from the compose file clean,
So stacks can hop up without clashing unseen.
A tiny test watches the port by the door,
And guards that fixed label appears there no more.
Soft paws, neat trails, and compose runs once more.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely describes the main change: removing the fixed Admin UI container name in Docker Compose configuration.
Linked Issues check ✅ Passed The PR successfully addresses #550 by removing the hardcoded container name and allowing project-scoped naming, with a regression test ensuring the configuration remains valid.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the Admin UI container naming issue and validating the fix through a new unit test.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hedhoud
hedhoud requested a review from andyne13 June 23, 2026 14:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/unit/infra/test_admin_ui_compose.py`:
- Around line 7-10: The compose_path variable in the test uses a hardcoded
relative path that depends on the current working directory when pytest runs,
making the test brittle. Instead of using
Path("infra/compose/docker-compose.yaml"), resolve the path relative to the test
file itself using __file__ to establish a stable reference point. Calculate the
correct relative path from the test file's location to the docker-compose.yaml
file and use that to construct the Path object, ensuring the test works
regardless of where pytest is executed from.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bfb1da5a-e159-4b00-86fb-28431adefa80

📥 Commits

Reviewing files that changed from the base of the PR and between 2efe623 and bc2ab8f.

📒 Files selected for processing (2)
  • infra/compose/docker-compose.yaml
  • tests/unit/infra/test_admin_ui_compose.py
💤 Files with no reviewable changes (1)
  • infra/compose/docker-compose.yaml

Comment thread tests/unit/infra/test_admin_ui_compose.py Outdated
@hedhoud
hedhoud force-pushed the fix/admin-ui-compose-container-name branch from bc2ab8f to 2f0019d Compare June 23, 2026 14:45

@Ahmath-Gadji Ahmath-Gadji left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Works from me

@hedhoud
hedhoud merged commit 8b4b45e into linagora:feat/admin-ui Jun 23, 2026
4 checks passed
@Ahmath-Gadji Ahmath-Gadji added the fix Fix issue label Jun 29, 2026
@hedhoud
hedhoud deleted the fix/admin-ui-compose-container-name branch August 31, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants