fix(ssm): delete expired runner parameters as pages are listed - #5464
Open
guicaulada wants to merge 1 commit into
Open
guicaulada wants to merge 1 commit into
guicaulada wants to merge 1 commit into
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
guicaulada
force-pushed
the
gc/fix/ssm-housekeeper-pagination
branch
from
September 23, 2026 14:14
a3c2764 to
f6062e4
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The incremental cleanup behavior is correctly implemented, documented, and covered by focused tests.
Review effort: Balanced
Findings: None
What changed in this PR
Refactors SSM cleanup to process parameters incrementally, improving resilience to listing and deletion failures.
Changes:
- Deletes eligible parameters page by page with isolated failures.
- Adds Lambda deadline awareness and stateless retry behavior.
- Expands tests and documents cleanup semantics.
| File | Description |
|---|---|
modules/runner-config/ssm-housekeeper/README.md |
Documents incremental cleanup behavior. |
lambdas/libs/storage-providers/core/index.ts |
Adds optional remaining-time callback. |
lambdas/libs/storage-providers/aws/ssm/runner-config-housekeeper.ts |
Implements incremental, deadline-aware cleanup. |
lambdas/libs/storage-providers/aws/ssm/runner-config-housekeeper.test.ts |
Tests pagination and failure handling. |
lambdas/functions/control-plane/src/lambda.ts |
Supplies Lambda remaining runtime. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SSM housekeeper accumulates every parameter page before deleting anything. A later listing failure prevents all cleanup, and an omitted
Parametersarray on the first page silently discards later candidates.Delete eligible parameters as each page arrives, including pages after empty responses. Isolate deletion failures per parameter, preserve the existing age and dry-run protections, and stop starting new work with ten seconds remaining. A later listing failure leaves earlier deletions completed.
Cleanup is stateless: every invocation starts a fresh scan of current parameters. Successfully deleted parameters disappear from subsequent listings, leaving the remaining work for later scheduled runs. Pagination tokens exist only within an invocation.
Validation: all 115 storage-provider tests pass, including empty pages, deletion before later-page failure, fresh scans after partial cleanup, and continuing past a failed deletion. Runtime TypeScript, ESLint, Prettier, Lambda bundle build, and diff checks pass. No AWS deployment or live parameter deletion was performed.
Independent of native SSM expiration-policy work in #5265. Companion PRs: #5463 and #5465.