Skip to content

Conversation

@CLHatch
Copy link
Contributor

@CLHatch CLHatch commented Oct 25, 2025

Pull request

Purpose
Describe the problem or feature in addition to a link to the issues.

Approach
How does this change address the problem?

Open Questions and Pre-Merge TODOs
Check all boxes as they are completed

  • Use github checklists. When solved, check the box and explain the answer.

Learning
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem

Requirements
Check all boxes as they are completed

Summary by Sourcery

Enable auto-detection and manual selection of the system package manager via new commands and interactive menus, centralize detection logic, and persist the user’s choice in configuration

New Features:

  • Add --config-pm commands (auto, list, table, existing-list, existing-table) to configure and display supported package managers
  • Introduce interactive menu option and menu_options_package_manager script for selecting the package manager
  • Implement package_manager_init and config_package_manager scripts to detect and persist user-preferred package manager
  • Add utility scripts to list, table, validate, and describe supported and detected package managers

Enhancements:

  • Rename apply_theme to config_theme and update all references
  • Extend PM_PACKAGE_MANAGERS with metadata (nicename, description) and add ‘none’ option
  • Remove legacy pm_find_package_manager and centralize detection logic in package_manager_init

Tests:

  • Add stub and unit tests for new package manager scripts and menu options

@CLHatch CLHatch requested a review from a team as a code owner October 25, 2025 04:34
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 25, 2025

Reviewer's Guide

This PR introduces a comprehensive package manager selection subsystem by adding new CLI options, configuration scripts, initialization logic, menu UI, and helper utilities, while also standardizing theme handling via config_theme.

Sequence diagram for package manager initialization and selection

sequenceDiagram
    actor User
    participant Menu as "Options Menu"
    participant UI as "menu_options_package_manager()"
    participant Config as "config_package_manager()"
    participant Init as "package_manager_init()"
    participant PM as "PM logic"
    User->>Menu: Open Options
    Menu->>UI: Select "Package Manager"
    UI->>Config: Set PackageManager in config
    Config->>Init: Trigger package_manager_init
    Init->>PM: Validate and detect package manager
    PM->>Init: Return selected/detected PM
    Init->>UI: Notify selection result
    UI->>User: Show confirmation
Loading

Entity relationship diagram for package manager config in dockstarter.ini

erDiagram
    DOCKSTARTER_INI {
        string Borders
        string LineCharacters
        string PackageManager
        string Scrollbar
        string Shadow
        string Theme
    }
    DOCKSTARTER_INI ||--o| PACKAGE_MANAGER : has
    PACKAGE_MANAGER {
        string name
        string nicename
        string description
    }
Loading

Class diagram for package manager configuration and selection scripts

classDiagram
    class config_package_manager {
        +config_package_manager(PackageManager)
    }
    class package_manager_init {
        +package_manager_init()
    }
    class package_manager_list {
        +package_manager_list()
    }
    class package_manager_existing_list {
        +package_manager_existing_list()
    }
    class package_manager_table {
        +package_manager_table()
    }
    class package_manager_existing_table {
        +package_manager_existing_table()
    }
    class package_manager_is_valid {
        +package_manager_is_valid(PackageManager)
    }
    class package_manager_exists {
        +package_manager_exists(PackageManager)
    }
    class package_manager_nicename {
        +package_manager_nicename(PackageManager)
    }
    class package_manager_description {
        +package_manager_description(PackageManager)
    }
    config_package_manager <|-- package_manager_init
    package_manager_list <|-- package_manager_table
    package_manager_existing_list <|-- package_manager_existing_table
    package_manager_is_valid <|-- package_manager_exists
    package_manager_is_valid <|-- package_manager_nicename
    package_manager_is_valid <|-- package_manager_description
Loading

File-Level Changes

Change Details Files
Add new CLI flags for package manager configuration
  • Extend parse_arguments with --config-pm variants
  • Map new flags to run_command actions and availability
  • Update usage output to document list/table commands
