Skip to content

fix(scale-down): scope cached clients by selected GitHub App - #5466

Merged
guicaulada merged 1 commit into
mainfrom
gc/fix/scale-down-multi-app-cleanup
Oct 27, 2026
Merged

guicaulada merged 1 commit into
mainfrom
gc/fix/scale-down-multi-app-cleanup

Conversation

@guicaulada

@guicaulada guicaulada commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Scale-down caches installation clients by owner. Scope that cache by selected GitHub App, runner type, and owner, and select the App before checking the cache so a changed selection uses the corresponding client.

Preserve the shared request-level failover added in #5523. Installation lookup and token creation stay inside its client factory; the shared failover layer handles quota observation and metrics, avoiding duplicate response hooks in scale-down.

Validation: all 403 control-plane tests, runtime TypeScript, ESLint, and diff checks pass. The regression verifies selection changes for the same owner and client reuse within each App. No AWS deployment or live runner cleanup was performed.

@guicaulada
guicaulada requested a review from a team as a code owner September 23, 2026 14:26
@guicaulada
guicaulada added this pull request to stack #5468 September 23, 2026 14:28
@guicaulada
guicaulada force-pushed the gc/fix/scale-down-multi-app-cleanup branch from c404f77 to 576ac85 Compare September 23, 2026 14:36
@guicaulada
guicaulada removed this pull request from stack #5468 September 23, 2026 14:39
@guicaulada
guicaulada changed the base branch from gc/fix/orphan-cleanup to main September 23, 2026 14:39
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

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

Scanned Files

None

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Quota attribution is missing for pre-installation lookups and failed GitHub requests.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Updates scale-down GitHub App selection, client caching, and quota attribution for multi-App cleanup workflows.

Changes:

  • Re-selects Apps before cache lookup and scopes clients by App, runner type, and owner.
  • Adds App-specific quota instrumentation.
  • Adds tests for App reselection, client reuse, and attribution.
File Summary
lambdas/​functions/​control-plane/​src/​scale-runners/​scale-down.ts Updates client selection, caching, and quota hooks.
lambdas/​functions/​control-plane/​src/​scale-runners/​scale-down.test.ts Tests multi-App selection and quota attribution.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@guicaulada
guicaulada force-pushed the gc/fix/scale-down-multi-app-cleanup branch 2 times, most recently from 35ea122 to 8c1013a Compare September 24, 2026 13:54
@guicaulada
guicaulada force-pushed the gc/fix/scale-down-multi-app-cleanup branch from 8c1013a to e1847ee Compare October 5, 2026 14:03
@guicaulada
guicaulada force-pushed the gc/fix/scale-down-multi-app-cleanup branch from e1847ee to 1f965ab Compare October 14, 2026 12:35
@guicaulada
guicaulada requested a balanced review from Copilot October 14, 2026 16:50

Copilot AI 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.

🟢 Approval recommended

The scoped changes address the reported behavior and prior feedback, with regression coverage and no identified blocking issues.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

@guicaulada
guicaulada force-pushed the gc/fix/scale-down-multi-app-cleanup branch 2 times, most recently from 4be2486 to 0922d62 Compare October 19, 2026 14:27
@guicaulada guicaulada changed the title fix(scale-down): reselect GitHub Apps and attribute cleanup quota fix(scale-down): scope cached clients by selected GitHub App Oct 19, 2026
@guicaulada
guicaulada force-pushed the gc/fix/scale-down-multi-app-cleanup branch from 0922d62 to 17944d3 Compare October 26, 2026 12:46
@guicaulada
guicaulada force-pushed the gc/fix/scale-down-multi-app-cleanup branch from 17944d3 to facd803 Compare October 27, 2026 15:20
@guicaulada
guicaulada merged commit bbd92fe into main Oct 27, 2026
13 checks passed
@guicaulada
guicaulada deleted the gc/fix/scale-down-multi-app-cleanup branch October 27, 2026 16:43
guicaulada pushed a commit that referenced this pull request Nov 3, 2026
🤖 I have created a release *beep* *boop*
---


##
[8.1.0](v8.0.0...v8.1.0)
(2026-10-29)


### Features

* add stateless registration cleanup with multi-App support
([#5465](#5465))
([5959d43](5959d43))
* **termination-watcher:** support additional GitHub Apps
([#5467](#5467))
([eefcb1e](eefcb1e))


### Bug Fixes

* **lambda:** bump undici from 6.29.0 to 6.29.1 in /lambdas
([#5554](#5554))
([94f46c7](94f46c7))
* **scale-down:** clean EC2 runners incrementally and isolate failures
([#5463](#5463))
([60a4c66](60a4c66))
* **scale-down:** scope cached clients by selected GitHub App
([#5466](#5466))
([bbd92fe](bbd92fe))
* **termination-watcher:** grant kms:Decrypt for GitHub App parameters
([#5562](#5562))
([7b54664](7b54664))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: runners-releaser[bot] <194412594+runners-releaser[bot]@users.noreply.github.com>
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