The new getAllFilesFromPath() function is not backward compatible with depreciated getAllFilesFromDir()

Open Beginner friendly
#98 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
testing

Research direction

The issue points to getAllFilesFromPath() and the existing getAllFilesFromDir() implementation in src/main/java/nfcore/nftest/utils/Methods.java, plus usage docs and nf-test snapshots. Read the current function and the old implementation first, then run the relevant tests for relative paths and returned file types. Done means the new function supports the requested relative behavior and preserves List<File> output for full paths, with snapshots retaining file MD5 sums.

Written by the indexing model from the issue text.

Description

The situation

The getAllFilesFromDir() function is currently depreciated in favor of the new getAllFilesFromPath() function, which is said to "[...] provide the same functionality with S3 support".
However, when writing my own nf-tests I noticed a shortcoming of the new function: the boolean relative parameter is missing. This leads to multiple related issues.

The issues
  1. [Backward compatibility] Relative paths cannot trivially be shortened to plain file names. This prevents plainly replacing one function for the other in established nf-test cases.
  2. [Output data type] The getAllFilesFromPath() function misses the case to return a List<File>. Previously, if the relative: false parameter was set the returned List contained a File type. This is particularly relevant since nf-test creates an MD5 sum for the File type. In consequence, test snapshots do not contain the files' MD5 sum any longer.

I consider this particularly confusing as even the nf-core pipeline template generates a test case where the old getAllFilesFromDir() is used, the relative parameter is set, and a corresponding snapshot is produced.

Temporary workaround

Keep using the old depreciated getAllFilesFromDir() function.

Proposal

Please add the relative parameter to the new getAllFilesFromPath() function with the established List<File> return type for full syntactic and functional backward compatibility.

Dominant language
Java
Stars
13
Forks
11
Avg merge
3d 4h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nf-core/nft-utils

All issues in nf-core/nft-utils

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.