Skip to content

Commit

Permalink
Disable CGC button for CWL with run http (#791)
Browse files Browse the repository at this point in the history
dockstore/dockstore#2819

See in particular comments starting at
dockstore/dockstore#2819 (comment)
  • Loading branch information
coverbeck authored Sep 13, 2019
1 parent c60a2da commit 9a217f0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/shared/file.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import { inject, TestBed } from '@angular/core/testing';
import {
cwlSourceFileWithCommentedMixinImport,
cwlSourceFileWithHttpRun,
cwlSourceFileWithHttpsImport,
cwlSourceFileWithIncludeImport,
cwlSourceFileWithMixinImport,
Expand Down Expand Up @@ -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();
}));
});
2 changes: 1 addition & 1 deletion src/app/shared/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
43 changes: 43 additions & 0 deletions src/app/test/mocked-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]
#dct:contributor:
# foaf:name: Denis Yuen
# foaf:mbox: mailto:[email protected]
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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9a217f0

Please sign in to comment.