Skip to content

Enhance stack management, sortable functionality, and YAML support#93

Open
mstrhakr wants to merge 66 commits intomainfrom
dev
Open

Enhance stack management, sortable functionality, and YAML support#93
mstrhakr wants to merge 66 commits intomainfrom
dev

Conversation

@mstrhakr
Copy link
Copy Markdown
Owner

This pull request introduces several key improvements and refactors across the codebase, focusing on plugin installation logic, Unraid version compatibility, and code organization. The most significant changes include a major refactor of the plugin installation and fallback logic for Ace editor and patch utilities, updates to default Docker Compose versions across all build and deploy scripts, and a reorganization of PHP source files for better maintainability.

Plugin installation and Unraid compatibility improvements:

  • Refactored Ace editor installation and fallback: The plugin now uses versioned <FILE> blocks to only install or download the Ace editor for pre-7.0 Unraid versions, caching the ZIP and extracting only when needed. This reduces unnecessary downloads and improves compatibility with Unraid 7.0+, which includes Ace by default. (compose.manager.plg) [1] [2]
  • Patch utility logic is now version-aware: Patch installation and removal scripts are only run for Unraid versions below 6.12, with clear messaging for users on newer versions. (compose.manager.plg)

Build and deployment script updates:

  • Updated default Docker Compose version from 5.0.2 to 5.1.2 across all build, deploy, and install scripts for consistency and access to the latest features and fixes. (build.ps1, build.sh, build_in_docker.sh, deploy.ps1, deploy.sh) [1] [2] [3] [4] [5] [6]

Source code and configuration organization:

  • Moved PHP source files from the php directory to include for better clarity and maintainability. Updated all relevant references in .page files, phpstan.neon, and phpunit.xml. [1] [2] [3] [4] [5] [6]
  • Updated stylesheet references in Compose.page to use the new sheets directory and corrected casing for consistency.

Test and development environment enhancements:

  • Overhauled VSCode test settings to support both PHPUnit and BATS via the pluginTests extension, improving test discovery and exclusion patterns, and removed legacy settings. (.vscode/settings.json) [1] [2]

Other improvements:

  • Improved the install.sh script to handle missing arguments more gracefully and relaxed error handling to avoid aborting on unset variables.

These changes collectively improve plugin robustness, compatibility with different Unraid versions, and maintainability of the codebase.

mstrhakr added 30 commits April 3, 2026 18:44
…showing Compose Down action in context menu while the stack is up/partial
Sortable stacks with lock functionality
…ase files

Align compose.manager directory layout with dynamix.docker.manager conventions:
- php/ -> include/ (matches dynamix include/ pattern)
- styles/ -> sheets/ (matches dynamix sheets/ pattern)
- All PHP files renamed to PascalCase
- All CSS files renamed to PascalCase

Path references not yet updated - next commit.
Update all require_once, include, URL, and asset references to use the
new directory names (include/ instead of php/, sheets/ instead of styles/)
and PascalCase filenames.

Files updated:
- 14 PHP source files (require_once paths)
- 4 .page files (asset hrefs and include paths)
- 1 JS file (AJAX endpoint URLs)
- 1 shell script (inline PHP paths)
- 1 CSS file (comment reference)
- 3 build/test configs (phpstan, phpunit, bootstrap)
- 19 test files (include paths and docblock comments)
- 1 framework example test (asset path)
Fix: Refactor folder structure for consistency with dynamix plugins
Enhance YAML loading with custom tags support and error handling
mstrhakr added 18 commits April 13, 2026 09:44
…malization method to ContainerInfo; removed ExecHelpers.php
…ug facilities (user for UI/AJAX, daemon for cron)
Copilot AI review requested due to automatic review settings April 13, 2026 19:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes Compose Manager’s install/runtime behavior for newer Unraid versions, adds stack ordering + improved state/profile tracking, and completes a broad PHP source re-org (from php/ to include/) with corresponding test + tooling updates.

Changes:

  • Refactors plugin install flow to be Unraid-version-aware (Ace fallback only pre-7.0; patch utility only pre-6.12) and updates Compose CLI version to 5.1.2.
  • Reorganizes PHP sources under source/compose.manager/include/ and updates endpoints/references accordingly.
  • Adds stack drag-and-drop ordering persistence, running profile persistence, and centralized stack state/count derivation (PHP + JS parity), plus YAML custom tag schema support.

