warp icon indicating copy to clipboard operation
warp copied to clipboard

Refactor --list-existing object listing logic

Open dbishop opened this issue 3 weeks ago • 0 comments

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

dbishop avatar Dec 02 '25 16:12 dbishop