Repository navigation
refactor(runners): introduce provider plugin framework - #5234
Conversation
Dependency ReviewThe following issues were found:
License Issueslambdas/functions/control-plane/package.json
lambdas/functions/webhook/package.json
lambdas/libs/runner-providers/package.json
OpenSSF ScorecardScorecard details
Scanned Files
|
guicaulada
left a comment
There was a problem hiding this comment.
LGTM! The only change in the relocated EC2 modules is the createStartRunnerConfig injection, the orchestrators changed only their registry call sites, and no test cases were lost with two additions to replace the deleted registry test. The contract-test lanes and the compile-checked template are nice.
Requesting changes for one reason: the shared providers.config.ts/core import chain pulls the full EC2 control-plane implementation and the EC2 SDK into the webhook bundle.
Splitting the config and registry per lane fixes it while keeping the "enable a provider in one place" goal. The core/config layering and the positional default provider are strong suggestions, the rest is minor.
guicaulada
left a comment
There was a problem hiding this comment.
Thank you for addressing my concerns! LGTM!
…ests (#5246) ## Description - Move generic scale-up and scale-down orchestration tests from the EC2 provider package into the control-plane package. - Test orchestration through the runner-provider interfaces and registry. - Keep EC2 resource operations and dynamic configuration coverage beside the EC2 provider. - Remove direct EC2 provider test imports and mocks of control-plane modules. Production behavior is unchanged. ## Test Plan - `cd lambdas && yarn test` (all 8 projects passed) - Focused control-plane suites: 226 tests passed - Focused EC2 provider suites: 158 tests passed - ESLint and Prettier checks passed for control-plane and runner-providers - Exact test-title inventory: 276 before and after, with no additions or removals - `git diff --check` ## Related Issues Closes #5236 Follow-up to #5234
## Description Supersedes #5038 by @thomasnemer, whose branch lives in an org-owned fork that maintainers cannot push to. This PR rebases that work onto current `main` (porting it to the compute-provider architecture introduced in #5234/#5267) and addresses the review feedback on #5038. All of Thomas's work is preserved with co-authorship. From the original PR: - New `additional_github_apps` variable (optional, no breaking changes) accepts extra GitHub Apps with `id`, `key_base64`, and optionally `installation_id` (direct values or SSM references). - The control-plane lambdas (scale-up, scale-down, pool, job-retry) select one app per invocation and thread the selection through the JWT → installation token → API call chain, spreading load across N × 15,000 req/hour rate-limit buckets. - Installation ID resolution: pre-configured `installation_id` wins, the primary app reuses the webhook payload's id, API lookup is the fallback. Changes on top of #5038: - **Ported to the compute-provider layout**: the `appIndex` selection lives in the orchestrators (`scale-up.ts`, `pool.ts`, `scale-down.ts`) and flows to providers via `CreateGitHubRunnerConfig.appIndex`, so provider interfaces are unchanged. - **Restored the 404 stale-installation fallback** ([review feedback](#5038 (review))): when installation auth fails with 404 (app uninstalled/reinstalled while messages were in flight), the flow re-resolves the installation via the API and retries once with the same app. This now also covers stale pre-configured installation ids, and has regression tests in `octokit.test.ts`. - Updated env wiring for the `COMPUTE_PROVIDER_TYPE` era and regenerated module docs. ## Test Plan - `vitest`: control-plane 348 passed, compute-providers 270 passed, webhook 89 passed. - New regression tests: stale-payload 404 retry, same-id rethrow, non-404 rethrow. - ESLint and Prettier clean on all touched packages. - `terraform fmt -check -recursive`, `terraform validate` (root, runners, multi-runner, ssm), `terraform test` in `modules/runners` (1 passed). - READMEs regenerated with terraform-docs. ## Related Issues Closes #5037. Supersedes #5038. Co-authored with @thomasnemer. --------- Co-authored-by: Thomas Nemer <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
Introduce a shared runner-provider plugin framework so a provider is enabled once and its webhook, scale-up, scale-down, pool, and runner-resource capabilities are available through one registry facade.
runner-providerslibrary.This reduces the number of control-plane and webhook locations that must be changed when adding a runner provider.
Follow-up work
Some tests still need to move to the control-plane package instead of remaining with the EC2 plugin. The affected files contain groups of tests, so this cleanup requires moving individual test cases rather than relocating an entire block or file. It will be handled in a follow-up PR to keep this refactor reviewable.
This is why some EC2 provider tests currently import from
../../../../../../functions/control-plane. Those dependencies should be removed in the follow-up PR.Test Plan
runner-providers:testNx target.control-plane:testNx target.Related Issues
Follow-up: #5236.