Skip to content

Upgrade to Micronaut 4.10.6#951

Merged
pditommaso merged 10 commits intomasterfrom
mn-4.10.x-storage
Jan 12, 2026
Merged

Upgrade to Micronaut 4.10.6#951
pditommaso merged 10 commits intomasterfrom
mn-4.10.x-storage

Conversation

@pditommaso
Copy link
Copy Markdown
Collaborator

Summary

  • Add custom LocalStorageOperations class in io.seqera.wave.service.localfs package to replace the deprecated Micronaut LocalStorageOperations
  • Micronaut 4.10 uses @EachBean and @Requires annotations that require bean injection, making programmatic instantiation impossible
  • Remove micronaut-object-storage-local dependency since we now have our own implementation

Changes

  • New: LocalStorageOperations.groovy - Custom implementation of ObjectStorageOperations<Path, Path, Boolean>
  • New: LocalStorageOperationsTest.groovy - Comprehensive test coverage (11 test cases)
  • Modified: ObjectStorageOperationsFactory.groovy - Use new custom implementation
  • Modified: build.gradle - Remove unused micronaut-object-storage-local dependency

Test plan

  • All LocalStorageOperationsTest tests pass
  • BuildLogsServiceTest tests pass (uses ObjectStorageOperations)
  • Project compiles successfully

🤖 Generated with Claude Code

pditommaso and others added 4 commits December 16, 2025 23:50
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
…lementation

Micronaut 4.10 deprecated the LocalStorageOperations constructor making it
impossible to programmatically create local file system ObjectStorageOperations.

This change:
- Adds custom LocalStorageOperations class in io.seqera.wave.service.localfs
- Implements ObjectStorageOperations interface with upload, retrieve, delete,
  exists, listObjects, and copy operations
- Includes path traversal attack prevention
- Removes micronaut-object-storage-local dependency from build.gradle
- Updates ObjectStorageOperationsFactory to use the new implementation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
@munishchouhan
Copy link
Copy Markdown
Member

Got error while doing cotainer mirroring, but its happening in prod too, so not related to these changes
#952
java.lang.NullPointerException: Cannot invoke "io.seqera.wave.core.ContainerPlatform.toString()" because "platform" is null

@munishchouhan
Copy link
Copy Markdown
Member

Weird I am not getting this error in local

@pditommaso
Copy link
Copy Markdown
Collaborator Author

Seems related to K8s

@munishchouhan
Copy link
Copy Markdown
Member

Seems related to K8s

In local its even working with k8s

NAME                          READY   STATUS      RESTARTS   AGE
mr-484d3113d79a-gwg75         0/1     Completed   0          29s

@munishchouhan
Copy link
Copy Markdown
Member

ok got it, issue with nodeselectors
I will look into it

@munishchouhan
Copy link
Copy Markdown
Member

found the root cause

null, // <-- use null to copy all container tags

@munishchouhan
Copy link
Copy Markdown
Member

since this we will not change, i will make the changes in node selector

@munishchouhan
Copy link
Copy Markdown
Member

fix: #953

Signed-off-by: munishchouhan <hrma017@gmail.com>
This reverts commit cf8ec80.
Comment thread VERSION Outdated
@pditommaso
Copy link
Copy Markdown
Collaborator Author

@claude review

@claude
Copy link
Copy Markdown

claude Bot commented Dec 20, 2025

Claude finished @pditommaso's task —— View job


Code Review Completed

  • Review new LocalStorageOperations implementation
  • Examine ObjectStorageOperationsFactory changes
  • Check test coverage and quality
  • Verify dependency removal
  • Provide comprehensive review feedback

Review Summary

This is a solid implementation that effectively replaces the deprecated Micronaut LocalStorageOperations. The code is well-structured, secure, and thoroughly tested.

✅ Strengths

Security

  • Excellent path traversal protection in resolveSafe() (LocalStorageOperations.groovy:144-150)
  • Proper path normalization and validation prevents malicious access outside base directory
  • Comprehensive security tests cover path traversal attacks (LocalStorageOperationsTest.groovy:152-173)

Implementation Quality

  • Clean, idiomatic Groovy code following project conventions
  • Proper error handling with meaningful ObjectStorageException messages
  • Smart constructor that auto-creates base directory (LocalStorageOperations.groovy:52-58)
  • Efficient file operations using NIO.2 APIs

Test Coverage

  • Comprehensive test suite with 11 test cases covering all major functionality
  • Good edge case coverage (non-existent files, nested directories, path traversal)
  • Uses @TempDir for proper test isolation
  • Tests validate both positive and negative scenarios

Integration

  • Seamless integration with existing ObjectStorageOperationsFactory
  • Maintains same interface contract as original Micronaut implementation
  • Proper dependency removal from build.gradle

💡 Minor Suggestions

Documentation

  • Consider adding JavaDoc examples for key methods like upload() and retrieve()
  • The class-level comment could mention performance characteristics vs cloud storage

Code Style

  • Line 132: Consider extracting the error message format to a constant for consistency
  • Line 147: The error message "Path lies outside the configured bucket" could be more specific (mentions "bucket" for local storage)

Test Enhancements

  • Consider adding a test for concurrent operations to validate thread safety
  • Could add performance benchmark test for large file operations

🔧 Technical Assessment

Memory Efficiency: ✅ Uses streams properly, no memory leaks
Error Handling: ✅ Comprehensive exception handling with proper cleanup
Thread Safety: ✅ Stateless operations, thread-safe design
Performance: ✅ Efficient NIO.2 operations

Recommendation

✅ APPROVE - This PR successfully addresses the Micronaut 4.10 compatibility issue while maintaining security and functionality. The implementation is production-ready and well-tested.


@munishchouhan
Copy link
Copy Markdown
Member

All the features successfully tested in local and dev except mirror

@pditommaso pditommaso changed the title Add custom LocalStorageOperations to replace deprecated Micronaut implementation Upgrade to Micronaut 4.10.4 Dec 22, 2025
@pditommaso
Copy link
Copy Markdown
Collaborator Author

Let's merge post holidays break

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso changed the title Upgrade to Micronaut 4.10.4 Upgrade to Micronaut 4.10.6 Jan 8, 2026
@pditommaso pditommaso merged commit 6dda24c into master Jan 12, 2026
3 checks passed
@pditommaso pditommaso deleted the mn-4.10.x-storage branch January 12, 2026 09:48
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