Fix trailing slash, response leak, NPE, and minor issues in module system#6930
Merged
pditommaso merged 3 commits intofix/module-system-code-issuesfrom Mar 17, 2026
Merged
Conversation
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
jorgee
approved these changes
Mar 17, 2026
* Use shared RegistryClient from npr-client for module commands Replace ModuleRegistryClient with RegistryClient from the new io.seqera:npr-client library. This moves the registry HTTP client and checksum algorithm to a shared library used by both Nextflow and the plugin-registry server. Changes: - ModuleChecksum now delegates to io.seqera.npr.client.ModuleChecksum - ModuleRegistryClient removed, replaced by RegistryClientFactory that creates RegistryClient instances from RegistryConfig - All CLI commands and ModuleResolver use RegistryClient directly - Tests updated to use RegistryClient type for mocks/stubs - Exception contract changed from AbortOperationException to RegistryException for registry operations Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> * fix import sort Signed-off-by: jorgee <jorge.ejarque@seqera.io> --------- Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Signed-off-by: jorgee <jorge.ejarque@seqera.io> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: jorgee <jorge.ejarque@seqera.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #6929. Fixes 8 additional issues found during code review:
Important fixes:
RegistryConfignow strips trailing slashes from configured URLs, preventing double-slash paths likehttps://registry.../api//v1/modules/ModuleRegistryClient.downloadModule()now wrapsresponse.body()in try-with-resources afterFiles.copy()to avoid leaking connectionsrelease.metadatais null --CmdModuleInfologged a warning but continued to accessmetadata.description, causing NPE. Now throwsAbortOperationExceptioninsteadModuleInfo.load()return types --load(Path)returned[:]whileload(Path, String)returnednullfor missing files. Now both returnnullconsistentlyMinor fixes:
isRemoteModuleregex -- Extracted pattern toModuleResolver.REMOTE_MODULE_PATTERNconstant; added cross-reference comment inModuleReferenceto keep them in syncremoveModulereturnsnullinstead offalse-- Barereturnin abooleanmethod now explicitly returnsfalseCmdModulePublishFiles.walk()stream --ModuleStorageTest.createTestPackage()now closes the stream viawithCloseable{}Test plan
nullinstead of[:])