Skip to content

Conversation

pditommaso
Copy link
Member

Summary

This PR refactors the RegistryClient to leverage typed model classes from the io.seqera:npr-api library instead of using raw maps and manual JSON construction. This improves type safety, maintainability, and ensures compatibility with the Nextflow Plugin Registry API specification.

Key Changes

  • Added npr-api dependency: Integrated io.seqera:npr-api:0.15.0 for typed API models
  • Added Jackson dependencies: Added jackson-databind and jackson-datatype-jsr310 for JSON serialization
  • Refactored request/response handling:
    • createDraftRelease() now uses CreatePluginReleaseRequest and CreatePluginReleaseResponse models
    • Removed manual JSON map construction in favor of model classes with fluent API
  • Updated repository configuration: Added Seqera Maven repositories for npr-api dependency resolution

Benefits

  • Type Safety: Compile-time checking for API request/response structure
  • Maintainability: Single source of truth for API models (npr-api library)
  • API Compatibility: Ensures alignment with the official registry API specification
  • Better IDE Support: Autocomplete and type hints for API model fields

Testing

  • All existing tests pass with the new implementation
  • WireMock-based tests verify correct JSON serialization format

🤖 Generated with Claude Code

- Replace manual JSON handling with npr-api models and Jackson ObjectMapper
- Use CreatePluginReleaseRequest with fluent API for building requests
- Use CreatePluginReleaseResponse for parsing responses
- Add Jackson dependencies (jackson-databind and jackson-datatype-jsr310)
- Register JavaTimeModule to handle OffsetDateTime fields
- Fix test mocks to use proper PluginRelease fields instead of non-existent status field

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

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
@pditommaso
Copy link
Member Author

@claude review

Copy link

claude bot commented Oct 9, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

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.

1 participant