diff --git a/cypress/e2e/group2/myworkflows.ts b/cypress/e2e/group2/myworkflows.ts index 6f03a71e7a..808d0ce933 100644 --- a/cypress/e2e/group2/myworkflows.ts +++ b/cypress/e2e/group2/myworkflows.ts @@ -429,7 +429,7 @@ describe('Dockstore my workflows part 2', () => { gotoVersionsAndClickActions(); // Request DOI cy.fixture('versionWithDoi.json').then((json) => { - cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc&include=metrics', { body: json, statusCode: 200, }).as('getVersionWithDoi'); @@ -448,7 +448,7 @@ describe('Dockstore my workflows part 2', () => { // Export to ORCID cy.fixture('versionAfterOrcidExport.json').then((json) => { - cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc&include=metrics', { body: json, statusCode: 200, }).as('getVersionAfterOrcidExport'); @@ -456,6 +456,7 @@ describe('Dockstore my workflows part 2', () => { cy.get('[data-cy=dockstore-export-orcid-button]').click(); cy.get('[data-cy=export-button').should('be.enabled'); cy.get('[data-cy=export-button').click(); + gotoVersionsAndClickActions(); cy.get('[data-cy=dockstore-export-orcid-button]').should('not.exist'); // Should not be able to export to ORCID again }); @@ -521,7 +522,7 @@ describe('Dockstore my workflows part 2', () => { cy.wait('@refreshWorkflow'); cy.fixture('sampleWorkflowVersion').then((json) => { - cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc&include=metrics', { body: json, }).as('getVersion'); }); diff --git a/cypress/e2e/group3/metrics.ts b/cypress/e2e/group3/metrics.ts index a5858448e2..677db2098f 100644 --- a/cypress/e2e/group3/metrics.ts +++ b/cypress/e2e/group3/metrics.ts @@ -22,6 +22,17 @@ describe('Dockstore Metrics', () => { }).as('getMetrics'); }); cy.visit('/workflows/github.com/A/l:master'); + cy.fixture('versionWithMetrics.json').then((json) => { + cy.intercept('GET', '/api/workflows/published/11/workflowVersions?limit=10&offset=0&sortOrder=desc&include=metrics', { + body: json, + statusCode: 200, + }).as('getVersionWithMetrics'); + }); + cy.wait('@getVersionWithMetrics'); + goToTab('Versions'); + cy.get('[data-cy=execution-metrics-icon]').should('be.visible'); + cy.get('[data-cy=validation-metrics-icon]').should('be.visible'); + cy.wait('@getMetrics'); goToTab('Metrics'); diff --git a/cypress/fixtures/versionAfterOrcidExport.json b/cypress/fixtures/versionAfterOrcidExport.json index 914d2346ec..84e66a439e 100644 --- a/cypress/fixtures/versionAfterOrcidExport.json +++ b/cypress/fixtures/versionAfterOrcidExport.json @@ -1,44 +1,66 @@ [ { + "aiTopicProcessed": false, "aliases": null, - "author": null, - "authors": [], + "author": "Muhammed Lee", + "authors": [ + { + "affiliation": null, + "email": "Muhammad.Lee@oicr.on.ca", + "name": "Muhammed Lee", + "role": null + } + ], "commitID": null, - "dbUpdateDate": 1622246514895, - "description": null, + "dbUpdateDate": 1722026014356, "descriptionSource": null, "dirtyBit": false, - "doiStatus": "CREATED", - "doiURL": "10.5072/zenodo.841014", + "doiStatus": "NOT_REQUESTED", + "doiURL": null, "dois": { "USER": { + "id": 1234, "type": "VERSION", "name": "10.5072/zenodo.841014", "initiator": "USER" } }, - "email": null, + "email": "Muhammad.Lee@oicr.on.ca", "frozen": true, "hidden": false, "id": 13, "images": null, "input_file_formats": [], - "last_modified": 1480374117003, + "kernelImagePath": null, + "last_modified": 1480345317003, "legacyVersion": true, + "metricsByPlatform": null, "name": "master", - "orcidAuthors": [], + "orcidAuthors": null, "output_file_formats": [], + "readMePath": null, "reference": "master", "referenceType": "UNSET", - "subClass": null, "synced": false, + "userFiles": [], "valid": true, "validations": null, "verified": false, + "verifiedPlatforms": [], "verifiedSource": null, "verifiedSources": [], "versionEditor": null, "versionMetadata": { + "descriptorTypeVersions": [], + "dois": { + "USER": { + "id": 1234, + "type": "VERSION", + "name": "10.5072/zenodo.841014", + "initiator": "USER" + } + }, + "engineVersions": [], "id": 13, "parsedInformationSet": null, "userIdToOrcidPutCode": { @@ -51,12 +73,12 @@ "workingDirectory": "" }, { + "aiTopicProcessed": false, "aliases": null, "author": null, "authors": [], "commitID": null, - "dbUpdateDate": 1480374117003, - "description": null, + "dbUpdateDate": 1480345317003, "descriptionSource": null, "dirtyBit": false, "doiStatus": "NOT_REQUESTED", @@ -68,24 +90,32 @@ "id": 14, "images": null, "input_file_formats": [], - "last_modified": 1480374117003, + "kernelImagePath": null, + "last_modified": 1480345317003, "legacyVersion": true, + "metricsByPlatform": null, "name": "test", - "orcidAuthors": [], + "orcidAuthors": null, "output_file_formats": [], + "readMePath": null, "reference": "test", "referenceType": "UNSET", - "subClass": null, - "synced": false, + "synced": true, + "userFiles": [], "valid": true, "validations": null, "verified": false, + "verifiedPlatforms": [], "verifiedSource": null, "verifiedSources": [], "versionEditor": null, "versionMetadata": { + "descriptorTypeVersions": [], + "dois": {}, + "engineVersions": [], "id": 14, - "parsedInformationSet": null, + "parsedInformationSet": [], + "publicAccessibleTestParameterFile": null, "userIdToOrcidPutCode": {} }, "workflow_path": "/1st-workflow.cwl", diff --git a/cypress/fixtures/versionWithMetrics.json b/cypress/fixtures/versionWithMetrics.json new file mode 100644 index 0000000000..cd9bd72025 --- /dev/null +++ b/cypress/fixtures/versionWithMetrics.json @@ -0,0 +1,541 @@ +[ + { + "aiTopicProcessed": false, + "aliases": null, + "author": "Muhammed Lee", + "authors": [ + { + "affiliation": null, + "email": "Muhammad.Lee@oicr.on.ca", + "name": "Muhammed Lee", + "role": null + } + ], + "commitID": null, + "dbUpdateDate": 1722026014356, + "descriptionSource": null, + "dirtyBit": false, + "doiStatus": "NOT_REQUESTED", + "doiURL": null, + "dois": { + "USER": { + "id": 1234, + "type": "VERSION", + "name": "10.5072/zenodo.841014", + "initiator": "USER" + } + }, + "email": "Muhammad.Lee@oicr.on.ca", + "frozen": true, + "hidden": false, + "id": 13, + "images": null, + "input_file_formats": [], + "kernelImagePath": null, + "last_modified": 1480345317003, + "legacyVersion": true, + "metricsByPlatform": { + "GALAXY": { + "executionStatusCount": null, + "id": 124, + "validationStatus": { + "id": 134, + "validatorTools": { + "MINIWDL": { + "id": 26, + "mostRecentVersionName": "2.0", + "numberOfRuns": 3, + "passingRate": 66.66666666666666, + "validatorVersions": [ + { + "dateExecuted": "2023-03-31T15:06:49.888745366Z", + "errorMessage": null, + "id": 38, + "isValid": true, + "name": "1.0", + "numberOfRuns": 1, + "passingRate": 100 + }, + { + "dateExecuted": "2023-04-30T15:06:49.888745366Z", + "errorMessage": null, + "id": 39, + "isValid": false, + "name": "2.0", + "numberOfRuns": 1, + "passingRate": 0 + }, + { + "dateExecuted": "2023-03-31T15:06:49.888745366Z", + "errorMessage": null, + "id": 40, + "isValid": true, + "name": "v1.1", + "numberOfRuns": 1, + "passingRate": 100 + } + ] + }, + "WOMTOOL": { + "id": 27, + "mostRecentVersionName": "84", + "numberOfRuns": 2, + "passingRate": 0, + "validatorVersions": [ + { + "dateExecuted": "2023-04-30T16:06:49.888745366Z", + "errorMessage": "This is a very very very very very very very very very very very very long error message", + "id": 41, + "isValid": false, + "name": "84", + "numberOfRuns": 2, + "passingRate": 0 + } + ] + } + } + } + }, + "TERRA": { + "executionStatusCount": { + "count": { + "ALL": { + "executionStatusCount": 3, + "cpu": null, + "executionTime": null, + "memory": null, + "cost": null + }, + "SUCCESSFUL": { + "executionStatusCount": 2, + "cpu": null, + "executionTime": null, + "memory": null, + "cost": null + }, + "FAILED_RUNTIME_INVALID": { + "executionStatusCount": 1, + "cpu": null, + "executionTime": null, + "memory": null, + "cost": null + } + }, + "id": 136, + "numberOfFailedExecutions": 1, + "numberOfSuccessfulExecutions": 2, + "numberOfAbortedExecutions": 0 + }, + "id": 126, + "validationStatus": null + + }, + "AGC": { + "executionStatusCount": { + "count": { + "ALL": { + "executionStatusCount": 4, + "cpu": { + "average": 2, + "id": 103, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "unit": null + }, + "executionTime": { + "average": 20, + "maximum": 20, + "minimum": 20, + "numberOfDataPointsForAverage": 2, + "id": 104, + "unit": "s" + }, + "memory": { + "average": 2, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "id": 105, + "unit": "GB" + }, + "cost": { + "average": 2.00, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "id": 200, + "unit": "USD" + } + }, + "SUCCESSFUL": { + "executionStatusCount": 2, + "cpu": { + "average": 2, + "id": 103, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "unit": null + }, + "executionTime": { + "average": 20, + "maximum": 20, + "minimum": 20, + "numberOfDataPointsForAverage": 20, + "id": 104, + "unit": "s" + }, + "memory": { + "average": 2, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "id": 105, + "unit": "GB" + }, + "cost": { + "average": 2.00, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "id": 200, + "unit": "USD" + } + }, + "FAILED_RUNTIME_INVALID": { + "executionStatusCount": 2, + "cpu": null, + "executionTime": null, + "memory": null, + "cost": null + } + }, + "id": 133, + "numberOfFailedExecutions": 2, + "numberOfSuccessfulExecutions": 2, + "numberOfAbortedExecutions": 0 + }, + "id": 123, + "validationStatus": null + }, + "OTHER": { + "executionStatusCount": { + "count": { + "ALL": { + "executionStatusCount": 2, + "cpu": { + "average": 1.5, + "id": 106, + "maximum": 2, + "minimum": 1, + "numberOfDataPointsForAverage": 2, + "unit": null + }, + "executionTime": { + "average": 45.5, + "maximum": 90, + "minimum": 1, + "numberOfDataPointsForAverage": 2, + "id": 107, + "unit": "s" + }, + "memory": { + "average": 3.5, + "maximum": 4, + "minimum": 3, + "numberOfDataPointsForAverage": 2, + "id": 108, + "unit": "GB" + }, + "cost": null + }, + "FAILED_RUNTIME_INVALID": { + "executionStatusCount": 2, + "cpu": { + "average": 1.5, + "id": 106, + "maximum": 2, + "minimum": 1, + "numberOfDataPointsForAverage": 2, + "unit": null + }, + "executionTime": { + "average": 45.5, + "maximum": 90, + "minimum": 1, + "numberOfDataPointsForAverage": 2, + "id": 107, + "unit": "s" + }, + "memory": { + "average": 3.5, + "maximum": 4, + "minimum": 3, + "numberOfDataPointsForAverage": 2, + "id": 108, + "unit": "GB" + }, + "cost": null + } + }, + "id": 135, + "numberOfFailedExecutions": 2, + "numberOfSuccessfulExecutions": 0, + "numberOfAbortedExecutions": 0 + }, + "id": 125, + "cost": null, + "validationStatus": null + }, + "ALL": { + "executionStatusCount": { + "count": { + "ALL": { + "executionStatusCount": 9, + "cpu": { + "average": 2, + "id": 109, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 6, + "unit": null + }, + "executionTime": { + "average": 20, + "maximum": 20, + "minimum": 20, + "numberOfDataPointsForAverage": 6, + "id": 110, + "unit": "s" + }, + "memory": { + "average": 2, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 6, + "id": 111, + "unit": "GB" + }, + "cost": { + "average": 2, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 4, + "id": 201, + "unit": "USD" + } + }, + "SUCCESSFUL": { + "executionStatusCount": 4, + "cpu": { + "average": 2, + "id": 103, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "unit": null + }, + "executionTime": { + "average": 20, + "maximum": 20, + "minimum": 20, + "numberOfDataPointsForAverage": 20, + "id": 104, + "unit": "s" + }, + "memory": { + "average": 2, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "id": 105, + "unit": "GB" + }, + "cost": { + "average": 2.00, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "id": 200, + "unit": "USD" + } + }, + "FAILED_RUNTIME_INVALID": { + "executionStatusCount": 5, + "cpu": { + "average": 2, + "id": 106, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "unit": null + }, + "executionTime": { + "average": 20, + "maximum": 20, + "minimum": 20, + "numberOfDataPointsForAverage": 2, + "id": 107, + "unit": "s" + }, + "memory": { + "average": 2, + "maximum": 2, + "minimum": 2, + "numberOfDataPointsForAverage": 2, + "id": 108, + "unit": "GB" + }, + "cost": null + } + }, + "id": 137, + "numberOfFailedExecutions": 5, + "numberOfSuccessfulExecutions": 4, + "numberOfAbortedExecutions": 0 + }, + "id": 127, + "validationStatus": { + "id": 138, + "validatorTools": { + "MINIWDL": { + "id": 28, + "mostRecentVersionName": "2.0", + "numberOfRuns": 3, + "passingRate": 66.66666666666666, + "validatorVersions": [ + { + "dateExecuted": "2023-03-31T15:06:49.888745366Z", + "errorMessage": null, + "id": 42, + "isValid": true, + "name": "1.0", + "numberOfRuns": 1, + "passingRate": 100 + }, + { + "dateExecuted": "2023-04-30T15:06:49.888745366Z", + "errorMessage": null, + "id": 43, + "isValid": false, + "name": "2.0", + "numberOfRuns": 1, + "passingRate": 0 + }, + { + "dateExecuted": "2023-03-31T15:06:49.888745366Z", + "errorMessage": null, + "id": 44, + "isValid": true, + "name": "v1.1", + "numberOfRuns": 1, + "passingRate": 100 + } + ] + }, + "WOMTOOL": { + "id": 29, + "mostRecentVersionName": "84", + "numberOfRuns": 2, + "passingRate": 0, + "validatorVersions": [ + { + "dateExecuted": "2023-04-30T16:06:49.888745366Z", + "errorMessage": "This is a very very very very very very very very very very very very long error message", + "id": 45, + "isValid": false, + "name": "84", + "numberOfRuns": 2, + "passingRate": 0 + } + ] + } + } + } + } + }, + "name": "master", + "orcidAuthors": null, + "output_file_formats": [], + "readMePath": null, + "reference": "master", + "referenceType": "UNSET", + "synced": false, + "userFiles": [], + "valid": true, + "validations": null, + "verified": false, + "verifiedPlatforms": [], + "verifiedSource": null, + "verifiedSources": [], + "versionEditor": null, + "versionMetadata": { + "descriptorTypeVersions": [], + "dois": { + "USER": { + "id": 1234, + "type": "VERSION", + "name": "10.5072/zenodo.841014", + "initiator": "USER" + } + }, + "engineVersions": [], + "id": 13, + "parsedInformationSet": [], + "publicAccessibleTestParameterFile": null, + "userIdToOrcidPutCode": {} + }, + "workflow_path": "/1st-workflow.cwl", + "workingDirectory": "" + }, + { + "aiTopicProcessed": false, + "aliases": null, + "author": null, + "authors": [], + "commitID": null, + "dbUpdateDate": 1480345317003, + "descriptionSource": null, + "dirtyBit": false, + "doiStatus": "NOT_REQUESTED", + "doiURL": null, + "dois": {}, + "email": null, + "frozen": false, + "hidden": true, + "id": 14, + "images": null, + "input_file_formats": [], + "kernelImagePath": null, + "last_modified": 1480345317003, + "legacyVersion": true, + "metricsByPlatform": null, + "name": "test", + "orcidAuthors": null, + "output_file_formats": [], + "readMePath": null, + "reference": "test", + "referenceType": "UNSET", + "synced": true, + "userFiles": [], + "valid": true, + "validations": null, + "verified": false, + "verifiedPlatforms": [], + "verifiedSource": null, + "verifiedSources": [], + "versionEditor": null, + "versionMetadata": { + "descriptorTypeVersions": [], + "dois": {}, + "engineVersions": [], + "id": 14, + "parsedInformationSet": [], + "publicAccessibleTestParameterFile": null, + "userIdToOrcidPutCode": {} + }, + "workflow_path": "/1st-workflow.cwl", + "workingDirectory": "" + } +] diff --git a/src/app/workflow/versions/versions-datasource.ts b/src/app/workflow/versions/versions-datasource.ts index 47ce04f550..d9f763f67e 100644 --- a/src/app/workflow/versions/versions-datasource.ts +++ b/src/app/workflow/versions/versions-datasource.ts @@ -57,10 +57,19 @@ export class VersionsDataSource implements DataSource { pageIndex, sortCol, sortDirection, + 'metrics', 'response' ); } else { - workflowVersions = this.workflowsService.getWorkflowVersions(workflowId, pageSize, pageIndex, sortCol, sortDirection, 'response'); + workflowVersions = this.workflowsService.getWorkflowVersions( + workflowId, + pageSize, + pageIndex, + sortCol, + sortDirection, + 'metrics', + 'response' + ); } workflowVersions.pipe(finalize(() => this.loadingSubject$.next(false))).subscribe((versions) => { diff --git a/src/app/workflow/versions/versions.component.html b/src/app/workflow/versions/versions.component.html index 3cc4a9a538..69809c4f57 100644 --- a/src/app/workflow/versions/versions.component.html +++ b/src/app/workflow/versions/versions.component.html @@ -210,7 +210,20 @@ > - check + Execution Metrics Icon + Validation Metrics Icon diff --git a/src/app/workflow/versions/versions.component.ts b/src/app/workflow/versions/versions.component.ts index 6f6425dcb8..8e4768b38e 100644 --- a/src/app/workflow/versions/versions.component.ts +++ b/src/app/workflow/versions/versions.component.ts @@ -22,7 +22,7 @@ import { AlertService } from '../../shared/alert/state/alert.service'; import { DateService } from '../../shared/date.service'; import { Dockstore } from '../../shared/dockstore.model'; import { DockstoreService } from '../../shared/dockstore.service'; -import { Doi, EntryType, VersionVerifiedPlatform, WorkflowsService } from '../../shared/openapi'; +import { CloudInstance, Doi, EntryType, VersionVerifiedPlatform, WorkflowsService } from '../../shared/openapi'; import { ExtendedWorkflow } from '../../shared/models/ExtendedWorkflow'; import { SessionQuery } from '../../shared/session/session.query'; import { ExtendedWorkflowQuery } from '../../shared/state/extended-workflow.query'; @@ -45,6 +45,7 @@ import { PaginatorService } from '../../shared/state/paginator.service'; import { merge, Observable } from 'rxjs'; import { MatLegacyPaginator as MatPaginator, MatLegacyPaginatorModule } from '@angular/material/legacy-paginator'; import { VersionsDataSource } from './versions-datasource'; +import PartnerEnum = CloudInstance.PartnerEnum; @Component({ selector: 'app-versions-workflow', @@ -82,6 +83,7 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha @Input() workflowId: number; @Input() verifiedVersionPlatforms: Array; @Input() publicPage: boolean; + _selectedVersion: WorkflowVersion; Dockstore = Dockstore; @Input() set selectedVersion(value: WorkflowVersion) { @@ -101,6 +103,7 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha public pageSize$: Observable; public pageIndex$: Observable; public versionsLength$: Observable; + protected readonly PartnerEnum = PartnerEnum; private sortCol: string; setNoOrderCols(): Array { diff --git a/src/assets/svg/execution-icon.svg b/src/assets/svg/execution-icon.svg new file mode 100644 index 0000000000..195314edb3 --- /dev/null +++ b/src/assets/svg/execution-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/validation-icon.svg b/src/assets/svg/validation-icon.svg new file mode 100644 index 0000000000..d4867f3bb8 --- /dev/null +++ b/src/assets/svg/validation-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file