Reviewed changes

Copilot reviewed 68 out of 68 changed files in this pull request and generated no comments.

Show a summary per file
File Description
versions.env Bumps default Compose version to 5.1.2.
tests/unit/dev_scripts.bats Adds BATS coverage for top-level dev scripts.
tests/unit/compose.bats Avoids sourcing side effects; adds shellcheck annotations.
tests/unit/UtilTest.php Updates test target path to include/Util.php.
tests/unit/StackInfoTest.php Adds tests for icon data URLs, running profiles, and container-count/state logic.
tests/unit/StackInfoSourceTest.php Updates source path assertions for Util.php.
tests/unit/OverrideInfoTest.php Updates requires to include/Util.php.
tests/unit/IconTest.php Updates include path for include/Icon.php.
tests/unit/ExecFunctionsTest.php Migrates normalize-image tests to ContainerInfo::normalizeImageForUpdateCheck().
tests/unit/ExecActionsTest.php Updates Exec include path; adds icon URL validation tests.
tests/unit/DockerUpdateTest.php Switches normalization calls to ContainerInfo::normalizeImageForUpdateCheck().
tests/unit/DefinesTest.php Updates requires to include/Defines.php.
tests/unit/DashboardStacksTest.php Uses StackInfo::getStackState(); adds paused→partial bucket regression.
tests/unit/ContainerInfoTest.php Updates requires to include/Util.php.
tests/unit/ComposeUtilTest.php Updates function includes to include/Helpers.php/Util.php/Defines.php; switches sanitization call.
tests/unit/ComposeManagerMainSourceTest.php Updates source path to include/ComposeManager.php; adds YAML tag/schema regression checks.
tests/unit/ComposeListHtmlTest.php Updates source path to include/ComposeList.php; adds regression assertion for container iteration source.
tests/unit/ComposeFilterTest.php Updates include path to include/Util.php.
tests/unit/BackupFunctionsTest.php Updates include path to include/BackupFunctions.php.
tests/unit/AutoupdateTest.php Updates includes to include/AutoUpdate.php; improves wrapper handling/cleanup.
tests/unit/AutoupdateRunnerTest.php Updates runner path to include/AutoUpdateRunner.php; improves temp config/wrapper usage and assertions.
tests/bootstrap.php Repoints bootstrap mapping to include/; adds temp-backed plugin-root mappings for CI writes.
source/pkg_build.sh Updates executable marking from php/ to include/.
source/compose.manager/sheets/EditorModal.css Expands header documentation for editor modal stylesheet.
source/compose.manager/sheets/ComboButton.css Improves header comments and updates reference to ComposeManager.php.
source/compose.manager/scripts/install-patch.sh Adds dedicated patch install/remove helper script.
source/compose.manager/scripts/install-ace.sh Adds dedicated Ace install-from-cache helper script.
source/compose.manager/scripts/compose.sh Persists running profile selections; clears them on down.
source/compose.manager/scripts/backup_cron.sh Updates PHP entrypoint paths to include/.
source/compose.manager/php/exec_functions.php Removes legacy exec helper file (functions moved/rewired).
source/compose.manager/patches/7.1-7.2/docker_system.patch Removes obsolete patch artifacts.
source/compose.manager/patches/7.1-7.2/docker_containers.patch Removes obsolete patch artifacts.
source/compose.manager/patches/7.1-7.2/docker_client.patch Removes obsolete patch artifacts.
source/compose.manager/patches/7.0/docker_system.patch Removes obsolete patch artifacts.
source/compose.manager/patches/7.0/docker_containers.patch Removes obsolete patch artifacts.
source/compose.manager/patches/7.0/docker_client.patch Removes obsolete patch artifacts.
source/compose.manager/patches/6.12/docker_containers.patch Removes obsolete patch artifacts.
source/compose.manager/patches/6.12/docker_client.patch Removes obsolete patch artifacts.
source/compose.manager/javascript/composeStackUtils.js Adds JS helper to derive stack state from container list (kept in sync with PHP).
source/compose.manager/javascript/composeSortable.js Adds drag-and-drop sorting and order persistence for stacks.
source/compose.manager/javascript/common.js Updates AJAX endpoint path and enhances client debug payloads with categories.
source/compose.manager/include/Util.php Adds stack-order persistence helpers; adds container counts/state aggregation; expands icon URL validation; moves normalization logic to ContainerInfo.
source/compose.manager/include/ShowTtyd.php Updates include path to Defines.php.
source/compose.manager/include/Icon.php Updates include path to Defines.php.
source/compose.manager/include/Helpers.php Updates includes; centralizes ttyd socket dir; changes profile selection strategy for multi-stack actions.
source/compose.manager/include/Exec.php Updates includes; adds saveStackOrder; tightens icon URL validation; returns stackState from container detail endpoint; switches to DockerUtil helpers.
source/compose.manager/include/Defines.php Adds constants for stack order file + ttyd socket dir.
source/compose.manager/include/DashboardStacks.php Uses centralized getStackState() and maps paused→partial bucket.
source/compose.manager/include/ComposeUtil.php Updates includes; uses COMPOSE_TTYD_SOCKET_DIR; updates ShowTtyd path.
source/compose.manager/include/ComposeManager.php Updates includes/endpoints; loads new JS modules; adds YAML custom tag schema support; adjusts update UI logic; integrates sortable mode behaviors.
source/compose.manager/include/ComposeList.php Updates includes; uses centralized getStackState() and getContainerCounts(); adds mover icon for sortable mode.
source/compose.manager/include/BackupFunctions.php Updates includes; swaps legacy logger helper usage to clientDebug().
source/compose.manager/include/AutoUpdateRunner.php Updates includes; improves locking and logging calls.
source/compose.manager/include/AutoUpdate.php Updates includes; updates cron runner path to include/AutoUpdateRunner.php.
source/compose.manager/compose.manager.settings.page Updates endpoints to include/; adds LockButton/sortable behavior for Updates table; sets Lock="true".
source/compose.manager/compose.manager.page Updates stylesheet paths and includes include/ComposeManager.php; sets Lock="true".
source/compose.manager/compose.manager.dashboard.page Updates endpoints to include/ and ComposeUtil path.
source/compose.manager/Compose.page Updates stylesheet paths and include to include/ComposeManager.php; sets Lock="true".
phpunit.xml Updates coverage/include directory to source/compose.manager/include.
phpstan.neon Updates analysis path to source/compose.manager/include.
install.sh Improves arg handling; relaxes strict unset handling while preserving early failure.
deploy.sh Updates default Compose version to 5.1.2.
deploy.ps1 Updates default Compose version to 5.1.2.
compose.manager.plg Adds version-aware Ace and patch logic; introduces cached zip + scripted install; path entity refactor.
build_in_docker.sh Updates default Compose version to 5.1.2.
build.sh Updates default Compose version; narrows sed rewrites to the upgradepkg FILE block.
build.ps1 Updates default Compose version to 5.1.2.
.vscode/settings.json Switches to pluginTests extension settings for PHPUnit + BATS discovery.
Comments suppressed due to low confidence (3)

