Skip to content

Conversation

pditommaso
Copy link
Member

@pditommaso pditommaso commented Aug 20, 2025

Summary

This PR refactors both Wave and Tower clients to use the standardized lib-httpx library, significantly simplifying HTTP handling across Nextflow plugins.

Key Changes

Wave Client: Replace 138+ lines of manual HTTP retry logic with HxClient from io.seqera:lib-httpx:1.6.0
Tower Client: Migrate from custom HTTP handling to standardized HxClient implementation
RetryConfig: Update RetryOpts to implement Retryable.Config interface from lib-retry
Dependency Updates: Add lib-httpx:1.6.0 to both Wave and Tower plugin dependencies
Code Reduction: Remove ~564 lines of redundant HTTP handling and retry logic across plugins

Technical Improvements

  • Eliminates manual JWT token refresh logic in favor of HxClient's built-in token handling
  • Standardizes retry behavior and configuration across Wave and Tower clients
  • Improves error handling and HTTP connection management
  • Reduces code duplication between plugins
  • Enhances maintainability by leveraging proven library components

Files Modified

  • plugins/nf-wave/: Simplified WaveClient HTTP handling
  • plugins/nf-tower/: Refactored TowerClient with new retry policy
  • modules/nf-commons/: Updated RetryConfig to implement Retryable.Config
  • Build files updated with new dependencies

Test Plan

  • Verify existing Wave plugin tests pass
  • Verify existing Tower plugin tests pass
  • Confirm RetryConfig implements Retryable.Config interface correctly
  • Validate HTTP retry behavior works with new library
  • Test JWT token refresh functionality through HxClient
  • Run full integration test suite

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

- Replace manual HTTP retry logic with HxClient from io.seqera:lib-httpx:1.2.0
- Update RetryOpts to implement Retryable.Config interface from lib-retry
- Add multiplier field to RetryOpts for exponential backoff configuration
- Remove manual JWT token refresh logic in favor of HxClient built-in handling
- Update WaveClient to use HxClient.sendAsString() instead of raw HttpClient
- Remove redundant retry policy and HTTP response handling code
- Update tests to reflect API changes and remove obsolete HTTP retry test

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

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

netlify bot commented Aug 20, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 4837654
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68a9c523d31f85000869d21d
😎 Deploy Preview https://deploy-preview-6354--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pditommaso pditommaso requested a review from bentsherman August 20, 2025 20:18
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
pditommaso and others added 6 commits August 21, 2025 23:49
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
* Refactor Tower client to use lib-httpx library

- Replace manual HTTP retry logic with HxClient from io.seqera:lib-httpx
- Update TowerClient.sendHttpMessage() to use HxClient.sendAsString()
- Add HxClient configuration with retry settings, JWT token, and refresh token handling
- Update makeRequest() helper method to properly build HttpRequest objects with body content
- Remove redundant HTTP response handling code in favor of HxClient built-in functionality
- Update SimpleHttpClient to support content-type and authorization headers
- Update tests to reflect API changes
- Add comprehensive annotations to TowerRetryPolicy with default values
- Add Javadoc documentation to TowerRetryPolicy class explaining retry behavior
- Fix missing annotations in WaveConfig BuildOpts class (conda, compression, maxDuration)


Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
- Update WaveClient to use HxClient.newBuilder() with builder pattern
- Update TowerClient to use HxClient.newBuilder() with inline HTTP client configuration
- Update HttpPluginRepository to use HxClient.newBuilder() with retry config
- Fix TowerClientTest to mock HxClient.Builder instead of HxConfig.Builder
- Update method calls to match new builder API (bearerToken, basicAuth, etc.)
- Upgrade lib-httpx dependency to v2.0.0 across all affected modules
- All tests pass after migration to new HxClient API

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

Co-Authored-By: Claude <noreply@anthropic.com>
@pditommaso pditommaso changed the title Refactor Wave client to use lib-httpx library Refactor Wave and Tower client to use lib-httpx library Aug 23, 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.

1 participant