Skip to content

E2E tests broken: OIDC mint requires real GCP project with WIF and Secret Manager #817

@waynesun09

Description

@waynesun09

Problem

The OIDC mint migration (#503) breaks E2E tests. The admin install E2E flow now provisions real GCP infrastructure (WIF pool/provider, Secret Manager secrets, Cloud Function), but the test suite uses a fake e2eDispatcher{} that doesn't create any of this.

The triage dispatch smoke test (line ~592 in e2e/admin/admin_test.go) triggers a real GitHub Actions workflow run. That workflow calls google-github-actions/auth@v3 to exchange a GitHub OIDC token for GCP credentials via the mint Cloud Function. Without a real WIF provider and deployed mint function, the token exchange fails and the workflow errors out.

What's faked vs what's real

Component Current E2E Needed
GitHub App creation Real (Playwright manifest flow) No change
App PEM storage Skipped by fake dispatcher Real Secret Manager secrets
WIF pool/provider Skipped by fake dispatcher Real WIF with GitHub OIDC
Cloud Function (mint) Skipped by fake dispatcher Real deployed function
FULLSEND_MINT_URL org var Set to placeholder by fake Must point to real function URL
Workflow dispatch Real (gh workflow run) No change
OIDC token exchange Fails — no WIF/mint exists Must succeed against real mint

Key code references

  • e2e/admin/admin_test.go:835buildTestLayerStack passes &e2eDispatcher{} to NewOIDCDispatchLayer
  • e2e/admin/admin_test.go:452verifyInstalled checks FULLSEND_MINT_URL org variable exists
  • e2e/admin/admin_test.go:592 — triage dispatch smoke test triggers real workflow

Required GCP resources

A dedicated GCP project for E2E testing needs:

  1. Workload Identity Federation

    • WIF pool (e.g., fullsend-e2e-pool)
    • WIF provider with GitHub OIDC issuer, attributeCondition scoped to E2E org
    • Allowed audiences: custom audience + IAM-format URI
  2. Secret Manager

    • Org-scoped PEM secrets: fullsend-{org}--{role}-app-pem for each agent role
    • Service account must have secretmanager.versions.access
  3. Cloud Functions (2nd gen)

    • Deployed mint function with env vars: ALLOWED_ORGS, ROLE_APP_IDS, WIF_POOL_NAME, WIF_PROVIDER_NAME, OIDC_AUDIENCE, GCP_PROJECT_NUMBER
  4. Service Account

    • With roles: roles/cloudfunctions.admin, roles/iam.workloadIdentityPoolAdmin, roles/secretmanager.admin, roles/iam.serviceAccountUser
    • JSON key stored as GitHub Actions secret

New CI environment variables / secrets

Name Type Description
E2E_GCP_PROJECT_ID Secret GCP project ID for E2E mint infrastructure
E2E_GCP_PROJECT_NUMBER Secret GCP project number (for WIF audience)
E2E_GCP_SA_KEY Secret Service account JSON key for provisioning
E2E_WIF_POOL_NAME Var WIF pool name (e.g., fullsend-e2e-pool)
E2E_WIF_PROVIDER_NAME Var WIF provider name (e.g., github-oidc)

Options

Option A: Real GCP project in CI (recommended)

Stand up a dedicated GCP project for E2E. The provisioner already handles idempotent creation (409 = exists). Each E2E run would:

  1. Use real GCFProvisioner instead of e2eDispatcher{}
  2. Provision WIF + secrets + function (idempotent, fast on repeat runs)
  3. Run the full admin install flow including triage dispatch
  4. Tear down is optional — resources are scoped to E2E org

Pros: Tests the real path end-to-end. Catches issues like the WIF audience mismatch that unit tests miss.
Cons: Requires GCP project setup, costs (minimal — Cloud Functions free tier), CI secret management.

Option B: Enhanced fake dispatcher

Keep e2eDispatcher{} but make it smarter — deploy a mock HTTP endpoint that returns valid-looking tokens without real GCP. Skip the OIDC exchange in the workflow.

Pros: No GCP dependency.
Cons: Doesn't test the actual token exchange path. Misses real integration issues.

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions