From 30be11ba0b802724c0f4b1d6758109e914f71371 Mon Sep 17 00:00:00 2001 From: Ryan Ratcliff Date: Wed, 25 Mar 2026 22:30:12 -0400 Subject: [PATCH] feat!: remove create-foundation-xml-import task command BREAKING CHANGE: The `lo tasks create-foundation-xml-import` command is removed. The backend endpoint was removed from task-service (FLE-346, https://github.com/lifeomic/task-service/pull/199). Use the GA4GH replacement flow. Made-with: Cursor --- CHANGELOG.md | 6 ++ lib/cmds/tasks_cmds/create-foundation-task.js | 89 ------------------- test/unit/commands/task.test.js | 69 -------------- 3 files changed, 6 insertions(+), 158 deletions(-) delete mode 100644 lib/cmds/tasks_cmds/create-foundation-task.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 4085752..59d6c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Removed + +- **BREAKING:** Removed `lo tasks create-foundation-xml-import`. The Foundation XML task-service pipeline was removed ([FLE-346](https://lifeomic.atlassian.net/browse/FLE-346), [task-service#199](https://github.com/lifeomic/task-service/pull/199)). Use the GA4GH replacement flow. + ## [13.9.0] - 2023-01-04 ### Added diff --git a/lib/cmds/tasks_cmds/create-foundation-task.js b/lib/cmds/tasks_cmds/create-foundation-task.js deleted file mode 100644 index c10e2e0..0000000 --- a/lib/cmds/tasks_cmds/create-foundation-task.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -const { post } = require('../../api'); -const print = require('../../print'); -const { convertToISODateString } = require('../../dateConversion'); - -exports.command = 'create-foundation-xml-import '; -exports.desc = 'Create a task to ingest a Foundation One XML report'; -exports.builder = yargs => { - yargs.positional('datasetId', { - describe: 'The dataset Id.', - type: 'string' - }).option('xml-file-id', { - describe: 'The ID of the uploaded Foundation One XML report', - alias: 'x', - type: 'string', - demandOption: true - }).option('report-file-id', { - describe: 'The file ID of the PDF report. Only use if uploading the PDF separately.', - alias: 'r', - type: 'string', - demandOption: false - }).option('subject-id', { - describe: 'The ID of the subject to associated the report with', - alias: 's', - type: 'string', - demandOption: true - }).option('sequence-name', { - describe: 'A friendly display name for the sequencing event.', - alias: 'n', - type: 'string' - }).option('test-type', { - describe: 'The test type.', - type: 'string', - demandOption: true - }).option('indexed-date', { - describe: 'The indexed date.', - type: 'string' - }).option('performer-id', { - describe: 'The ID of the FHIR Organization resource that performed the sequencing.', - type: 'string' - }).option('index-type', { - describe: 'The index job to perform.', - choices: ['all', 'variant', 'cnv', 'fnv'], - type: 'string', - demandOption: false - }).option('re-ingest-file', { - describe: 'Force a re-ingestion of a file that has already been ingested.', - type: 'Boolean', - default: false, - demandOption: false - }).option('body-site', { - describe: 'The body site of the specimen.', - type: 'string', - demandOption: false - }).option('body-site-system', { - describe: 'The defining system of the provided body site.', - type: 'string', - demandOption: false - }).option('body-site-display', { - describe: 'The display field for the body-site.', - type: 'string', - demandOption: false - }).option('send-failed-to', { - describe: 'An optional email address for sending failed task notifications.', - type: 'string', - demandOption: false - }); -}; - -exports.handler = async argv => { - const response = await post(argv, `/v1/tasks/system/foundation-xml-import`, { - xmlFileId: argv.xmlFileId, - datasetId: argv.datasetId, - reportFileId: argv.reportFileId, - subjectId: argv.subjectId, - sequenceName: argv.sequenceName, - testType: argv.testType, - indexedDate: convertToISODateString(argv.indexedDate), - performerId: argv.performerId, - indexType: argv.indexType, - reIngestFile: argv.reIngestFile, - bodySite: argv.bodySite, - bodySiteSystem: argv.bodySiteSystem, - bodySiteDisplay: argv.bodySiteDisplay, - sendFailedTo: argv.sendFailedTo - }); - print(response.data, argv); -}; diff --git a/test/unit/commands/task.test.js b/test/unit/commands/task.test.js index f396c90..15223f7 100644 --- a/test/unit/commands/task.test.js +++ b/test/unit/commands/task.test.js @@ -28,7 +28,6 @@ const cancel = proxyquire('../../../lib/cmds/tasks_cmds/cancel', mocks); const retry = proxyquire('../../../lib/cmds/tasks_cmds/retry', mocks); const list = proxyquire('../../../lib/cmds/tasks_cmds/list', mocks); const create = proxyquire('../../../lib/cmds/tasks_cmds/create', mocks); -const createFoundationTask = proxyquire('../../../lib/cmds/tasks_cmds/create-foundation-task', mocks); const createNantomicsTask = proxyquire('../../../lib/cmds/tasks_cmds/create-nantomics-task', mocks); const createAshionTask = proxyquire('../../../lib/cmds/tasks_cmds/create-ashion-task', mocks); const createNantBulkTask = proxyquire('../../../lib/cmds/tasks_cmds/create-nant-bulk-task', mocks); @@ -88,74 +87,6 @@ test.serial.cb('The "tasks-create" command should create a task', t => { .parse('create'); }); -test.serial.cb('The "create-foundation-xml-import" command should create a foundation ingest task', t => { - const res = { data: {} }; - postStub.onFirstCall().returns(res); - callback = () => { - t.is(postStub.callCount, 1); - t.is(postStub.getCall(0).args[1], '/v1/tasks/system/foundation-xml-import'); - t.deepEqual(postStub.getCall(0).args[2], { - xmlFileId: 'c8ef7300-1373-4e51-8eb9-ff333600f6a5', - datasetId: 'db3e09e9-1ecd-4976-aa5e-70ac7ada0cc3', - reportFileId: '1234', - subjectId: '2a6dc73e-ed30-4387-94c1-0cd661da56d9', - sequenceName: 'test3', - testType: 'test1', - performerId: 'performer1', - indexedDate: '1999-01-01T00:00:00.000Z', - indexType: 'all', - reIngestFile: false, - bodySite: 'Colon', - bodySiteSystem: 'http://a.fancy.system.com', - bodySiteDisplay: 'body site notation', - sendFailedTo: 'failed@user.com' - }); - t.is(printSpy.callCount, 1); - t.is(printSpy.getCall(0).args[0], res.data); - t.end(); - }; - - yargs.command(createFoundationTask) - .parse('create-foundation-xml-import db3e09e9-1ecd-4976-aa5e-70ac7ada0cc3 -x c8ef7300-1373-4e51-8eb9-ff333600f6a5 ' + - '-r 1234 -s 2a6dc73e-ed30-4387-94c1-0cd661da56d9 -n test3 --test-type test1 --performer-id performer1 ' + - '--indexed-date "1999-01-01" --index-type all --body-site "Colon" --body-site-system "http://a.fancy.system.com" ' + - '--body-site-display "body site notation" --send-failed-to failed@user.com'); -}); - -test.serial.cb('The "create-foundation-xml-import" accepts re-ingest-file as an optional boolean flag', t => { - const res = { data: {} }; - postStub.onFirstCall().returns(res); - callback = () => { - t.is(postStub.callCount, 1); - t.is(postStub.getCall(0).args[1], '/v1/tasks/system/foundation-xml-import'); - t.deepEqual(postStub.getCall(0).args[2], { - xmlFileId: 'c8ef7300-1373-4e51-8eb9-ff333600f6a5', - datasetId: 'db3e09e9-1ecd-4976-aa5e-70ac7ada0cc3', - reportFileId: '1234', - subjectId: '2a6dc73e-ed30-4387-94c1-0cd661da56d9', - sequenceName: 'test3', - testType: 'test1', - performerId: 'performer1', - indexedDate: '1999-01-01T00:00:00.000Z', - indexType: 'all', - reIngestFile: true, - bodySite: 'Colon', - bodySiteSystem: 'http://a.fancy.system.com', - bodySiteDisplay: 'body site notation', - sendFailedTo: undefined - }); - t.is(printSpy.callCount, 1); - t.is(printSpy.getCall(0).args[0], res.data); - t.end(); - }; - - yargs.command(createFoundationTask) - .parse('create-foundation-xml-import db3e09e9-1ecd-4976-aa5e-70ac7ada0cc3 -x c8ef7300-1373-4e51-8eb9-ff333600f6a5 ' + - '-r 1234 -s 2a6dc73e-ed30-4387-94c1-0cd661da56d9 -n test3 --test-type test1 --performer-id performer1 ' + - '--indexed-date "1999-01-01" --index-type all --re-ingest-file --body-site "Colon" ' + - '--body-site-system "http://a.fancy.system.com" --body-site-display "body site notation"'); -}); - test.serial.cb('The "create-ashion-import" command should create a ashion ingest task', t => { const res = { data: {} }; postStub.onFirstCall().returns(res);