Skip to content

Fix Docker load warnings and enhance editor modal behavior - #150

Open
mstrhakr wants to merge 20 commits into
mainfrom
dev
Open

Fix Docker load warnings and enhance editor modal behavior#150
mstrhakr wants to merge 20 commits into
mainfrom
dev

Conversation

@mstrhakr

@mstrhakr mstrhakr commented Sep 6, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several improvements and fixes to the Compose Manager, focusing on enhanced user experience, improved error logging, and more robust handling of Docker Compose project discovery. The main changes include a new advanced editor modal option, improved WebSocket error logging, better Compose file resolution from .env files, and a safer approach to handling project directories in the shell script. Unit tests were also added to ensure correct behavior.

User Experience Improvements

  • Added a new advanced option in the settings UI (compose.manager.settings.page) allowing users to prevent the editor modal from closing when clicking outside it, reducing accidental interruptions during editing. The setting is available in the UI, persisted in config, and respected by the JavaScript modal logic. [1] [2] [3]
  • Closes Option to disable closing the editor by clicking outside the modal #126

Error Handling and Logging

Docker Compose Project Discovery

  • Enhanced Compose file resolution in Util.php to support discovering the compose file via the COMPOSE_FILE variable in .env files, including support for custom envpath metadata. This makes Compose project detection more robust and flexible.
  • Fixes [Bug]: cant start complex project (akvorado) #149

Shell Script Robustness

Compose Update / Build Behavior

  • Fixed the update path so stack updates no longer force a local rebuild by default.
  • This prevents projects like Akvorado from trying to rebuild published images when the stack should simply pull the current upstream image.
  • Added an explicit opt-in rebuild toggle for stacks that genuinely need local build: rebuilds during update.
  • Fixes [Bug]: cant start complex project (akvorado) #149

Testing

  • Added a unit test to verify that Compose projects are properly loaded when the compose file is only declared in a .env file.

Copilot AI lite review requested due to automatic review settings September 6, 2026 00:13

This comment was marked as resolved.

mstrhakr and others added 17 commits September 5, 2026 20:40
…tack envpath metadata resolution

For indirect stacks, metadata files (including envpath) live in the stack directory
($this->path), but getComposeFilePath() was called with the indirect path
($this->composeSource). This prevented envpath discovery for indirect stacks.

Changes:
- Add optional $stackPath parameter to getComposeFilePath()
- Update resolveProjectEnvFilePath() to accept both compose path and stack path
- Pass $this->path as stack path when resolving compose file
- Look for envpath metadata in stack directory regardless of indirect path

This ensures indirect stacks with envpath metadata can properly discover compose files
via COMPOSE_FILE variable, matching the behavior of direct stacks.
Update getExplicitEnvFilePath() to handle relative paths in envpath metadata,
matching the behavior of resolveProjectEnvFilePath().

Previously, relative envpath values (e.g., 'config/.env') would not be resolved
correctly when used in compose commands. Now both absolute and relative paths
are supported, with relative paths resolved against the stack directory.

This ensures consistency between compose file discovery and env-file argument
construction for stacks with relative envpath metadata.
Add two new test cases to verify indirect stacks can properly discover compose
files via envpath metadata:

1. testIndirectStackLoadsWhenComposeFileViaEnvpath: Tests indirect stack with
   absolute envpath pointing to a .env file that declares COMPOSE_FILE

2. testIndirectStackLoadsWhenComposeFileViaRelativeEnvpath: Tests indirect stack
   with relative envpath (resolved relative to stack directory) pointing to a
   .env file that declares COMPOSE_FILE

Also normalize returned paths in resolveComposeFileFromEnvFile() using realpath()
to ensure consistent path representation across different resolution paths.

These tests verify the fixes in the previous commits work correctly for indirect
stacks with custom envpath metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants