Skip to content

fix: Redis container no longer starts unconditionally#115

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-redis-container-startup
Draft

fix: Redis container no longer starts unconditionally#115
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-redis-container-startup

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Redis was always started during magebox bootstrap regardless of whether any project required it, and orphaned containers were never cleaned up when the compose file was regenerated without Redis.

Changes

  • GenerateDefaultServices: Changed unconditional else { add Redis } to else if globalCfg.DefaultServices.Redis { add Redis }. The default global config already has Redis: true, so fresh installs are unaffected.

  • DockerController.Up(): Added --remove-orphans to docker compose up -d. Containers removed from the compose file (e.g. Redis when no project needs it) are now stopped on the next up.

  • Tests: Added coverage for GenerateDefaultServices with Redis enabled/disabled/Valkey, and GenerateGlobalServices with no projects requiring Redis.

Before / After

// Before — Redis always started unless Valkey was set
if globalCfg.DefaultServices.Valkey {
    compose.Services["valkey"] = g.getValkeyService()
} else {
    compose.Services["redis"] = g.getRedisService() // unconditional
}

// After — respects the Redis flag
if globalCfg.DefaultServices.Valkey {
    compose.Services["valkey"] = g.getValkeyService()
} else if globalCfg.DefaultServices.Redis {
    compose.Services["redis"] = g.getRedisService()
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • github.com (HTTP Only)
    • Triggering command: /usr/bin/ssh /usr/bin/ssh -o SendEnv=GIT_PROTOCOL git@github.com git-upload-pack 'org/repo.git' (packet block)
  • nonexistent.invalid.host
    • Triggering command: /tmp/go-build2498265114/b374/teamserver.test /tmp/go-build2498265114/b374/teamserver.test -test.testlogfile=/tmp/go-build2498265114/b374/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

- GenerateDefaultServices now only adds Redis when globalCfg.DefaultServices.Redis is true
- DockerController.Up() now uses --remove-orphans to stop containers removed from compose
- Add tests for Redis-not-started cases and GenerateDefaultServices behavior

Agent-Logs-Url: https://github.com/qoliber/magebox/sessions/466f206f-917f-4060-bdc1-e442e17f1906

Co-authored-by: peterjaap <431360+peterjaap@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Redis container start condition based on project config fix: Redis container no longer starts unconditionally May 12, 2026
Copilot AI requested a review from peterjaap May 12, 2026 08:20
* main:
  Upload PR build binaries as artifacts and comment links
  Release v1.17.0
  Start only this project's services on magebox start
  Ensure installation directory exists before installation (#113)
@github-actions
Copy link
Copy Markdown
Contributor

📦 PR build artifacts

Built from bfa74caview run. Artifacts expire in 14 days.

Note: artifact download links require being signed in to GitHub with access to this repository.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redis container starts even when no projects have redis: true

2 participants