Skip to content

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

Merged
edersonbrilhante merged 2 commits into
mainfrom
refactor-shared-runner-contracts
Aug 12, 2026
Merged

refactor(runner-providers): centralize shared runner contracts#5248
edersonbrilhante merged 2 commits into
mainfrom
refactor-shared-runner-contracts

Conversation

@edersonbrilhante

@edersonbrilhante edersonbrilhante commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

  • Define the provider-neutral RunnerType, RunnerInfo, ListRunnerFilters, and CreateRunnerResult contracts in runner-provider core.
  • Use one RunnerInfo shape across control-plane and EC2, with id, githubRunnerId, and required owner and type fields.
  • Keep EC2-specific inputs and the EC2 status-filter extension in runners.d.ts.
  • Consolidate control-plane type re-exports in scale-runners/types.ts and remove the redundant scale-up and scale-down provider type shims.
  • Update the existing tests in place without adding or removing test cases.

Compatibility note

This PR intentionally normalizes the exported listEC2Runners result fields from instanceId/runnerId to id/githubRunnerId and removes the legacy core type aliases. This differs from the compatibility approach initially described in #5247 and is included explicitly for review.

Test Plan

  • cd lambdas && NX_DAEMON=false yarn test (all 8 projects passed)
  • Control-plane suite: 14 test files / 326 tests passed
  • Runner-provider suite: 10 test files / 270 tests passed
  • Focused scale-down contract, EC2 listing, and pool tests passed after the final type tightening
  • ESLint and Prettier passed for control-plane and runner-providers
  • Exact test-title inventory: 276 before and after, with no additions or removals
  • git diff --check

Local TypeScript build validation remains blocked by the installed @aws-sdk/client-ec2 declarations missing exports used throughout the existing EC2 sources; the same environment issue affects untouched code.

Related Issues

Closes #5247

Stacked on #5246

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@edersonbrilhante
edersonbrilhante marked this pull request as ready for review August 5, 2026 13:47
@edersonbrilhante
edersonbrilhante requested a review from a team as a code owner August 5, 2026 13:47
@edersonbrilhante
edersonbrilhante requested a review from a team as a code owner August 5, 2026 13:57
@edersonbrilhante
edersonbrilhante force-pushed the refactor-shared-runner-contracts branch from bcc60d9 to a228752 Compare August 5, 2026 18:22

@Brend-Smits Brend-Smits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment, I'm gonna deploy this now on my local environment to see if everything is still working correctly. Brb

Comment thread .github/workflows/codeql.yml
Comment thread .github/workflows/lambda.yml
Brend-Smits
Brend-Smits previously approved these changes Aug 12, 2026

@Brend-Smits Brend-Smits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally and it's working like a charm!

Base automatically changed from test-separate-control-plane-provider-tests to main August 12, 2026 20:29
@edersonbrilhante
edersonbrilhante merged commit b30760b into main Aug 12, 2026
13 checks passed
@edersonbrilhante
edersonbrilhante deleted the refactor-shared-runner-contracts branch August 12, 2026 21:19
edersonbrilhante added a commit that referenced this pull request Aug 12, 2026
## Description

- Rename the scale-up provider hook from `prepareGroup` to
`resolveLabelsForRunners`.
- Replace `PreparedScaleUpRunnerGroup` with `RunnerLabelResolution`,
containing the resolved `runnerLabels` and provider-specific `state`.
- Update control-plane orchestration, the EC2 provider, the provider
template, registry expectations, and existing tests in place.
- Preserve runtime behavior while making the plugin contract explicit:
message labels are resolved into runner labels and state used for runner
lookup and creation.

## Test Plan

- Control-plane suite: 14 test files / 326 tests passed
- Runner-provider suite: 10 test files / 270 tests passed
- ESLint and Prettier passed for all changed files
- Exact test-title inventory: 276 before and after, with no additions or
removals
- `git diff --check`

Local TypeScript build validation remains blocked by the installed
`@aws-sdk/client-ec2` declarations missing exports used throughout the
existing EC2 sources; the same environment issue affects untouched code.

## Related Issues

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(runner-providers): centralize shared runner contracts

2 participants