Skip to content

ci: migrate behaviour tests to single-org ephemeral repos #6864

Description

@ggallen

Summary

Migrate behaviour tests from the current pool-of-12-orgs model to a single configurable org (fullsend-ai-test) with ephemeral UUID-named repos. This supersedes #6815, #6829, and PR #6820 — combining the single-org migration with pool machinery cleanup, vendoring removal, and driver simplification.

Motivation

The current infrastructure is:

  • Complex: 12 halfsend-* orgs with distributed locking (e2e-lock repo), channel-based pool of fixed-name repos, singleflight-cached ensurer
  • Slow: 50MB vendored binary pushed per repo via github setup --vendor
  • Fragile: CreateRepo polls GetRepo (API-layer only) instead of GetRef (git-layer), causing 422 Tree SHA does not exist and 409 Git Repository is empty errors

Target Architecture

  • One org via BEHAVIOUR_ORG env var (default fullsend-ai-test)
  • Ephemeral repos named bt-{uuid[:8]}-{scenario-slug} (95-char limit to reserve 5 for -fork suffix)
  • repos install --fullsend-ref as the only install path — no vendoring, no github setup
  • No pool: no channel, no semaphore, no pre-allocation, no outstanding tracking
  • No enrollment: preview mint deploys with PER_REPO_WIF_REPOS=*; repos install --mint-url writes the repo variable
  • Simplified driver: CreateRepo(ctx, hint) / DeleteRepo(ctx, name) / Finalize(ctx)
  • Simplified ensurer: single CreateRepo(ctx, org, hint) (name, error) method — generates name, creates repo, polls GetRef("heads/main") for git readiness, runs repos install, validates, waits for workflow
  • Fork cleanup in scenario cleanup (steps/cleanup.go), not driver
  • E2E_KEEP_REPOS=true to preserve repos for debugging

Changes

Infrastructure

  1. Add BehaviourOrg() helper (BEHAVIOUR_ORG env var) to pkg/e2etest/testutil.go
  2. Export tokenForOrg as TokenForOrg(cfg, org) in pkg/e2etest/auth.go
  3. Add RunReposInstall to common/setup.go — temp manifest, --fullsend-ref, --mint-url
  4. Add envFullsendRef() / prHeadSHAFromEvent() for ref resolution
  5. Add ValidatePerRepoPostInstallRefPinned to validate.go

Ensurer (ensure.go)

  1. Rewrite with single CreateRepo interface method
  2. Replace awaitCreation (polls GetRepo) with awaitGitReady (polls GetRef("heads/main"))
  3. Remove: ensured cache, singleflight.Group, InvalidateCache, resetRepo, awaitDeletion, ensureRepoExists

Driver (composed.go)

  1. Remove channel pool, outstanding map, slot generation
  2. CreateRepo(ctx, hint) delegates to ensurer; DeleteRepo(ctx, name) calls client.DeleteRepo directly
  3. Finalize tears down mint only

Factory

  1. Rename repopool_cfmint_previews.gofactory_cfmint.go; NewRepoPoolCFMintPreviewsNewCFMintFactory
  2. Wildcard perRepoWIFRepos: "*" and workflowHostRepos: "*"
  3. Remove buildRepoList, envPoolSize, DefaultPoolSize
  4. Delete repopool_external_mint.go (dead code)

Terminology

  1. Rename "enrolled" → "installed" in step definitions, error messages, and all 14 feature files
  2. AllocateRepo/DeallocateRepoCreateRepo/DeleteRepo on Driver interface
  3. Remove LeasedRepoName from World — use RepoName

Cleanup

  1. Fix resolveForkName and resolveHostRepoName for UUID names (remove hardcoded "test-repo" base)
  2. Add fork deletion to steps/cleanup.go
  3. Remove BEHAVIOUR_INSTALL_MODE / InstallMode / per-org tag handling
  4. Add BEHAVIOUR_FULLSEND_REF to e2e.yml; remove BEHAVIOUR_INSTALL_MODE
  5. Update docs/guides/dev/behaviour-testing.md

Not removed (still used by admin e2e)

  • RunGitHubSetup in common/setup.go
  • Pool infrastructure in pkg/e2etest/ (AcquireOrg, OrgPool, ReleaseLock)

Supersedes

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/ciCI pipelines and checkscomponent/e2eEnd-to-end testspriority/highSignificant impact, address soontriagedTriaged but awaiting human prioritizationtype/choreMaintenance and housekeeping tasks

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions