Repository: promptfoo/promptfoo
Issue: Vertex AI (Google Cloud) provider ignores explicit projectId configuration
Root cause: Configuration Error

**Describe the bug**

The Vertex AI provider ignores explicitly configured `projectId` values and `VERTEX_PROJECT_ID` environment variables, always using the project ID from Application Default Credentials (ADC) instead.

This behavior differs from common Google Cloud user expectations where explicit configuration should take precedence over automatic detection.

**To Reproduce**
1. Set up Application Default Credentials with a default project:

```bash
gcloud auth application-default login
gcloud config set project my-default-project
```

2. Try either explicit configuration or environment variable:

**Option A: Explicit config (gets ignored)**
```yaml
defaultTest:
  options:
    provider:
      id: vertex:gemini-2.5-flash
      config:
        projectId: my-different-project  # This gets ignored
        region: us-central1
```
**Option B: Environment variable (also gets ignored)**
```bash
export VERTEX_PROJECT_ID=my-different-project
```

3. Run an evaluation: `promptfoo eval`
4. Observe that the evaluation targets `default-project` instead of `my-different-project` in both cases


**Expected behavior**

The explicitly configured `projectId` should be used instead of the project ID from Application Default Credentials, consistent with other Google Cloud client libraries.


**Screenshots**

Not applicable for this configuration issue.

**System information:**

If possible, please output the results of `promptfoo debug` and paste the output here.

- Promptfoo version: 0.118.3

**Additional context**

#### Current Implementation

In `src/providers/google/util.ts`, the `resolveProjectId` function incorrectly prioritizes automatically detected project ID over explicit configuration:

```typescript
return (
  googleProjectId ||        // Current: Google Auth Library takes precedence
  config.projectId ||       // Current: Explicit config has lower priority
  env?.VERTEX_PROJECT_ID ||
  env?.GOOGLE_PROJECT_ID ||
  getEnvString('VERTEX_PROJECT_ID') ||
  getEnvString('GOOGLE_PROJECT_ID') ||
  ''
);
```

#### Proposed Fix

Reorder the priority to follow standard software configuration precedence:

```typescript
return (
  config.projectId ||       // Explicit config (highest priority)
  env?.VERTEX_PROJECT_ID || // Promptfoo documented environment variables
  env?.GOOGLE_PROJECT_ID ||
  getEnvString('VERTEX_PROJECT_ID') ||
  getEnvString('GOOGLE_PROJECT_ID') ||
  googleProjectId ||        // Automatic resolution, this also reads GOOGLE_PROJECT_ID
  ''
);
```

The proposed fix follows Google Cloud library behavior.

The official Google Auth Library for Node.js implements the following precedence order:

[google-auth-library-nodejs - GoogleAuth.getProjectId()](https://github.com/googleapis/google-auth-library-nodejs/blob/71e5be902c1596eeccd52b8ea81553aa8c50571a/src/auth/googleauth.ts#L223-L252)

```javascript
/**
 * Obtains the default project ID for the application.
 *
 * Retrieves in the following order of precedence:
 * - The `projectId` provided in this object's construction
 * - GCLOUD_PROJECT or GOOGLE_CLOUD_PROJECT environment variable
 * - GOOGLE_APPLICATION_CREDENTIALS JSON file
 * - Cloud SDK: `gcloud config config-helper --format json`
 * - GCE project ID from metadata server
 */
```

This pattern of **explicit configuration > overriding with environment variables > library detection (credentials, metadata server)** is the common expectation among Google Cloud (Vertex AI) users.

Many Google Cloud users work with multiple environments (dev/staging/prod) and expect simple configuration overrides to work reliably.