source/compose.manager/include/Helpers.php:266

  • echoComposeCommandMultiple() passes -g* for the down action. compose.sh turns this into docker compose --profile "*", but Compose profiles don’t support wildcards, so profiled services are likely excluded from the config model and their containers may be left running after a “down”. Consider using the actual profile set instead (e.g. $stackInfo->getRunningProfiles() when available, otherwise $stackInfo->getProfiles() / defaults), or avoid --profile for down if Compose already removes all project containers without needing profiles.
    source/compose.manager/include/ComposeManager.php:1341
  • The “running” check used to enable Update All / render update status only looks for started or partial in the .state text. With the newly introduced paused stack state, paused stacks will be treated as stopped here (Update All stays disabled for them, and the update column shows “stopped” even though containers exist). If paused stacks should be considered active (as in DashboardStacks.php where paused is bucketed with partial), include paused in these checks or derive activity from a dedicated data attribute / data-status rather than substring matching.
    source/compose.manager/include/ComposeManager.php:1207
  • updateUpdateAllButton() / updateAllStacks() derive “running” from .state text and ignore the new paused state (started/partial only). This makes paused stacks ineligible for Update All even though they are not stopped. Consider treating paused the same as partial for these eligibility checks, or using a normalized data-status value instead of substring matching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display of status 'partial' for stacks with profiles. [Bug]: LAN IP Incorrect for external network [Bug]: Override tag causes yaml error

2 participants