.includes/cmdline.sh
.includes/usage.sh
Implement package manager configuration and initialization
  • Create config_package_manager.sh to read/update INI
  • Add package_manager_init.sh to detect or validate PM
  • Add menu_options_package_manager.sh for interactive selection
  • Introduce package_manager_{list,table,existing_list,existing_table,exists,is_valid,nicename,description}.sh utilities
.scripts/config_package_manager.sh
.scripts/package_manager_init.sh
.scripts/menu_options_package_manager.sh
.scripts/package_manager_*.sh
Extend and reorganize PM variables and defaults
  • Add PM_NICENAME and PM_DESCRIPTION maps and insert “none” option
  • Reorder PM_PACKAGE_MANAGERS and define PM_NONE_COMMAND_DEPS
  • Add PackageManager default to dockstarter.ini
  • Modify config_set to clear PM when updating INI
.includes/pm_variables.sh
.defaults/dockstarter.ini
.scripts/config_set.sh
Integrate package_manager_init across dependency and pm scripts
  • Call package_manager_init in main.sh init_check_dependencies
  • Replace older pm_find and pm__check calls in pm__install, pm__clean, pm__install_docker, pm__repos, pm__upgrade
main.sh
.scripts/pm__install.sh
.scripts/pm__clean.sh
.scripts/pm__install_docker.sh
.scripts/pm__repos.sh
.scripts/pm__upgrade.sh
Rename apply_theme to config_theme and update integrations
  • Rename apply_theme script to config_theme and tests
  • Replace run_script 'apply_theme' with 'config_theme' in dialog functions and menus
  • Update apply_config and menu_heading to use config_theme
.scripts/config_theme.sh
.includes/dialog_functions.sh
.scripts/*theme*.sh
.scripts/menu_options_display.sh
.scripts/apply_config.sh
.scripts/menu_heading.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@CLHatch CLHatch merged commit 24ff1ad into main Oct 25, 2025
18 of 19 checks passed
@CLHatch CLHatch deleted the pmconfig branch October 25, 2025 04:34
@github-actions github-actions bot added the core Automatic label label Oct 25, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

CLHatch added a commit that referenced this pull request Oct 25, 2025
commit 0baf2df
Author: CLHatch <[email protected]>
Date:   Sat Oct 25 00:53:38 2025 -0500

    Remove `-T` from the `--pm-config` and `--pm-config-auto` usages text (#2285)

commit d60ce73
Author: CLHatch <[email protected]>
Date:   Sat Oct 25 00:40:28 2025 -0500

    Add the missing `--config-pm` and `--config-pm-auto` usage text (#2284)

commit 24ff1ad
Author: CLHatch <[email protected]>
Date:   Fri Oct 24 23:34:52 2025 -0500

    Add package manager selection options (#2283)

commit 79f4ab5
Author: CLHatch <[email protected]>
Date:   Fri Oct 24 12:55:45 2025 -0500

    Allow optional arguments during fresh install. (#2282)

commit 89f07d4
Author: CLHatch <[email protected]>
Date:   Thu Oct 23 03:17:56 2025 -0500

    Change `menu.ini` to `dockstarter.ini` (#2281)

commit 9653caa
Author: CLHatch <[email protected]>
Date:   Tue Oct 21 03:17:22 2025 -0500

    Add `backrest` (#2280)

commit b457e6d
Author: CLHatch <[email protected]>
Date:   Mon Oct 20 23:57:12 2025 -0500

    Remove extraneous newline in Calibre variable file (#2279)

commit 2e9ba0c
Author: CLHatch <[email protected]>
Date:   Mon Oct 20 23:53:38 2025 -0500

    Adjust a comment heading slightly for Calibre (#2278)

commit e69d985
Author: CLHatch <[email protected]>
Date:   Mon Oct 20 22:49:44 2025 -0500

    Update Calibre ports and variables (#2277)

    Resolves #2271

commit bf35f6f
Author: CLHatch <[email protected]>
Date:   Sun Oct 19 07:47:51 2025 -0500

    Move the `.dialogrc` and `.dialogoptions` files to the temp folder (#2276)

commit acaf094
Author: CLHatch <[email protected]>
Date:   Sun Oct 19 06:10:16 2025 -0500

    Correct the branch from `macos` to `main` (#2275)

commit 0d09be4
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sun Oct 19 02:33:31 2025 +0000

    Update mstruebing/editorconfig-checker Docker tag to v3.4.1

commit 0ac574f
Author: CLHatch <[email protected]>
Date:   Sat Oct 18 21:32:56 2025 -0500

    Fix typo in error message (#2274)

commit c296ce3
Author: CLHatch <[email protected]>
Date:   Sat Oct 18 21:28:49 2025 -0500

    Remove extraneous character in bash version check (#2273)

commit 96b87fc
Author: CLHatch <[email protected]>
Date:   Sat Oct 18 19:27:44 2025 -0500

    Support MacOS (#2272)

commit afc32e0
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Oct 15 14:02:17 2025 +0000

    Update dependency mkdocs-material to v9.6.22
CLHatch added a commit that referenced this pull request Oct 28, 2025
CLHatch added a commit that referenced this pull request Oct 28, 2025
* Update `synlink_ds` to check folders in the order they are listed in the PATH variable (#2270)

* Update dependency mkdocs-material to v9.6.22

* Support MacOS (#2272)

* Remove extraneous character in bash version check (#2273)

* Fix typo in error message (#2274)

* Update mstruebing/editorconfig-checker Docker tag to v3.4.1

* Correct the branch from `macos` to `main` (#2275)

* Move the `.dialogrc` and `.dialogoptions` files to the temp folder (#2276)

* Update Calibre ports and variables (#2277)

Resolves #2271

* Adjust a comment heading slightly for Calibre (#2278)

* Remove extraneous newline in Calibre variable file (#2279)

* Add `backrest` (#2280)

* Change `menu.ini` to `dockstarter.ini` (#2281)

* Allow optional arguments during fresh install. (#2282)

* Add package manager selection options (#2283)

* Add the missing `--config-pm` and `--config-pm-auto` usage text (#2284)

* Remove `-T` from the `--pm-config` and `--pm-config-auto` usages text (#2285)

* Update group functions (#2286)

* Update tandoor environment and ports to 80 from 8080 (#2269)

* Update tandoor environment and ports to 80 from 8080
Tandoor introducted a breaking change in their latest release,
changing the default port from 8080 to 80.

* Add storage ON options to Tandoor environment

Added storage configuration options for Tandoor instance.

* Add storage configuration options to tandoor.migrate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: smilerz <[email protected]>
CLHatch added a commit that referenced this pull request Oct 28, 2025
commit 1805f5e
Author: CLHatch <[email protected]>
Date:   Tue Oct 28 09:54:20 2025 -0500

    Re-apply Tandoor update (#2289)

    * Update `synlink_ds` to check folders in the order they are listed in the PATH variable (#2270)

    * Update dependency mkdocs-material to v9.6.22

    * Support MacOS (#2272)

    * Remove extraneous character in bash version check (#2273)

    * Fix typo in error message (#2274)

    * Update mstruebing/editorconfig-checker Docker tag to v3.4.1

    * Correct the branch from `macos` to `main` (#2275)

    * Move the `.dialogrc` and `.dialogoptions` files to the temp folder (#2276)

    * Update Calibre ports and variables (#2277)

    Resolves #2271

    * Adjust a comment heading slightly for Calibre (#2278)

    * Remove extraneous newline in Calibre variable file (#2279)

    * Add `backrest` (#2280)

    * Change `menu.ini` to `dockstarter.ini` (#2281)

    * Allow optional arguments during fresh install. (#2282)

    * Add package manager selection options (#2283)

    * Add the missing `--config-pm` and `--config-pm-auto` usage text (#2284)

    * Remove `-T` from the `--pm-config` and `--pm-config-auto` usages text (#2285)

    * Update group functions (#2286)

    * Update tandoor environment and ports to 80 from 8080 (#2269)

    * Update tandoor environment and ports to 80 from 8080
    Tandoor introducted a breaking change in their latest release,
    changing the default port from 8080 to 80.

    * Add storage ON options to Tandoor environment

    Added storage configuration options for Tandoor instance.

    * Add storage configuration options to tandoor.migrate

    ---------

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: smilerz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Automatic label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants