tower-cli icon indicating copy to clipboard operation
tower-cli copied to clipboard

Fix labels missing from runs dump output

Open JaimeSeqLabs opened this issue 1 year ago • 0 comments

Description

Closes #384

This PR adds the missing 'labels' query attribute needed to retrieve the workflow labels along with the rest of the metadata. Also, the runs dump sub-cmd has been refactored to improve code readability and test coverage.

Guidelines for testing

In order to test the changes an existing workflow run with labels is needed, however, the example run used in the original issue can be re-used here.

Dump the workflow run:

$> ./tw runs dump -i UkcqQpttWqvPg -w seqeralabs/showcase -o rnaseq-showcase.tar.gz

Extract the files in the current directory:

$> tar -xzf rnaseq-showcase.tar.gz

Check that the file workflow-metadata.json contains a 'labels' field:

{
  "pipelineId" : 232551719896592,
  "workspaceId" : 138659136604200,
  "workspaceName" : "showcase",
  "userId" : 8456,
  "runUrl" : "https://tower.nf/orgs/seqeralabs/workspaces/showcase/watch/UkcqQpttWqvPg",
  "labels" : [ {  // <--- New field!
    "id" : 75554545402364,
    "name" : "aligner_rsem",
    "resource" : false,
    "isDefault" : false
  }, {
    "id" : 142259147750578,
    "name" : "owner",
    "value" : "harshil",
    "resource" : true,
    "isDefault" : false
  }, {
    "id" : 213027699544669,
    "name" : "workspace",
    "value" : "showcase",
    "resource" : true,
    "isDefault" : false
  }, {
    "id" : 153544452690741,
    "name" : "yeast",
    "resource" : false,
    "isDefault" : false
  } ]
}

JaimeSeqLabs avatar Jun 17 '24 17:06 JaimeSeqLabs