Repository navigation
Closed
Description
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')RunnerListRunnerInfoListRunnerFiltersCreateRunnerResult
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/coreor 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.tslimited to EC2-specific inputs such asRunnerInputParametersandEc2OverrideConfig. - 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 (OrgorRepo).
Compatibility considerations
listEC2Runnersis exported through a package subpath and currently returns EC2-shaped identifiers (instanceIdandrunnerId). 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, andCreateRunnerResulthave 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
Metadata
Metadata
Assignees
Labels
No labels
Activity
refactor(runner-providers): centralize shared runner contracts (#5248)