diff --git a/src/app/shared/file.service.spec.ts b/src/app/shared/file.service.spec.ts index 66efc2099d..0cbd8f9233 100644 --- a/src/app/shared/file.service.spec.ts +++ b/src/app/shared/file.service.spec.ts @@ -16,6 +16,7 @@ import { inject, TestBed } from '@angular/core/testing'; import { cwlSourceFileWithCommentedMixinImport, + cwlSourceFileWithHttpRun, cwlSourceFileWithHttpsImport, cwlSourceFileWithIncludeImport, cwlSourceFileWithMixinImport, @@ -76,5 +77,6 @@ describe('FileService', () => { expect(fileService.hasHttpImport(cwlSourceFileWithCommentedMixinImport)).toBeFalsy(); expect(fileService.hasHttpImport(cwlSourceFileWithIncludeImport)).toBeTruthy(); expect(fileService.hasHttpImport(cwlSourceFileWithSomeHttpLinks)).toBeFalsy(); + expect(fileService.hasHttpImport(cwlSourceFileWithHttpRun)).toBeTruthy(); })); }); diff --git a/src/app/shared/file.service.ts b/src/app/shared/file.service.ts index e224da0a65..d62587d74c 100644 --- a/src/app/shared/file.service.ts +++ b/src/app/shared/file.service.ts @@ -21,7 +21,7 @@ import { Dockstore } from './dockstore.model'; import { SourceFile, Tag, ToolDescriptor, WorkflowVersion } from './swagger'; const wdlImportHttpRegEx: RegExp = new RegExp(/^\s*import\s+"?https?/, 'm'); -const cwlImportHttpRegEx: RegExp = new RegExp(/^[^#]+\$((import)|(include)|(mixin))\s*:\s+\"?https?/, 'm'); +const cwlImportHttpRegEx: RegExp = new RegExp(/^[^#]+((run)|(\$((import)|(include)|(mixin))))\s*:\s+\"?https?/, 'm'); @Injectable({ providedIn: 'root' }) export class FileService { diff --git a/src/app/test/mocked-objects.ts b/src/app/test/mocked-objects.ts index 2d25d06c5a..7874ea44c0 100644 --- a/src/app/test/mocked-objects.ts +++ b/src/app/test/mocked-objects.ts @@ -355,6 +355,41 @@ doc: >- "pcawg logo") `; +const cwlWithHttpRun = `cwlVersion: v1.0 +class: Workflow + +#dct:creator: +# '@id': http://orcid.org/0000-0002-7681-6415 +# foaf:name: Brian O'Connor +# foaf:mbox: mailto:briandoconnor@gmail.com + +#dct:contributor: +# foaf:name: Denis Yuen +# foaf:mbox: mailto:denis.yuen@oicr.on.ca + +inputs: + input_file: File + expected_md5: string + +outputs: + workflow_output_file: + type: File + outputSource: checker/results_file + +steps: + md5sum: + run: https://raw.githubusercontent.com/dockstore-testing-organisation/md5sum/master/md5sum/md5sum.cwl + in: + input_file: input_file + out: [output_file] + checker: + run: https://raw.githubusercontent.com/dockstore-testing-organisation/md5sum/master/checker/md5sum_checker.cwl + in: + input_file: md5sum/output_file + expected_md5: expected_md5 + out: [results_file] +`; + export const cwlSourceFileWithNoImport: SourceFile = { content: cwlWithNoImport, id: 3, @@ -403,6 +438,14 @@ export const cwlSourceFileWithSomeHttpLinks: SourceFile = { type: 'DOCKSTORE_CWL' }; +export const cwlSourceFileWithHttpRun: SourceFile = { + content: cwlWithHttpRun, + id: 3, + path: '/checker.cwl', + absolutePath: '', + type: 'DOCKSTORE_CWL' +}; + export const sampleSourceFile: SourceFile = { content: 'potato', id: 1,