Skip to content

Conversation

connor15mcc
Copy link
Contributor

By default ListObjectsV2() returns the first 1000 objects matching the list parameters.

Normally this is fine, as it supports up to 333 versions (1000 / 3 files in proxy-triplet). For modules with more versions, this is insufficient and must be upgraded to paginate.

What is the problem I am trying to address?

Athens /list endpoint returning a partial response when used with the s3
backer and many (>333) versions.

How is the fix applied?

Using the paginator provided with the s3-v2 API for list queries.

What GitHub issue(s) does this PR fix or close?

N/A (I haven't made or seen one).

By default `ListObjectsV2()` returns the first 1000 objects matching the
list parameters. Normally this is fine, as it supports up to 333
versions (1000 / 3 files in proxy-triplet). For modules with more
versions, this is insufficient and must be upgraded to paginate.
@connor15mcc connor15mcc requested a review from a team as a code owner March 30, 2025 20:02
@manugupt1 manugupt1 requested a review from Copilot April 1, 2025 03:59
Copy link

@Copilot 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 adds pagination support for S3 listings to ensure that all versions are returned when there are more than 333 versions.

  • Introduces a paginator to iterate over all pages using the s3-v2 API.
  • Aggregates versions from each page into a single slice.
Comments suppressed due to low confidence (1)

pkg/storage/s3/lister.go:36

  • [nitpick] Consider using the built-in 'append' function to concatenate slices, which is more idiomatic in Go and may offer better performance compared to slices.Concat.
versions = slices.Concat(versions, extractVersions(loo.Contents))

@manugupt1 manugupt1 requested review from a team April 1, 2025 04:05
@nrwiersma nrwiersma merged commit ebb5ac6 into gomods:main Apr 1, 2025
11 checks passed
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