Skip to content

Refactor --list-existing object listing logic#434

Merged
klauspost merged 1 commit intominio:masterfrom
dbishop:refactor-list-existing-listing
Dec 18, 2025
Merged

Refactor --list-existing object listing logic#434
klauspost merged 1 commit intominio:masterfrom
dbishop:refactor-list-existing-listing

Conversation

@dbishop
Copy link
Contributor

@dbishop dbishop commented Dec 2, 2025

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

Extracts duplicate object listing code from delete.go, get.go, and stat.go into a shared listExistingObjects method in Common. This reduces code duplication by ~150 lines and centralizes listing behavior, making future maintenance and bug fixes easier.

The new ListObjectsConfig struct allows each benchmark type to configure listing behavior (version handling, zero-size filtering, shuffling) while sharing the core implementation.

Motivation and Context

This increase in maintainability from refactoring applies to everyone, but specifically, If anyone wanted to carry a patch relating to prefixes (see discussion in #432), having listing logic consolidated makes that easier.

How to test this PR?

Basic regression testing of --list-existing behavior for the get, delete, and stat commands.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

Copy link
Collaborator

@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

Rest lgtm

Extract duplicate object listing code from delete.go, get.go, and stat.go
into a shared listExistingObjects method in Common. This reduces code
duplication by ~150 lines and centralizes listing behavior, making future
maintenance and bug fixes easier.

The new ListObjectsConfig struct allows each benchmark type to configure
listing behavior (version handling, zero-size filtering, shuffling) while
sharing the core implementation.
@dbishop dbishop force-pushed the refactor-list-existing-listing branch from d1df6e7 to 2305616 Compare December 3, 2025 16:10
@klauspost klauspost merged commit 4b2b64e into minio:master Dec 18, 2025
5 of 6 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.

2 participants