Turn ActivationManager::getActivationInfo() into a dedicated normalizer

Created on 13 February 2025, about 2 months ago

In reviewing Add instuctions for configuring installed modules Active with @tim.plunkett, we both agreed that ActivationManager doesn't quite abide by the single-responsibility principle. It actively delegates to activators to read projects' statuses, and activate projects on the site...and it has to prepare projects for final delivery to the front-end. These things aren't really related.

We should consider splitting the getActivationInfo() method into a dedicated normalizer that handles Project objects and turns them into data that can be consumed by the frontend. This would be a cleaner design for a few reasons:

  • The job that getActivationInfo() is actually doing is normalization, so we might as well formally recognize that by moving it into a normalizer.
  • Normalizers have an interface, which means that modules that wish to extend Project Browser could add more activation-related superpowers.
  • Modules that want to swap out Project Browser's frontend entirely (which is an unlikely, but theoretically legitimate possibility) would be able to normalize Project objects in ways that make sense to them.
📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States phenaproxima Massachusetts

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

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • 🇺🇸United States phenaproxima Massachusetts
  • 🇺🇸United States phenaproxima Massachusetts
  • Merge request !738Sketch in the normalizer → (Merged) created by phenaproxima
  • Pipeline finished with Failed
    about 1 month ago
    Total: 812s
    #428083
  • Pipeline finished with Failed
    about 1 month ago
    Total: 585s
    #428101
  • First commit to issue fork.
  • Pipeline finished with Success
    about 1 month ago
    Total: 446s
    #428480
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1673s
    #428516
  • Pipeline finished with Failed
    about 1 month ago
    Total: 292s
    #428568
  • Pipeline finished with Failed
    about 1 month ago
    Total: 421s
    #428574
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 463s
    #430120
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 202s
    #430124
  • Pipeline finished with Failed
    about 1 month ago
    Total: 257s
    #430125
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 124s
    #430128
  • Pipeline finished with Failed
    about 1 month ago
    Total: 403s
    #430129
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 125s
    #430144
  • Pipeline finished with Failed
    about 1 month ago
    Total: 404s
    #430145
  • Pipeline finished with Failed
    about 1 month ago
    Total: 377s
    #430151
  • Pipeline finished with Failed
    about 1 month ago
    Total: 381s
    #430154
  • Pipeline finished with Failed
    about 1 month ago
    Total: 319s
    #430156
  • Pipeline finished with Failed
    about 1 month ago
    Total: 399s
    #430160
  • Pipeline finished with Failed
    about 1 month ago
    Total: 326s
    #430168
  • Pipeline finished with Failed
    about 1 month ago
    Total: 431s
    #430169
  • Pipeline finished with Failed
    about 1 month ago
    Total: 567s
    #430184
  • Pipeline finished with Failed
    about 1 month ago
    Total: 519s
    #430203
  • 🇺🇸United States phenaproxima Massachusetts
  • Pipeline finished with Success
    about 1 month ago
    Total: 834s
    #430212
  • 🇺🇸United States phenaproxima Massachusetts
  • Pipeline finished with Success
    about 1 month ago
    Total: 548s
    #430944
  • Pipeline finished with Success
    about 1 month ago
    Total: 366s
    #430948
  • 🇺🇸United States tim.plunkett Philadelphia

    tim.plunkett made their first commit to this issue’s fork.

  • Pipeline finished with Success
    about 1 month ago
    Total: 493s
    #432755
  • Pipeline finished with Success
    about 1 month ago
    Total: 375s
    #433836
  • First commit to issue fork.
  • 🇺🇸United States chrisfromredfin Portland, Maine

    having an issue installing the RDF module when max_selections == 1

    failed request to https://pb11.ddev.site/admin/modules/project_browser/install-require/vJGZ7DQb3s7smsKB7g8ugr3MADpHwq9C: {"message":"StageException: Failed to run process: \u003Cem class=\u0022placeholder\u0022\u003EThe command \u0026quot;\u0026#039;\/var\/www\/html\/vendor\/bin\/composer\u0026#039; \u0026#039;--working-dir=\/tmp\/.package_managerf67b6eaa-503f-4bec-b2fa-795a3972b530\/vJGZ7DQb3s7smsKB7g8ugr3MADpHwq9C\u0026#039; \u0026#039;update\u0026#039; \u0026#039;--with-all-dependencies\u0026#039; \u0026#039;--optimize-autoloader\u0026#039; \u0026#039;drupal\/rdf\u0026#039;\u0026quot; failed.\n\nExit Code: 2(Misuse of shell builtins)\n\nWorking directory: \/var\/www\/html\/web\n\nOutput:\n================\n\n\nError Output:\n================\nLoading composer repositories with package information\nUpdating dependencies\nYour requirements could not be resolved to an installable set of packages.\n\n  Problem 1\n    - Root composer.json requires drupal\/rdf ^2.1 -\u0026gt; satisfiable by drupal\/rdf[2.1.0, 2.1.1, 2.x-dev].\n    - drupal\/rdf[2.1.0, ..., 2.x-dev] require drupal\/core ^9.4 || ^10.0 -\u0026gt; found drupal\/core[9.4.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.5.x-dev] but these were not loaded, likely because it conflicts with another require.\n\n\u003C\/em\u003E","phase":"require"} Response {type: 'basic', url: 'https://pb11.ddev.site/admin/modules/project_brows…/install-require/vJGZ7DQb3s7smsKB7g8ugr3MADpHwq9C', redirected: false, status: 500, ok: false, …}
    
    popup.js:56 Uncaught (in promise) TypeError: Drupal$1.dialog is not a function
        at openPopup (popup.js:56:29)
        at handleError (InstallListProcessor.js:87:3)
        at doRequests (InstallListProcessor.js:181:15)
        at async processInstallList (InstallListProcessor.js:223:5)
        at async HTMLButtonElement.onClick (ActionButton.svelte:47:42)
    
  • Pipeline finished with Success
    about 1 month ago
    Total: 3261s
    #433860
  • 🇺🇸United States chrisfromredfin Portland, Maine

    j/k this didn't happen after a reinstall. I think my local was just a little messed up.

  • Pipeline finished with Skipped
    about 1 month ago
    #433914
  • 🇺🇸United States chrisfromredfin Portland, Maine

    this is way cool. two follow-ups adam is creating that are UI-related bugs when there's an error, but not directly caused by this code and those will be small, so prefer them in FUs.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 1105s
    #436366
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1236s
    #436372
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1662s
    #437822
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 1232s
    #437835
  • Pipeline finished with Success
    about 1 month ago
    Total: 1641s
    #437844
  • Pipeline finished with Success
    about 1 month ago
    Total: 1507s
    #438321
  • Pipeline finished with Failed
    29 days ago
    Total: 1862s
    #440225
  • Pipeline finished with Canceled
    28 days ago
    Total: 770s
    #440916
  • Pipeline finished with Success
    28 days ago
    Total: 1411s
    #440926
  • Pipeline finished with Failed
    28 days ago
    Total: 1364s
    #440994
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024