Skip to content

Fix paginated deployment artifact comparison#250

Merged
GrahamCampbell merged 1 commit intomainfrom
backport-b-paginated-artifact-comparison
May 3, 2026
Merged

Fix paginated deployment artifact comparison#250
GrahamCampbell merged 1 commit intomainfrom
backport-b-paginated-artifact-comparison

Conversation

@GrahamCampbell
Copy link
Copy Markdown
Contributor

Summary

  • List all deployment artifact pages before selecting the latest deployment directory.
  • Preserve existing missing-bucket error translation across paginated S3 responses.
  • Add coverage for latest directories on later pages and split across pages.

Tests

  • npx mocha --config "test/mocha/unit.cjs" "test/unit/lib/plugins/aws/deploy/lib/check-for-changes.test.js"
  • npm run lint
  • npm run prettier-check
  • git diff --check

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

Fixes checkForChanges deployment artifact selection when the latest deployment directory is not present on the first listObjectsV2 page, ensuring correct comparison behavior for long-lived deployment buckets.

Changes:

  • Iterate through all paginated S3 listObjectsV2 results before determining the most recent deployment directory.
  • Preserve translation of “missing deployment bucket” errors when failures occur on later pages.
  • Add unit tests covering “latest directory on later page”, “latest directory split across pages”, and “missing bucket error on later page”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/plugins/aws/deploy/lib/check-for-changes.js Updates getMostRecentObjects() to aggregate paginated S3 listings prior to selecting the newest deployment directory.
test/unit/lib/plugins/aws/deploy/lib/check-for-changes.test.js Adds unit coverage for paginated listing scenarios and error translation on later pages.

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

Comment thread lib/plugins/aws/deploy/lib/check-for-changes.js
@GrahamCampbell GrahamCampbell merged commit f7261b5 into main May 3, 2026
8 checks passed
@GrahamCampbell GrahamCampbell deleted the backport-b-paginated-artifact-comparison branch May 3, 2026 16:11
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