D10: Update recommendation for Acquia Connector (drupal/acquia_connector)

Created on 22 January 2024, 10 months ago
Updated 29 February 2024, 9 months ago

Problem/Motivation

Project url: https://www.drupal.org/project/acquia_connector β†’

This module has been previously vetted for Drupal 9 with the following snippet added to curated.json:

{
  "package": "drupal/acquia_connector",
  "constraint": "^4",
  "install": [
    "acquia_connector"
  ],
  "replaces": [
    {
      "name": "acquia_agent"
    },
    {
      "name": "acquia_connector"
    },
    {
      "name": "acquia_spi"
    }
  ],
  "vetted": true
}

Steps to reproduce

n/a

Proposed resolution

Take snippet from D9 recommendation, update for Drupal 10 compatibility, add to D10 curated.json

Remaining tasks

  1. On a D7 site, install Acquia Connector
  2. Add snippet from D9 recommendation into D10 curated.json (locally)
  3. Generate new recommendations.json
  4. Use acli to generate a new D10 project based on this new recommendations.json file
  5. Test to see if old recommendation still works
  6. If not, update recommendation snippet to D10 appropriate values and update recommendations.json by running make

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ“Œ Task
Status

Fixed

Version

1.9

Component

Recommendations

Created by

πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

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

Merge Requests

Comments & Activities

  • Issue created by @dan612
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    The latest version of the Acquia Connector module is 4.0.5. This aligns with the value found in curated.json for Drupal 9 recommendations, and as such this should need no alterations/changes.

    There are two migrations to test as well:

    1. d7_acquia_connector.settings
    2. d7_acquia_connector_susbcription_data
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    In Drupal 7, Acquia Connector settings are stored in the variable table. These are migrated into the state API (key_value table) in D9/D10.

    For d7_acquia_connector_settings, the following mapping of state name (destination) to variable name (source) exists:

    process:
      debug: acquia_agent_debug
      cron_interval: acquia_spi_cron_interval
      cron_interval_override: acquia_spi_cron_interval_override
      hide_signup_messages: acquia_agent_hide_signup_messages
    

    These can be viewed with a query in D7 database like: select * from variable where name like "%acquia_%" and not name="acquia_subscription_data";

    When processing this migration, it completes but i'm not sure how to get the source data in place as I did not have any of the settings in the mapping in my version of the module. It appears these:

    1. acquia_agent_debug
    2. acquia_agent_hide_signup_messages

    are legacy variables and thus installing a newer version of the module won't implement them. These ones:

    1. acquia_spi_cron_interval
    2. acquia_spi_cron_interval_override

    are part of the acquia_spi module, which does this on hook_install:

    /**
     * Implements hook_install().
     */
    function acquia_spi_install() {
      module_disable(['acquia_spi']);
      drupal_uninstall_modules(['acquia_spi']);
    }
    

    And then hook_uninstalls all of the related variables. So it would appear I cannot test migrating these values unless I have legacy system in place.

    For d7_acquia_connector_susbcription_data , the following mapping of state name (destination) to variable name (source) exists:

    process:
      acquia_subscription_data: acquia_subscription_data
    

    and the migration works:

  • Status changed to Needs work 10 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    When processing this migration, it completes but i'm not sure how to get the source data in place as I did not have any of the settings in the mapping in my version of the module. It appears these:

    Which version of the Drupal 7 module did you install?

    Which older version of the Drupal 7 module did contain those variables?

    So it would appear I cannot test migrating these values unless I have legacy system in place.

    It looks like this module's migrations have been poorly written, documented and especially poorly maintained.

    Generally speaking, it's always recommended for sites to first update to the latest stable version of all modules on Drupal 7. And then start the migration. Many times in the past did we see users of AM:A trying to use alpha/beta module versions that had gotten stable releases years ago πŸ™ˆ

    That also means it's recommended to update the migration to stop referring to variables that no longer exist (and per your link have not existed for well over a year).

  • Pipeline finished with Success
    10 months ago
    #81384
  • Pipeline finished with Success
    10 months ago
    #81388
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    Which version of the Drupal 7 module did you install?

    I was using 7.x-4.6 version of the module, the latest stable release.

    Which older version of the Drupal 7 module did contain those variables?

    They are actually spread across 2 sub-modules. These

    1. acquia_agent_debug
    2. acquia_agent_hide_signup_messages

    are part of acquia_agent and these

    1. acquia_spi_cron_interval
    2. acquia_spi_cron_interval_override

    are part of acquia_spi. Im not sure the best way to determine when these variables were last in use other than like, parsing the entire git commit history which seems a bit daunting. Or checkout every version locally and do CTRL + F for those variables.

    That also means it's recommended to update the migration to stop referring to variables that no longer exist (and per your link have not existed for well over a year).

    As far as I can tell, this would mean we dont even need the d7_acquia_connector_settings migration anymore since none of these variables appear in use:

    1. acquia_agent_debug
    2. acquia_spi_cron_interval
    3. acquia_spi_cron_interval_override
    4. acquia_agent_hide_signup_messages

    I think I need to understand what the D9/D10 version of Acquia Connector is setting and if those values are being populated with just the subscription data migration or if we need to update the settings migration to target different variables. These variables are present in D7 after a fresh install and set up...and do not appear to get migrated:

    MySQL [drupal7]> select * from variable where name like "%acquia_%" and not name="acquia_subscription_data";
    +-------------------------+----------------------------------------------+
    | name                    | value                                        |
    +-------------------------+----------------------------------------------+
    | acquia_application_uuid | s:36:"<redacted>"; |
    | acquia_identifier       | s:11:"<redacted>";                          |
    | acquia_key              | s:32:"<redacted>";     |
    +-------------------------+----------------------------------------------+
    3 rows in set (0.013 sec)
    

    In 4.x of Acquia Connector it seems like these values are needed - https://git.drupalcode.org/project/acquia_connector/-/blob/4.x/src/Form/...

  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    The settings in the migration:

    acquia_agent_debug
    acquia_spi_cron_interval
    acquia_spi_cron_interval_override
    acquia_agent_hide_signup_messages
    

    are no longer needed for migration as they are unsettable (via normal means) in the latest stable Drupal 7 version and are legacy/unused in new versions of Acquia Connector.

    This MR - https://www.drupal.org/project/acquia_connector/issues/3416551 πŸ› Update settings migration to target state API Needs work - changes the destination of Connector Settings to the State API, and changes the variable naming conventions to match those of the latest Drupal 7 module.
    -----
    Here is my Drupal 7 site, connected:

    And here is my brand new D10 site, after running the migrations:

  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine
  • Pipeline finished with Success
    10 months ago
    #81566
  • Status changed to Needs work 10 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    #7:

    As far as I can tell, this would mean we dont even need the d7_acquia_connector_settings migration anymore since none of these variables appear in use:

    πŸ‘

    I think I need to understand what the D9/D10 version of Acquia Connector is setting and if those values are being populated with just the subscription data migration or if we need to update the settings migration to target different variables.

    Indeed!

    These variables are present in D7 after a fresh install and set up...and do not appear to get migrated:

    Nice job on this detective work! πŸ•΅οΈ I reviewed the upstream issue and provided extra pointers: #3416551-3: Update settings migration to target state API β†’ .

    (The original migration from #3204533: Migrate Acquia Connector configurations from Drupal 7 β†’ was fine, but the new 7.x-4.x branch was created after that migration, and they forgot to update the migration accordingly πŸ™ˆ)

    #8: Looks great 🀩

    The one merge-blocking thing is the reliance on the automagic "MR-as-patch" functionality: that's unsafe. MR comment: https://git.drupalcode.org/project/acquia_migrate/-/merge_requests/23#no....

  • Pipeline finished with Success
    10 months ago
    #81935
  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine
  • Status changed to Needs work 10 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    On second thought, I think it'd be safer to address #3416551-3: Update settings migration to target state API β†’ too before merging this β€” otherwise we risk breaking migrations from Drupal 7 sites that are still using an older version of Acquia Connector.

    Or … is that not possible for some reason β€” is it guaranteed that all Drupal 7 versions are using version 4 of the module?

  • Pipeline finished with Success
    10 months ago
    Total: 520s
    #86269
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine
  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine
  • Pipeline finished with Success
    10 months ago
    Total: 432s
    #90840
  • Status changed to Needs work 10 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    #13: are you proposing to not fix πŸ› Update settings migration to target state API Needs work ? πŸ€” See my comments on the MR, I think I see what's wrong πŸ€“

    This also needs a rebase after πŸ“Œ D10: Re-vet Token Filter (drupal/token_filter) Fixed .

  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    #13: are you proposing to not fix #3416551: Update settings migration to target state API? πŸ€” See my comments on the MR, I think I see what's wrong πŸ€“

    Thanks! Also thank you for the guidance on rebasing to remove all the make commits interactively - that make the whole process much smoother.

    I made some adjustments to https://www.drupal.org/project/acquia_connector/issues/3416551 πŸ› Update settings migration to target state API Needs work - not sure about how to do the minimum_version approach via annotation. Its like i would need a maximum_version as well which would be applied to the v3 source plugin.

    The patch fails to apply cleanly for me for some reason β†’ despite passing all tests. Not sure what is going on there but trying to sort it out locally.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    The patch fails to apply cleanly for me for some reason despite passing all tests. Not sure what is going on there but trying to sort it out locally.

    Any chance it's this? https://github.com/cweagans/composer-patches/issues/326 πŸ˜…

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • πŸ‡ΊπŸ‡ΈUnited States dan612 Portland, Maine

    Nice! I think that resolved the issueπŸ˜…πŸ€ž. I updated the recommendation and tested it locally. Video here 😎 β†’

  • Pipeline finished with Success
    9 months ago
    Total: 344s
    #95110
  • Issue was unassigned.
  • Status changed to RTBC 9 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
    1. Screencast shows the migration working end-to-end
    2. The applied patch is passing tests and RTBC: #3416551-20: Update settings migration to target state API β†’
  • Pipeline finished with Skipped
    9 months ago
    #95735
  • Status changed to Fixed 9 months ago
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024