Skip to content

fix(ssm): delete expired runner parameters as pages are listed - #5464

Open
guicaulada wants to merge 1 commit into
mainfrom
gc/fix/ssm-housekeeper-pagination
Open

guicaulada wants to merge 1 commit into
mainfrom
gc/fix/ssm-housekeeper-pagination

Conversation

@guicaulada

@guicaulada guicaulada commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

The SSM housekeeper accumulates every parameter page before deleting anything. A later listing failure prevents all cleanup, and an omitted Parameters array 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.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

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

Scanned Files

None

@guicaulada guicaulada changed the title fix(ssm): retain cleanup candidates after empty parameter pages fix(ssm): clean parameter pages incrementally and resume interrupted sweeps Sep 23, 2026
@guicaulada
guicaulada force-pushed the gc/fix/ssm-housekeeper-pagination branch from a3c2764 to f6062e4 Compare September 23, 2026 14:14
@guicaulada guicaulada changed the title fix(ssm): clean parameter pages incrementally and resume interrupted sweeps fix(ssm): delete expired runner parameters as pages are listed Sep 23, 2026
@Brend-Smits
Brend-Smits requested a balanced review from Copilot September 23, 2026 16:41

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

🟢 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

No deployments
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.

2 participants