Repository navigation
refactor: decompose Methods.java into focused utility classes - #90
Merged
Merged
Conversation
Methods.java was 1,790 lines mixing 7+ concerns. Extract 5 new classes: - HashUtils: consolidate 3 duplicate MD5 implementations - YamlUtils: YAML reading and manipulation - ArchiveDownloader: curl/zip/tar extraction and S3 downloads - FileTraversalUtils: directory walking and file collection - NextflowOutputFilter: output line filtering and sanitization Methods.java is now a 488-line thin delegation facade. Delete duplicate filterNextflowOutput Groovy adapter. Update NfCoreUtils and CsvUtils to use HashUtils.
The sanitizeOutput method was ~100 lines with 9 getOrDefault calls and inline validation. Extract a SanitizeOptions inner class to centralize option parsing and validation.
- Fix raw types: List -> List<?> / List<String> in FileTraversalUtils and Methods public API - Fix silent exception swallowing: ArchiveDownloader.curlAndUntar, curlAndUnzip, and NfCoreUtils.installModule now throw IOException on failure instead of logging and returning silently - Consolidate DEFAULT_CSV_DOUBLE_DIGITS: single source of truth in CsvUtils.DEFAULT_DOUBLE_DIGITS, referenced by Methods and OutputSanitizer
- Implement missing additionalPatterns filtering in NextflowOutputFilter (was lost during refactoring, now properly applies regex patterns to output) - Consolidate MD5 implementations in HashUtils: - Extract shared byteToHex(byte) helper method - Use consistent hex conversion in both md5Hex() and listToMD5() - Change listToMD5 parameter from ArrayList<Object> to List<?> for type safety - Align exception handling (NoSuchAlgorithmException instead of UnsupportedEncodingException) - Update Methods.java delegation to match new HashUtils signature Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
maxulysse
force-pushed
the
refactor/decompose-methods
branch
from
September 11, 2026 13:51
5b73088 to
2634f2a
Compare
Carry 1.2.1 (tableMD5Keys, normalizeTable, tableRemoveComments) into the decomposed structure: SanitizeOptions reads the table options, Methods and OutputSanitizer take defaults from TableUtils. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- restore filterNextflowOutput(Object output, Map options): it was not a duplicate of the (LinkedHashMap, Object) overload, argument order differs - additionalPatterns removes matches instead of replacing them with [FILTERED], like the built-in rules; only catch PatternSyntaxException - keep the install command in the installModule error message - revert SanitizeOptions: same behaviour, ~150 lines of getters; keep the shared DEFAULT_TABLE_DOUBLE_DIGITS - HashUtils: one hex loop, md5Hex delegates to listToMD5 - CHANGELOG: keep past releases as on main (history rewrite goes to its own PR), document behaviour changes under Unreleased - add NextflowOutputFilterTest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and S3 code - Methods owns all overloads and defaults; utility classes expose one entry point each - FileTraversalUtils.PathFilter and walk() replace the duplicated include/exclude checks; S3 listing moves there from ArchiveDownloader - NextflowOutputFilter uses precompiled rule tables and small helpers - ArchiveDownloader downloads with curl --fail to a temp file, then extracts; one TAR_FLAGS table handles compression types - downloadFromS3 uses Utils.runProcess; HashUtils no longer throws NoSuchAlgorithmException - TableUtils owns the table defaults used by Methods and OutputSanitizer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maxulysse
added a commit
that referenced
this pull request
Nov 11, 2026
* docs: add PR links and authors to past CHANGELOG entries Backfill PR numbers and contributors for 0.0.1-1.2.1, fix release attribution, and drop the brackets from release headings (no link references are defined for them). Moved out of #90, where it was unrelated to the refactor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: link each CHANGELOG release to its GitHub release Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: credit #61 and #81 to @prototaxites, their GitHub author Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: drop release link definitions from the CHANGELOG Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: add the PR link to the tableRemoveComments CHANGELOG entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…thods # Conflicts: # CHANGELOG.md
…lution - Methods parses every Groovy options map; FileTraversalUtils, NextflowOutputFilter and ArchiveDownloader take typed parameters only - downloadFromS3 no longer passes its unused options map down - YamlUtils resolves wildcards with Files.newDirectoryStream, which closes the listing and keeps the I/O error's cause - NextflowOutputFilter compiles the userName pattern once Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oadFromS3 docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…number Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Request Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… nfcoreInstall - curlAndExtract(url, dest) derives the compression from the file name and delegates; curlAndUntar and curlAndUnzip are inlined - nfcoreInstall reads the module spec first, then makes a single installModule call - HashUtils formats the digest with BigInteger instead of a hand-written hex loop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
matthdsm
approved these changes
Nov 12, 2026
maxulysse
added a commit
that referenced
this pull request
Nov 13, 2026
* feat: extract() archives from local paths, URLs and S3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: add PR number to CHANGELOG Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: warn when the deprecated curlAndExtract() is called Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: extract() takes optional dest and compression named arguments Without dest, extract() uses a temporary directory deleted at exit; it returns the directory either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: name the extract() directory option extractDir Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: reject unknown extract() options, create extractDir only for a valid type Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: name the extraction directory extractDir in ArchiveExtractor Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: extract file:// URLs in place, download other URLs with nextflow fs cp Drops curl: nextflow fs cp reads http(s), ftp and cloud URLs, and fails on HTTP errors and truncated transfers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: report downloadFromS3() failures through runOrThrow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: drop curl from the CHANGELOG, extract() downloads with nextflow fs cp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: bring extract() prose up to date Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: restore the #90 CHANGELOG entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Split the 1,841-line
Methods.javainto focused utility classes, implement the ignoredadditionalPatternsoption, and make archive download failures fatal.Methods.java(581 lines): the public API, registered throughextensionMethods; owns every overload, default and Groovy options map, and delegates with typed parameters to one entry point per operation. All public signatures kept, includingfilterNextflowOutput(LinkedHashMap, Object)andfilterNextflowOutput(Object, Map)HashUtils: the single MD5 implementation (was duplicated 3x);listToMD5()no longer declaresNoSuchAlgorithmExceptionYamlUtils: YAML reading and key removal; wildcard paths resolved withFiles.newDirectoryStreamFileTraversalUtils:getAllFilesFromDir,getAllFilesFromPath,getAllFilesFromChannel,getRelativePath; onePathFilter,walk()andUtils.buildMatchers()(also used byOutputSanitizer) replace the duplicated include/exclude checks; also lists S3 pathsNextflowOutputFilter: precompiled rule tables and small helpers replace the 127-line method;additionalPatternsmatches are now removed from every line, and an invalid regex prints a warning and is skippedArchiveDownloader:curlAndExtract()downloads withcurl --failto a temporary file, then extracts, and throwsIOExceptionon failure; the URL overload derives the compression from the file name, and oneTAR_FLAGStable handles the compression types, case-insensitive;downloadFromS3()usesUtils.runProcessand takes only the URINfCoreUtils:nfcoreInstallreads each module spec, then makes oneinstallModulecall;installModulethrowsIOExceptionwith the exit code, command and stderr;nfcoreInstallstill prints it, so a failed install stays non-fatalTableUtils: ownsDEFAULT_DOUBLE_DIGITSandDEFAULT_REMOVE_COMMENTS, used byMethodsandOutputSanitizerList) replaced byList<?>/List<String>in public signaturesdocs/usage.md: documentadditionalPatterns; fix thefilterNextflowOutputplaceholders and sorted lines;downloadFromS3needs Nextflow, not the AWS CLI, and reads public buckets withoutnoSignRequest(Nextflow falls back to anonymous access)NextflowOutputFilterTest(additionalPatterns,(Object, Map)overload),ArchiveDownloaderTest(tar, HTTP error, truncated and corrupt downloads, compression aliases, unsupported URL extensions)Tested with mise tools: 34 JUnit tests, 45 nf-tests on Nextflow 26.04.9,
filterNextflowOutputnf-tests on 26.10.5.Generated via opencode and mistral-ai
Verified by @maxulysse
🤖 Generated with Claude Code