Skip to content

Conversation

@simonhir
Copy link
Member

@simonhir simonhir commented Apr 3, 2025

Description

Dispatch add workaround for copy object replace tags as minio doesn't set empty tags as header.

References

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced file transfer operations by refining how metadata tags are managed when they are cleared. This update ensures improved consistency and reliability when interacting with our cloud storage service, resulting in smoother file handling experiences for end-users.

@simonhir simonhir self-assigned this Apr 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 3, 2025

Walkthrough

The pull request updates the copyFile method within the S3Adapter to refine how tagging is handled when the clearTags parameter is true. The method no longer sets an empty tags map but instead sets the tagging directive to REPLACE and adds a workaround by inserting an extra header ("x-amz-tagging") with an empty value. The overall logic flow remains unchanged aside from this adjustment to comply with the requirements of the Minio client.

Changes

File Change Summary
dispatch-service/.../S3Adapter.java Modified copyFile to remove the explicit empty tags mapping and added an extra header "x-amz-tagging" with an empty string for Minio support.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant S3Adapter
    participant S3Service as MinioClient

    Client->>S3Adapter: copyFile(src, dest, clearTags=true)
    S3Adapter->>S3Adapter: Check clearTags flag
    S3Adapter->>S3Adapter: Set tagging directive to REPLACE
    S3Adapter->>S3Adapter: Add header "x-amz-tagging" with empty value
    S3Adapter->>S3Service: Send copy file request
    S3Service-->>S3Adapter: Response
    S3Adapter-->>Client: Return result
Loading

Suggested reviewers

  • rowe42

Poem

Oh hop and skip, a rabbit sings,
A header added, fresh code it brings.
No more empty tags to hold it back,
We bounce through changes on the right track.
Code shines bright in my burrow of tricks!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 4839135 and ca2cbb1.

📒 Files selected for processing (1)
  • dispatch-service/src/main/java/de/muenchen/oss/swim/dispatcher/adapter/out/s3/S3Adapter.java (1 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
dispatch-service/src/main/java/de/muenchen/oss/swim/dispatcher/adapter/out/s3/S3Adapter.java (1)

266-270: Effective workaround for MinIO's empty tag handling limitation

This is a good solution for addressing the MinIO-specific issue where empty tags aren't set as headers during copy operations. The approach correctly implements the workaround by:

  1. Setting the tagging directive to REPLACE
  2. Explicitly adding the required "x-amz-tagging" header with an empty value

Consider adding a reference to any relevant MinIO issue or documentation for better context, as this is a workaround for a specific implementation limitation rather than standard S3 behavior.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4839135 and 92aa5a9.

📒 Files selected for processing (1)
  • dispatch-service/src/main/java/de/muenchen/oss/swim/dispatcher/adapter/out/s3/S3Adapter.java (1 hunks)

@simonhir simonhir marked this pull request as ready for review April 3, 2025 08:40
@simonhir simonhir merged commit 30fce43 into main Apr 3, 2025
8 checks passed
@simonhir simonhir deleted the bug/dispatch-fix-copy-object-replace-tags branch April 3, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants