Skip to content

Feature/s3compatsigv4#87

Merged
hide24 merged 18 commits intoRCOSDP:develop-202603afrom
tishin-endou:feature/s3compatsigv4
Mar 16, 2026
Merged

Feature/s3compatsigv4#87
hide24 merged 18 commits intoRCOSDP:develop-202603afrom
tishin-endou:feature/s3compatsigv4

Conversation

@hide24
Copy link

@hide24 hide24 commented Mar 16, 2026

#85 の総合テスト用複製

tishin-endou and others added 18 commits January 30, 2026 10:55
…name

When renaming a folder, the old folder prefix object (e.g. 'oldname/')
was not deleted because _delete_folder skipped objects without a
VersionId. This fix includes unversioned objects in the bulk delete
batch and explicitly deletes the folder prefix when the versioning
API is unsupported.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lder

After deleting all child objects in batches, the folder prefix object
(e.g. 'foldername/') may not be included in list_object_versions and
thus remains orphaned. Explicitly check and delete it after the batch
deletion loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ename

When _delete_folder raises NotFoundError (because list_object_versions
does not return the folder prefix object), BaseProvider.move swallows
the 404 and the prefix object remains. Override move in S3CompatSigV4
to explicitly check and delete the folder prefix after super().move().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_folder_prefix_exists checks CommonPrefixes, which does not include
empty folder prefix objects with no children. Replace the existence
check with unconditional try/except deletion since S3 DELETE on a
non-existent key safely returns 204.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…2 fallback

When get_full_revision fails with MetadataError (e.g., MinIO without
versioning), fall back to ListObjectsV2 with pagination, EncodingType
url, unquote_plus decoding, and strip_whitespace=False to correctly
handle Japanese filenames and large folders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…igation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… key deletion

- Remove EncodingType: 'url' from ListObjectsV2 params so S3 returns
  raw key names instead of URL-encoded ones
- Remove parse.unquote_plus() from XML response parsing (no longer needed)
- Change Quiet: True to Quiet: False and add error checking/logging
  for delete_objects responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…te_folder

MinIO without versioning returns VersionId='null' (string literal) in
ListObjectVersions responses. Passing this to delete_objects does not
actually delete the objects. Filter out 'null' version IDs and fall
back to direct delete_object calls when no real versions exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n MinIO

boto3 automatically adds encoding-type=url to presigned URLs for
list_object_versions. This causes MinIO to return URL-encoded keys
(e.g. Japanese characters become percent-encoded). The encoded keys
were passed directly to delete_objects, which silently reported success
but did not actually delete the objects since the keys didn't match.

Also reverts the VersionId='null' filtering from the previous commit,
as local testing with MinIO confirmed that VersionId='null' works
correctly for deletion — the real issue was the URL-encoded keys.
Split test_delete into two tests:
- test_delete_null_version: verifies direct DELETE when VersionId='null' (MinIO)
- test_delete_with_real_versions: verifies batch delete_objects with real version IDs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Revert test_delete to expect delete_objects with VersionId='null'
  (VersionId='null' filtering was reverted in 52c9e54)
- Add _folder_prefix_exists mock (list_objects_v2 GET) to
  test_delete_confirm_delete, test_delete_folder_with_versions,
  and test_delete_folder_truncated_response

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove logger.info calls added in b16401f that log object keys
(file paths) at INFO level, which could leak sensitive information.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- XML parse: except Exception -> except ExpatError
- Multipart upload: except Exception -> except UploadError
- Multipart abort retry: except Exception -> except (UploadError, ExpatError)
- Folder prefix cleanup (move, _delete_folder): except Exception -> except DeleteError with warning log
- Fix inverted abort condition (if aborted -> if not aborted)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Remove XML response body from parse error/warning logs
2. Add debug log for MetadataError fallback in download pre-flight
3. Add comment for KeyError: pass on ETag header check
4. Change delete path logging from INFO to DEBUG
5. Remove Key/VersionId from delete error logs, log only count and codes
6. Add debug log for MetadataError fallback in delete
7. Sanitize _delete_folder fallback error logging
8. Sanitize _delete_folder error logging
9. Remove full XML response debug logging in get_full_revision
10. Remove presigned URL from ListObjectVersions error log

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion

The _chunked_upload and _abort_chunked_upload methods intentionally
catch all exceptions to ensure upload cleanup (abort) runs regardless
of the error type. This matches the upstream s3 provider behavior.
Also revert 'if not aborted' back to 'if aborted' to match s3 provider.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hide24 hide24 merged commit 32217d7 into RCOSDP:develop-202603a Mar 16, 2026
1 check failed
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