Skip to content

fix: download content from datalinks with nested folders [PLAT-4489]#590

Merged
weronikasosnowskaseqera merged 4 commits intomasterfrom
fix/download-datalinks-nested-folder-PLAT-4489
Mar 18, 2026
Merged

fix: download content from datalinks with nested folders [PLAT-4489]#590
weronikasosnowskaseqera merged 4 commits intomasterfrom
fix/download-datalinks-nested-folder-PLAT-4489

Conversation

@weronikasosnowskaseqera
Copy link
Contributor

@weronikasosnowskaseqera weronikasosnowskaseqera commented Mar 12, 2026

Description

https://seqera.atlassian.net/browse/PLAT-4489

browse-tree returns the full recursive tree of a given folder, including empty folders, ex:

  • data-explorer-integration-test/some-empty-folder/ ← folder, should be ignored
  • data-explorer-integration-test/first-lvl-nested/file.txt ← file, should be downloaded

Folder entries (paths ending with /) are not downloadable and were causing a "File not found" error. Fix skips them during iteration.

@georgi-seqera
Copy link
Contributor

browse-tree returns the full recursive tree of a given folder, including files from all nested levels. For example, for data-explorer-integration-test/ it returns:
data-explorer-integration-test/first-lvl-nested/ ← folder, should be ignored

I don't think this is true. The /browse-tree API endpoint will return a list of paths (including subpaths) to all files in a specified directory and doesn't include separate "folder" entries.

It will return a response in the format of:

{
     "items": [
             {
                 "path": "directory/filename1.txt",
                 "size": 106421
             },
             {
                 "path": "directory/subdirectory/filename2.txt",
                 "size": 106421
             }
     ]
 }

Note: there is a separate /browse API endpoint that does include "FOLDER" entries which might be where the confusion is from, but that is not what is used in this request to determine files to be download.

I tried to reproduce the originally described issue and it worked fine with the code on master as far as I can see, unless I am missing something?

Copy link
Contributor

@georgi-seqera georgi-seqera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, I looked at the originally raised issue again and there seems to be an edge case around empty folders in the Platform API that does return an item representing a "folder" - if there is basically an empty folder without anything in it, so it is a "leaf" in the tree.

{
     "items": [
             {
                 "path": "directory/filename1.txt",
                 "size": 106421
             },
             {
                 "path": "directory/subdirectory/filename2.txt",
                 "size": 106421
             },
             {
                 "path": "directory/empty-dir/",
                 "size": null
             }
     ]
 }

So the exact root cause is slightly different, but the fix is effectively the same.
Could you add a test for this, please?

@weronikasosnowskaseqera weronikasosnowskaseqera merged commit c306bc6 into master Mar 18, 2026
10 checks passed
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.

2 participants