Skip to content

Simplify resource count pagination#237

Merged
GrahamCampbell merged 1 commit intomainfrom
resource-count-pagination
May 2, 2026
Merged

Simplify resource count pagination#237
GrahamCampbell merged 1 commit intomainfrom
resource-count-pagination

Conversation

@GrahamCampbell
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies CloudFormation stack resource counting by replacing recursive pagination with an iterative loop and extends unit tests to cover pagination and empty responses.

Changes:

  • Refactor getResourceCount to loop over listStackResources pages using NextToken.
  • Stop sending NextToken: undefined in the initial request.
  • Add unit tests for paginated accumulation and missing StackResourceSummaries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/unit/lib/plugins/aws/info/get-resource-count.test.js Updates expectations to match new request params and adds coverage for pagination + empty page handling.
lib/plugins/aws/info/get-resource-count.js Replaces recursive promise chain with an await + do/while pagination loop and makes missing summaries count as 0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GrahamCampbell GrahamCampbell merged commit 770415e into main May 2, 2026
8 checks passed
@GrahamCampbell GrahamCampbell deleted the resource-count-pagination branch May 2, 2026 14:46
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