Migrate SraExplorer to use HxClient for HTTP operations#6467
Migrate SraExplorer to use HxClient for HTTP operations#6467pditommaso merged 2 commits intomasterfrom
Conversation
Replace legacy `URL.getText()` with HxClient for better retry handling and consistency with other HTTP clients in the codebase. Changes: - Replace legacy java.net.URL HTTP calls with HxClient - Update SraRetryConfig to implement Retryable.Config interface - Remove custom retry logic (~70 lines) in favor of HxClient's built-in retry - Configure HxClient with retry policy and status codes (408, 429, 500, 502, 503, 504) - Remove obsolete retry tests that tested custom implementation Benefits: - Cleaner architecture using standardized HTTP client - Better integration with Nextflow's HTTP infrastructure - Maintained backward compatibility with existing retry configuration - More maintainable with centralized retry logic Signed-off-by: Claude <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
|
@claude review |
|
Claude finished @pditommaso's task —— View job Code Review Completed ✅Summary: This is a well-executed refactoring that successfully migrates SraExplorer from legacy HTTP handling to HxClient. The changes improve code maintainability while preserving existing functionality. ✅ StrengthsClean Architecture Improvement
Proper HxClient Integration
Backward Compatibility
Clean Implementation
📋 Technical NotesSraRetryConfig Changes
SraExplorer Refactoring
Test Updates
🔍 Minor Observations
✅ VerdictThis PR represents a high-quality refactoring that:
The changes are technically sound and ready for merge. |
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Summary
Replace legacy
URL.getText()HTTP client withHxClientin the SRA datasource component for better retry handling and consistency with other HTTP clients in the codebase.Changes
SraRetryConfig
Retryable.Configinterface for compatibility with HxClientmultiplierfield (default: 2.0) for exponential backoffgetMaxAttempts(),getJitter(),getMultiplier()getDelay()andgetMaxDelay()for HxClient integrationSraExplorer
new URI(url).toURL().getText()withHxClient.sendAsString()getHttpClient()method that configures HxClient with:SraRetryConfigrunWithRetry()methodretryPolicy()methodcontainsErrorCodes()methodERROR_PATTERNconstantmakeDataRequest(),makeSearch(), andreadRunUrl()SraExplorerTest
FailsafeExceptionimportBenefits
retryPolicyconfiguration still worksSraRetryConfignow compatible with broader Nextflow ecosystemTesting