Skip to content

refactor(runner-providers): centralize shared runner contracts #5247

Closed

Description

@edersonbrilhante

Problem

Several runner-provider-neutral contracts are still defined in the EC2 control-plane declarations or repeated locally across modules and tests:

  • RunnerType ('Org' | 'Repo')
  • RunnerList
  • RunnerInfo
  • ListRunnerFilters
  • CreateRunnerResult

Equivalent concepts already exist in runner-providers/core under names such as GitHubRunnerType, ScaleDownRunnerList, ScaleDownRunnerInfo, and CreateScaleUpRunnersResult. Keeping the neutral definitions under EC2 means another runner-provider plugin would need to duplicate or import EC2-owned types.

PR #5246 intentionally keeps the orchestration-test move focused and does not include this broader type refactor.

Scope

  • Define canonical provider-neutral runner contracts in lambdas/libs/runner-providers/core or a dedicated common runner-provider type module.
  • Migrate control-plane, runner-provider implementations, and tests to the canonical definitions.
  • Keep lambdas/libs/runner-providers/aws/ec2/src/control-plane/runners.d.ts limited to EC2-specific inputs such as RunnerInputParameters and Ec2OverrideConfig.
  • Keep EC2-only filter fields, such as instance statuses, in an EC2-specific extension of the common filters.
  • Remove repeated local 'Org' | 'Repo' unions where the canonical runner type applies.
  • Keep RunnerProviderType (the plugin/backend discriminator) separate from the GitHub runner scope type (Org or Repo).

Compatibility considerations

  • listEC2Runners is exported through a package subpath and currently returns EC2-shaped identifiers (instanceId and runnerId). Preserve that runtime contract, using an EC2 adapter type and mapper to the neutral model if necessary.
  • Preserve source compatibility for existing exported core names with aliases where appropriate, or document and coordinate any intentional breaking rename.
  • Keep PoolRunnerProvider<TRunner = unknown> generic so provider-specific list shapes remain supported.
  • Do not change production behavior as part of the type consolidation.

Acceptance criteria

  • RunnerType, RunnerList, RunnerInfo, ListRunnerFilters, and CreateRunnerResult have one provider-neutral canonical definition.
  • Common control-plane code and tests do not import those contracts from the EC2 package.
  • EC2 declarations contain only EC2-specific contracts; common contracts are not copied into another provider plugin.
  • Existing exported EC2 runtime shapes remain compatible.
  • Control-plane and runner-provider test suites pass.
  • Builds, ESLint, Prettier, and coverage thresholds pass without lowering coverage requirements.

Related work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions