Problem/Motivation

Check and verify compatibility with AI 2.x (latest dev).

The 2.x branch is ready for handling compatibility with the new major version of the module, the work should be done there.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mxr576 created an issue. See original summary.

yce’s picture

Assigned: Unassigned » yce

yce’s picture

Status: Active » Needs review

Updated two minor things, an argument name and the core version requirements.
I don't see any other outstanding compatibility issue.

arianraeesi’s picture

marcus_johansson’s picture

Assigned: yce » Unassigned
csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Status: Needs review » Reviewed & tested by the community

Environment

  • Drupal 11.3.9, PHP 8.4.12, DDEV v1.25.2
  • drupal/ai: 2.0.x-dev (b88de44) — upgraded from 1.4.x-dev
  • drupal/ai_provider_google_vertex: dev-2.x (c83e0b8) with MR !17 patch attempted
  • drupal/symfony_http_client: 1.0.0 (new dependency of AI 2.x)
  • google/cloud-ai-platform: v1.60.0 (resolved automatically)

Step 1 — Require drupal/ai 2.x and the vertex provider

Update composer.json:

composer require drupal/ai:2.0.x-dev@dev \
    drupal/ai_provider_google_vertex:dev-2.x@dev \
    drupal/symfony_http_client:^1.0 \
    --update-with-dependencies

Add the MR patch under extra.patches in composer.json:

"drupal/ai_provider_google_vertex": {
    "Issue #3566301: Compatibility with ai 2.x (MR !17)": "https://git.drupalcode.org/project/ai_provider_google_vertex/-/merge_requests/17.diff"
}

Then run:

composer install --prefer-dist

Step 2 — Run database updates

ddev drush updb -y

Expected: one pending update for ai_automators_update_11001 runs and completes successfully.

Step 3 — Enable the module

ddev drush pm:enable symfony_http_client ai_provider_google_vertex -y

Expected output:

[notice] Already installed: symfony_http_client, ai_provider_google_vertex

Step 4 — Verify the MR changes are present in the installed code

Check the setAuthentication() method signature:

ddev drush php:eval "
\$ref = new ReflectionMethod('Drupal\ai_provider_google_vertex\Plugin\AiProvider\VertexProvider', 'setAuthentication');
echo \$ref->getParameters()[0]->getName();
"

Expected output: service_account

Check core_version_requirement:

grep core_version_requirement web/modules/contrib/ai_provider_google_vertex/ai_provider_google_vertex.info.yml

Expected output: core_version_requirement: ^10.4 || ^11

Step 5 — Create a service account key and configure the provider

Create a GCP service account with Vertex AI permissions and download the JSON key:

gcloud services enable aiplatform.googleapis.com --project=PROJECT_ID
gcloud iam service-accounts create drupal-vertex-ai --display-name="Drupal Vertex AI" --project=PROJECT_ID
gcloud projects add-iam-policy-binding PROJECT_ID \
    --member="serviceAccount:drupal-vertex-ai@PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/aiplatform.user"
gcloud iam service-accounts keys create ~/vertex-key.json \
    --iam-account=drupal-vertex-ai@PROJECT_ID.iam.gserviceaccount.com

Create a Key module entry with the JSON credentials at /admin/config/system/keys/add, then navigate to /admin/config/ai/providers, select Google Vertex, and choose the newly created key from the select field.


Results

Test Result
drupal/ai updates from 1.4.x to 2.0.x without errors ✅ Pass
core_version_requirement: ^10.4 || ^11 present in installed module ✅ Pass
setAuthentication() parameter renamed (original MR: $file_location$authentication) ✅ Pass (further refactored to $service_account — see note)
Module enables without errors alongside AI 2.x ✅ Pass
Service account key selectable from Key module on provider config form ✅ Pass
MR !17 patch applies cleanly ℹ️ Not needed — changes already merged into dev-2.x

Note on MR !17 patch

The patch from MR !17 cannot be applied because both changes it introduces are already present in the dev-2.x branch and have since been extended. The parameter rename went further than the MR proposed: $file_location was first renamed to $authentication (MR !17) and subsequently refactored to $service_account in commit 05bb285 (refactor: Align GCP credentials naming with industry standards). The core_version_requirement change is also already in place. The MR can be considered resolved; the issue can be closed.

The module installs and configures correctly with AI 2.x. Both changes from MR !17 are present in the codebase. Recommending to close this issue as fixed.

This comment was produced with the assistance of an LLM