Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AN-370] When converting submission to a TSV, access data by the headers #5230

Merged
merged 8 commits into from
Feb 12, 2025

Conversation

lucymcnatt
Copy link
Contributor

@lucymcnatt lucymcnatt commented Jan 23, 2025

Jira Ticket: https://broadworkbench.atlassian.net/browse/AN-370

Summary of changes:

What

Iteration on this PR that added 'N/A' as a the cost when none existed, this makes sure all the columns are in the same order when downloading submission details by accessing the columns by the header names

Why

So that the columns are consistent when downloading submission details

Testing strategy

I tested by replacing
await Workspaces(signal).workspace(namespace, name).submission(submissionId).get()
with a truncated version of the response in the affected user's workspace (shown below)
Then going to the job history page, clicking on a workflow run and checking that the submission downloaded with the correct columns (includes a cost column, null values are N/A and the values are in the correct columns)

const test_sub = {
  cost: 206.53085,
  deleteIntermediateOutputFiles: false,
  ignoreEmptyOutputs: false,
  memoryRetryMultiplier: 1.2,
  methodConfigurationName: 'preprocess_wgs_sample_jyq0UzzW1ow',
  methodConfigurationNamespace: 'cds-pipelines',
  status: 'Done',
  submissionDate: '2024-09-04T16:44:49.266Z',
  submissionEntity: {
    entityType: 'sample_set',
    entityName: 'warp_eval',
  },
  submissionId: '40c28f7b-88e2-40c1-8d1d-66b4b8524030',
  submissionRoot: 'gs://fc-secure-c3953e85-3494-484e-89aa-8c7a5f65f194/submissions/intermediates/40c28f7b-88e2-40c1-8d1d-66b4b8524030',
  submitter: '[email protected]',
  useCallCache: true,
  useReferenceDisks: false,
  userComment: '',
  workflows: [
    {
      inputResolutions: [
        {
          inputName: 'preprocess_wgs_sample.cram_ref_fasta',
          value: 'gs://ccleparams/reference/hg19/Homo_sapiens_assembly19.fasta',
        },
        {
          inputName: 'preprocess_wgs_sample.workflow_source_url',
          value:
            'https://gist.githubusercontent.com/cds-github-apps/1650f7e6e7bc2f9db8621b5411166ea3/raw/1806ad5e7c703b9a714745684ecedec362b0ce78/preprocess_wgs_sample.wdl',
        },
        {
          inputName: 'preprocess_wgs_sample.workflow_version',
          value: '1.0',
        },
      ],
      messages: [],
      status: 'Failed',
      statusLastChangedDate: '2024-09-04T16:45:45.584Z',
      workflowEntity: {
        entityType: 'sample',
        entityName: 'CDS-00Nrci',
      },
      workflowId: 'a41a70a6-0151-4fcc-aed5-f1ae5e1b3d79',
    },
    {
      cost: 4.615543,
      inputResolutions: [
        {
          inputName: 'preprocess_wgs_sample.workflow_source_url',
          value:
            'https://gist.githubusercontent.com/cds-github-apps/1650f7e6e7bc2f9db8621b5411166ea3/raw/1806ad5e7c703b9a714745684ecedec362b0ce78/preprocess_wgs_sample.wdl',
        },
        {
          inputName: 'preprocess_wgs_sample.workflow_version',
          value: '1.0',
        },
      ],
      messages: [],
      status: 'Succeeded',
      statusLastChangedDate: '2024-09-05T14:25:05.674Z',
      workflowEntity: {
        entityType: 'sample',
        entityName: 'CDS-0AZRB4',
      },
      workflowId: '41c2c859-b95d-4f88-8683-1cd6e6ce07c0',
    },
    {
      cost: 0.001705,
      inputResolutions: [
        {
          inputName: 'preprocess_wgs_sample.workflow_source_url',
          value:
            'https://gist.githubusercontent.com/cds-github-apps/1650f7e6e7bc2f9db8621b5411166ea3/raw/1806ad5e7c703b9a714745684ecedec362b0ce78/preprocess_wgs_sample.wdl',
        },
        {
          inputName: 'preprocess_wgs_sample.workflow_version',
          value: '1.0',
        },
      ],
      messages: [],
      status: 'Failed',
      statusLastChangedDate: '2024-09-04T17:01:07.925Z',
      workflowEntity: {
        entityType: 'sample',
        entityName: 'CDS-2uvoSr',
      },
      workflowId: 'fc4733ab-4b0a-4adb-9d39-ad003d4e978c',
    },
  ],
};

image

@lucymcnatt lucymcnatt changed the title [AN-370] When converting submission details to a TSV, access data by … [AN-370] When converting submission to a TSV, access data by the headers Jan 23, 2025
@lucymcnatt lucymcnatt requested a review from a team as a code owner February 5, 2025 23:47
Copy link
Contributor

@kevinmarete kevinmarete left a comment

Choose a reason for hiding this comment

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

I wasn't able to test under the specified conditions, but the code looks good to me. I added some optional comments for consideration.

src/libs/workflow-utils.ts Outdated Show resolved Hide resolved
src/libs/workflow-utils.ts Show resolved Hide resolved
Co-authored-by: Kevin Marete <[email protected]>
Copy link
Contributor

@kevinpalis kevinpalis left a comment

Choose a reason for hiding this comment

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

Apologies. I just saw this.

@lucymcnatt lucymcnatt added this pull request to the merge queue Feb 12, 2025
Merged via the queue into dev with commit 797bff8 Feb 12, 2025
11 checks passed
@lucymcnatt lucymcnatt deleted the AN-370-submission-download branch February 12, 2025 21:59
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.

4 participants