Skip to content

Conversation

soberm
Copy link
Contributor

@soberm soberm commented Aug 27, 2025

Description of changes

Adds configurable tag handling for S3 copy operations through a new optional tagConfig parameter. More specifically:

• Added tagConfig parameter to StorageCopyInputWithPath interface with support for copy and remove modes
• Updated copy implementation to map tagConfig modes to appropriate S3 TaggingDirective values
• Added type definitions for CopyTagConfig, RemoveTagConfig, and TagConfig union type
• Updated internal types to support tagConfig in advanced options
• Added unit tests covering tagConfig behavior

API Usage Examples

// Default behavior - copies tags from source to destination
await copy({
  source: { path: 'source.jpg' },
  destination: { path: 'destination.jpg' }
});

// Explicitly copy tags (same as default)
await copy({
  source: { path: 'source.jpg' },
  destination: { path: 'destination.jpg' },
  tagConfig: { mode: 'copy' }
});

// Remove tags from destination
await copy({
  source: { path: 'source.jpg' },
  destination: { path: 'destination.jpg' },
  tagConfig: { mode: 'remove' }
});

Issue #, if available

#14469

Description of how you validated changes

Unit Tests

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@soberm soberm changed the title feat: add tagging directive option to copy fix(storage): change default tagging directive to replace Sep 4, 2025
@soberm soberm marked this pull request as ready for review September 4, 2025 09:37
@soberm soberm added run-tests run the pr-label workflow and removed run-tests run the pr-label workflow labels Sep 4, 2025
ahmedhamouda78
ahmedhamouda78 previously approved these changes Sep 4, 2025
@soberm soberm changed the title fix(storage): change default tagging directive to replace fix(storage): support tagging directive in copy Sep 8, 2025
@soberm soberm changed the title fix(storage): support tagging directive in copy feat(storage): support tagging directive in copy Sep 8, 2025
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