Skip to content

refactor(control-plane): remove EC2 assumptions - #5308

Merged
edersonbrilhante merged 1 commit into
mainfrom
refactor-control-plane-provider-neutral-tests
Sep 2, 2026
Merged

edersonbrilhante merged 1 commit into
mainfrom
refactor-control-plane-provider-neutral-tests

Conversation

@edersonbrilhante

Copy link
Copy Markdown
Contributor

Description

Depends on #5307.

Removes EC2-specific assumptions from generic control-plane tests and the local pool invocation. Scale-up and scale-down test doubles now model provider capability factories without owning a provider type, partial creation tests use provider-neutral runner terminology, and pool events rely on the optional provider type's default behavior.

The scale-up provider-selection test remains as integration coverage, but asserts the public defaultComputeProvider contract instead of the concrete EC2 value. The provider-type unit tests remain responsible for the concrete default mapping.

Test Plan

  • Ran the affected scale-up, scale-down, and Lambda wrapper suites: 253 tests passed.
  • Ran the complete Lambda Vitest suite: 819 tests passed.
  • Ran the control-plane TypeScript type-check.
  • Ran ESLint and Prettier checks for all changed files.
  • Ran git diff --check.
  • Verified the four scoped files contain no EC2 references.

Related Issues

None.

@edersonbrilhante
edersonbrilhante requested a review from a team as a August 27, 2026 11:58
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

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

Scanned Files

None

@edersonbrilhante
edersonbrilhante force-pushed the refactor-control-plane-provider-neutral-tests branch from 58d63ff to 9d4172e Compare August 27, 2026 21:00
@edersonbrilhante
edersonbrilhante force-pushed the refactor-control-plane-provider-neutral-tests branch from 9d4172e to 6a7dbaa Compare August 28, 2026 11:03
Brend-Smits
Brend-Smits previously approved these changes Sep 2, 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.

LGTM! All tests are green, no further comments.

@edersonbrilhante
edersonbrilhante force-pushed the refactor-control-plane-provider-neutral-tests branch from 6a7dbaa to a43fe60 Compare September 2, 2026 15:40
@edersonbrilhante
edersonbrilhante force-pushed the refactor-control-plane-provider-neutral-tests branch from a43fe60 to db5a96f Compare September 2, 2026 16:42
Base automatically changed from refactor-pool-provider-test-boundary to main September 2, 2026 16:46
@edersonbrilhante
edersonbrilhante force-pushed the refactor-control-plane-provider-neutral-tests branch from db5a96f to 7253e3e Compare September 2, 2026 16:46
@edersonbrilhante
edersonbrilhante merged commit e219b16 into main Sep 2, 2026
9 checks passed
@edersonbrilhante
edersonbrilhante deleted the refactor-control-plane-provider-neutral-tests branch September 2, 2026 16:53
edersonbrilhante added a commit that referenced this pull request Sep 2, 2026
## Description

Depends on #5308.

Introduces an `Ec2RunnerClient` that owns a reusable EC2 client and
exposes request-bound EC2 runner operations through `forRequest({ signal
})`. The control-plane registry creates the client once for the warm
Lambda execution environment, and the pool, scale-up, and scale-down
capabilities share those operations while keeping cancellation scoped to
each request.

The EC2 capability boundary now distinguishes resource operations from
provisioning operations, uses consistent capability naming, and removes
the legacy default-operation wrappers. Launch-template block-device
lookup uses the same bound EC2 client, and runner creation is named
separately from runner configuration.

## Test Plan

- Ran Prettier, ESLint, and the control-plane TypeScript type-check.
- Ran the complete compute-provider suite: 286 tests passed.
- Ran the complete control-plane suite: 345 tests passed.
- Added three runner-client tests covering launch-template lookup with
the bound client and request signal, rejection of an already-cancelled
request before AWS is called, and isolation between cancelled and active
requests sharing one client.
- Updated pool, scale-up, and scale-down tests to exercise the returned
capability methods and their dependency wiring.
- Ran `git diff --check`.

## Related Issues

None.
edersonbrilhante added a commit that referenced this pull request Sep 3, 2026
## Description

Clarifies the partial runner creation test name so it explicitly states
that non-retryable failures are not retried, while keeping the
terminology provider-neutral.

This addresses the same review suggestion raised in the stacked PR
discussions for
[#5308](#5308 (comment))
and
[#5301](#5301 (comment)).

## Test Plan

- Ran the focused control-plane scale-up suite: 113 tests passed.
- Ran Prettier for the changed file.
- Ran `git diff --check`.
- Repository pre-commit hooks passed.

## Related Issues

Related to #5338
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.

3 participants