Consider Config Split for Accurate Module Removal Recommendations

Created on 30 June 2025, 7 days ago

Problem/Motivation

The Upgrade Status module currently provides recommendations for modules that could be removed during a Drupal upgrade (marked as NEXT_REMOVE). However, in environments utilizing the Config Split module, a module might be disabled in the currently active split but enabled in other splits (e.g., a production split). In such scenarios, Upgrade Status incorrectly recommends removing these modules, leading to potential data loss or incorrect upgrade paths for multi-environment setups.

For example, if a site has a module that integrates with a third-party API, this module might be disabled in a local or staging environment (where Upgrade Status can be run) but is essential and enabled in the live production environment. The current logic in Upgrade Status would flag this module for removal, which is undesirable.

Proposed resolution

Enhance the Upgrade Status module's logic, specifically when reviewing the DRUPAL_NEXT step. The proposed resolution is to:

  1. Detect if the Config Split module is installed and enabled.
  2. If Config Split is active, for any module identified as NEXT_REMOVE, check if that module is enabled in any other existing configuration splits.
  3. If a module is found to be enabled in any other split, it should not be marked as NEXT_REMOVE. Instead, it should be categorized differently or a specific recommendation should be provided, indicating that while it's not active in the current split, it is active elsewhere and might require special consideration during the upgrade process.

Remaining tasks

  • Implement the detection logic for the Config Split module.
  • Develop the logic to check module status across all defined configuration splits.

User interface changes

None.

API changes

None anticipated.

Data model changes

None anticipated.

✨ Feature request
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain Juanjol Navarra

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Juanjol
  • Pipeline finished with Failed
    7 days ago
    Total: 217s
    #535125
  • πŸ‡ͺπŸ‡ΈSpain Juanjol Navarra
  • Pipeline finished with Failed
    6 days ago
    Total: 242s
    #535192
  • Pipeline finished with Failed
    6 days ago
    Total: 415s
    #535331
  • Pipeline finished with Success
    6 days ago
    #535341
  • πŸ‡ͺπŸ‡ΈSpain Juanjol Navarra

    I've implemented a check for Config Split configurations before marking uninstalled modules for removal. The patch adds a new isModuleInConfigSplit() method that checks if a module exists in any Config Split configuration (both in complete_list and module arrays). If a module is found in a split, it's now marked for scanning instead of removal.

    I've also added unit tests to ensure the functionality works correctly with and without Config Split installed.

    This prevents the module from incorrectly suggesting to remove modules that are intentionally disabled in some environments but enabled in others via Config Split.

  • πŸ‡ͺπŸ‡ΈSpain Juanjol Navarra
  • Pipeline finished with Success
    6 days ago
    Total: 282s
    #535891
  • πŸ‡ͺπŸ‡ΈSpain Juanjol Navarra

    Added patch file version of the MR to allow add this in composer

  • Pipeline finished with Success
    5 days ago
    Total: 288s
    #537055
  • πŸ‡ͺπŸ‡ΈSpain Juanjol Navarra

    I've fixed the MR by removing the logic that sends packages for scanning when they're installed via config split ignoring precious scan results. Updated MR and patch.

  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    Very complete suggestion, thanks! From my visual review, it looks fine, however I don't use config split :) Can you get anyone else review / try it? It looks like it would not have negative side effects at least, but would be good to have another set of eyes/hands on it.

  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

    RTBC!!!
    Before patch (shows modules only enabled on prod config split):

    After the patch, it only shows the content install module (it is only installed once on a site setup to create default content and then uninstalled):

Production build 0.71.5 2024