Skip to content

N°9692 - Uninstall / Disable install when extension has module with missing dependencies#967

Open
Lenaick wants to merge 8 commits into
developfrom
feature/9692-unistall-extension-when-module-has-missing-depencies
Open

N°9692 - Uninstall / Disable install when extension has module with missing dependencies#967
Lenaick wants to merge 8 commits into
developfrom
feature/9692-unistall-extension-when-module-has-missing-depencies

Conversation

@Lenaick

@Lenaick Lenaick commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

N°9692 - Uninstall / Disable install when extension has module with missing dependencies

Copilot AI review requested due to automatic review settings July 8, 2026 13:52
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Jul 8, 2026
@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR prevents extensions whose module dependencies are unresolved from being silently included in a setup run. Extensions with missing dependencies are now disabled and unchecked in the wizard, the "Next" button is blocked when such an extension is mandatory, and an explanatory badge is shown for extensions that have never been installed.

  • GetAllExtensionsOptionInfo now includes missing-dependency extensions (via bKeepExtensionsHavingMissingDependencies=true) and stamps each entry with a cannot-be-installed flag.
  • ComputeChoiceFlags evaluates the new flag to disable/uncheck affected extensions; DisplayOptions blocks forward navigation for mandatory extensions in this state; and GetSelectedModules respects the flag so their modules are never added to the installation list.
  • GetNextButtonLabel's now-obsolete "Non-uninstallable extension missing" branch is removed; test coverage is extended with two new data-driven cases.

Confidence Score: 4/5

Safe to merge with one minor UX gap to consider before shipping.

The core wizard changes are correctly implemented and covered by tests. The badge suppression for already-installed extensions with missing dependencies is a UX gap that leaves admins without an explanation when an extension is silently dropped during upgrade, but it does not affect functional correctness.

setup/wizardsteps/WizStepModulesChoice.php — badge display logic around line 891

Important Files Changed

Filename Overview
setup/extensionsmap.class.inc.php Changed GetAllExtensionsOptionInfo to include extensions with missing dependencies (pass true to GetAllExtensionsToDisplayInSetup) and added the cannot-be-installed key using the already-initialised aMissingDependencies array — safe.
setup/wizardsteps/WizStepModulesChoice.php Core wizard logic updated to disable/uncheck extensions with missing dependencies, block forward movement for mandatory extensions that cannot be installed, and display a badge for non-installed affected extensions; the badge is suppressed for already-installed extensions with missing deps, which may leave admins without a clear explanation during upgrades.
tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php Updated all existing test expectations with the two new flags (cannot-be-installed, mandatory) and adds two new test cases for non-installed and installed extensions that have missing dependencies — coverage looks appropriate.
tests/php-unit-tests/unitary-tests/setup/iTopExtensionsMapFake.php Test stub updated to populate aMissingDependencies from test data; straightforward and correct.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[GetAllExtensionsOptionInfo] -->|bKeepExtensionsHavingMissingDependencies=true| B[GetAllExtensionsToDisplayInSetup]
    B --> C{aMissingDependencies > 0?}
    C -->|No| D[cannot-be-installed: false]
    C -->|Yes| E[cannot-be-installed: true]
    D --> F[ComputeChoiceFlags]
    E --> F

    F --> G{bMissingFromDisk?}
    G -->|Yes| H[disabled=true, checked=false]
    G -->|No| I{bCannotBeInstalled?}
    I -->|Yes| J[disabled=true, checked=false]
    I -->|No| K{bMandatory?}
    K -->|Yes| L[disabled=true, checked=true]
    K -->|No| M[normal flow]

    J --> P[bCanMoveForward check]
    P --> Q{mandatory OR not-uninstallable?}
    Q -->|Yes| R[bCanMoveForward = false]
    Q -->|No| S[proceed]

    J --> T[badge logic]
    T --> U{cannot-be-installed AND !installed?}
    U -->|Yes| V[orange badge shown]
    U -->|No| W[no dependency badge]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[GetAllExtensionsOptionInfo] -->|bKeepExtensionsHavingMissingDependencies=true| B[GetAllExtensionsToDisplayInSetup]
    B --> C{aMissingDependencies > 0?}
    C -->|No| D[cannot-be-installed: false]
    C -->|Yes| E[cannot-be-installed: true]
    D --> F[ComputeChoiceFlags]
    E --> F

    F --> G{bMissingFromDisk?}
    G -->|Yes| H[disabled=true, checked=false]
    G -->|No| I{bCannotBeInstalled?}
    I -->|Yes| J[disabled=true, checked=false]
    I -->|No| K{bMandatory?}
    K -->|Yes| L[disabled=true, checked=true]
    K -->|No| M[normal flow]

    J --> P[bCanMoveForward check]
    P --> Q{mandatory OR not-uninstallable?}
    Q -->|Yes| R[bCanMoveForward = false]
    Q -->|No| S[proceed]

    J --> T[badge logic]
    T --> U{cannot-be-installed AND !installed?}
    U -->|Yes| V[orange badge shown]
    U -->|No| W[no dependency badge]
Loading

Reviews (4): Last reviewed commit: "N°9692 - Uninstall / Disable install whe..." | Re-trigger Greptile

Comment thread setup/wizardsteps/WizStepModulesChoice.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 (issue N°9692) changes the iTop setup wizard so that an extension containing a module with unmet dependencies is no longer silently hidden, but is instead displayed as disabled with a new "cannot be installed" badge and excluded from mandatory auto-selection. Previously such extensions were filtered out of the setup screen entirely; now they are shown so the user understands why they can't be selected, and the "Next" button is blocked only when a mandatory (or non-uninstallable) extension is in a blocking state.

Changes:

  • ExtensionsMap::GetAllExtensionsOptionInfo() now keeps extensions with missing dependencies and exposes a cannot-be-installed flag per extension.
  • ComputeChoiceFlags() computes a cannot-be-installed state (disabled + unchecked) and now returns cannot-be-installed and mandatory flags, consumed for auto-selection, the "Next" gating logic, and a new tooltip badge.
  • Removed the "Non-uninstallable extension missing" Next-button label in favor of the badge-based messaging.

Reviewed changes

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

File Description
setup/extensionsmap.class.inc.php Includes extensions with missing dependencies in the setup option list and adds the cannot-be-installed flag.
setup/wizardsteps/WizStepModulesChoice.php Computes/propagates cannot-be-installed and mandatory flags, disables such choices, adds a badge, and adjusts Next-button gating.

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

Comment thread setup/wizardsteps/WizStepModulesChoice.php Outdated
Comment thread setup/wizardsteps/WizStepModulesChoice.php Outdated
Copilot AI review requested due to automatic review settings July 8, 2026 14:57
@Lenaick Lenaick force-pushed the feature/9692-unistall-extension-when-module-has-missing-depencies branch from b94a9de to d49a6a7 Compare July 8, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread setup/wizardsteps/WizStepModulesChoice.php Outdated
@Lenaick Lenaick requested review from Timmy38, eespie and odain-cbd July 9, 2026 12:28
Comment thread tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php Outdated
Comment thread setup/extensionsmap.class.inc.php Outdated
Comment thread setup/wizardsteps/WizStepModulesChoice.php Outdated
Comment thread setup/wizardsteps/WizStepModulesChoice.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants