Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.envfiles, and a safer approach to handling project directories in the shell script. Unit tests were also added to ensure correct behavior.User Experience Improvements
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]Error Handling and Logging
composeManagerMain.jsto capture more detailed error information, making debugging and monitoring more effective.Docker Compose Project Discovery
Util.phpto support discovering the compose file via theCOMPOSE_FILEvariable in.envfiles, including support for customenvpathmetadata. This makes Compose project detection more robust and flexible.Shell Script Robustness
compose.sh) tocdinto the project directory instead of passing--project-directory, ensuring Docker Compose discovery works consistently with the validated workflow. [1] [2] [3]Compose Update / Build Behavior
build:rebuilds during update.Testing
.envfile.