From 5e72a7b682b9a0ac540b177f8370c498aef1343a Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 5 Dec 2024 10:27:14 -0500 Subject: [PATCH 01/16] initial push --- .../executions/executions-tab.component.ts | 10 ++++++++- .../workflow/versions/versions.component.html | 13 +++++++++++- .../workflow/versions/versions.component.ts | 3 +++ src/app/workflow/workflow.component.html | 21 ++++++++++++++++++- src/app/workflow/workflow.component.ts | 11 ++++++++++ 5 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/app/workflow/executions/executions-tab.component.ts b/src/app/workflow/executions/executions-tab.component.ts index dc5a23bf6..ccbe269ab 100644 --- a/src/app/workflow/executions/executions-tab.component.ts +++ b/src/app/workflow/executions/executions-tab.component.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Component, Input, OnChanges, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; import { EntryTab } from '../../shared/entry/entry-tab'; import { CloudInstance, @@ -122,6 +122,9 @@ export class ExecutionsTabComponent extends EntryTab implements OnInit, OnChange @Input() entry: BioWorkflow | Service | Notebook; @Input() version: WorkflowVersion; + @Output() showExecutionIcon = new EventEmitter(); + @Output() showValidationIcon = new EventEmitter(); + constructor( private extendedGA4GHService: ExtendedGA4GHService, private alertService: AlertService, @@ -205,6 +208,10 @@ export class ExecutionsTabComponent extends EntryTab implements OnInit, OnChange const metrics = this.metrics.get(partner); this.executionMetricsExist = metrics?.executionStatusCount !== null; + if (this.executionMetricsExist) { + this.showExecutionIcon.emit(true); + } + if (metrics?.executionStatusCount) { this.executionStatusToMetrics = new Map(Object.entries(metrics.executionStatusCount.count)); @@ -284,6 +291,7 @@ export class ExecutionsTabComponent extends EntryTab implements OnInit, OnChange if (this.validatorToolMetricsExist) { this.validatorToolToValidatorInfo = new Map(Object.entries(this.metrics.get(partner).validationStatus.validatorTools)); this.validatorTools = Array.from(this.validatorToolToValidatorInfo.keys()); + this.showValidationIcon.emit(true); if (this.validatorTools.length > 0) { this.onSelectedValidatorToolChange(this.validatorTools[0]); diff --git a/src/app/workflow/versions/versions.component.html b/src/app/workflow/versions/versions.component.html index 993f040f0..9f56bbc42 100644 --- a/src/app/workflow/versions/versions.component.html +++ b/src/app/workflow/versions/versions.component.html @@ -217,7 +217,18 @@ > - 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 ca825a2a9..086f482a6 100644 --- a/src/app/workflow/versions/versions.component.ts +++ b/src/app/workflow/versions/versions.component.ts @@ -75,6 +75,9 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha @Input() versions: Array; @Input() workflowId: number; @Input() verifiedVersionPlatforms: Array; + @Input() hasExecutionMetrics!: boolean; + @Input() hasValidationMetrics!: boolean; + _selectedVersion: WorkflowVersion; Dockstore = Dockstore; @Input() set selectedVersion(value: WorkflowVersion) { diff --git a/src/app/workflow/workflow.component.html b/src/app/workflow/workflow.component.html index 575d09099..3deffa3c9 100644 --- a/src/app/workflow/workflow.component.html +++ b/src/app/workflow/workflow.component.html @@ -343,6 +343,8 @@

[canRead]="canRead" [canWrite]="canWrite" [isOwner]="isOwner" + [hasExecutionMetrics]="hasExecutionMetrics" + [hasValidationMetrics]="hasValidationMetrics" > @@ -456,7 +458,12 @@

- + @@ -514,6 +521,18 @@

+ Execution Metrics Icon + Validation Metrics Icon {{ sortedVersion.last_modified | date }} diff --git a/src/app/workflow/workflow.component.ts b/src/app/workflow/workflow.component.ts index 2d566ba5a..ecb286ca3 100644 --- a/src/app/workflow/workflow.component.ts +++ b/src/app/workflow/workflow.component.ts @@ -208,6 +208,9 @@ export class WorkflowComponent extends Entry implements AfterVi public selectedVersionDoi: Doi | undefined; public selectedConceptDoi: Doi | undefined; + public hasExecutionMetrics: boolean = false; + public hasValidationMetrics: boolean = false; + @Input() user; @Input() selectedVersion: WorkflowVersion; @Input() shouldClearState: boolean = true; @@ -558,6 +561,14 @@ export class WorkflowComponent extends Entry implements AfterVi }); } + showExecutionMetricsIcon(showExecutionMetricsIcon: boolean) { + this.hasExecutionMetrics = showExecutionMetricsIcon; + } + + showValidationMetricsIcon(showValidationMetricsIcon: boolean) { + this.hasValidationMetrics = showValidationMetricsIcon; + } + resetWorkflowEditData() { const labelArray = this.dockstoreService.getLabelStrings(this.workflow.labels); const workflowLabels = labelArray; From e5ca52cc0a7cd66ffa69caf420f1607e862e4099 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 5 Dec 2024 13:05:24 -0500 Subject: [PATCH 02/16] test --- cypress/e2e/group3/metrics.ts | 4 ++++ src/app/workflow/workflow.component.html | 2 ++ 2 files changed, 6 insertions(+) diff --git a/cypress/e2e/group3/metrics.ts b/cypress/e2e/group3/metrics.ts index a5858448e..ba1b4d68a 100644 --- a/cypress/e2e/group3/metrics.ts +++ b/cypress/e2e/group3/metrics.ts @@ -22,6 +22,10 @@ describe('Dockstore Metrics', () => { }).as('getMetrics'); }); cy.visit('/workflows/github.com/A/l:master'); + 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/src/app/workflow/workflow.component.html b/src/app/workflow/workflow.component.html index d541eb064..890fe7960 100644 --- a/src/app/workflow/workflow.component.html +++ b/src/app/workflow/workflow.component.html @@ -525,12 +525,14 @@

*ngIf="hasExecutionMetrics" src="assets/svg/manufacturing.svg" alt="Execution Metrics Icon" + data-cy="execution-metrics-icon" matTooltip="This version contains execution metrics." /> Validation Metrics Icon From c6e35166b7eb9d0d97b809c9cfa01f8d799c6bd9 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 5 Dec 2024 13:11:11 -0500 Subject: [PATCH 03/16] test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c0b0cf9a3..ecc971344 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -197,7 +197,7 @@ jobs: - setup_integration_test - run: name: Test - command: bash -i -c 'npx cypress run --browser chrome --record --config numTestsKeptInMemory=1 --reporter junit --spec cypress/e2e/<< parameters.integration_test_name >>/**/*' + command: bash -i -c 'npx cypress run --record --config numTestsKeptInMemory=1 --reporter junit --spec cypress/e2e/<< parameters.integration_test_name >>/**/*' no_output_timeout: 30m environment: MOCHA_FILE: integration-tests/test-results/junit/test-results-[hash].xml From 91a9e18ae7201f128922e9788647952a3e92c73f Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 12 Dec 2024 15:30:36 -0500 Subject: [PATCH 04/16] review feedback --- .../executions/executions-tab.component.ts | 10 +------- .../workflow/versions/versions-datasource.ts | 11 ++++++++- .../workflow/versions/versions.component.html | 8 +++---- .../workflow/versions/versions.component.ts | 22 +++++++++++++++--- src/app/workflow/workflow.component.html | 23 +------------------ src/app/workflow/workflow.component.ts | 11 --------- 6 files changed, 35 insertions(+), 50 deletions(-) diff --git a/src/app/workflow/executions/executions-tab.component.ts b/src/app/workflow/executions/executions-tab.component.ts index ccbe269ab..dc5a23bf6 100644 --- a/src/app/workflow/executions/executions-tab.component.ts +++ b/src/app/workflow/executions/executions-tab.component.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; +import { Component, Input, OnChanges, OnInit } from '@angular/core'; import { EntryTab } from '../../shared/entry/entry-tab'; import { CloudInstance, @@ -122,9 +122,6 @@ export class ExecutionsTabComponent extends EntryTab implements OnInit, OnChange @Input() entry: BioWorkflow | Service | Notebook; @Input() version: WorkflowVersion; - @Output() showExecutionIcon = new EventEmitter(); - @Output() showValidationIcon = new EventEmitter(); - constructor( private extendedGA4GHService: ExtendedGA4GHService, private alertService: AlertService, @@ -208,10 +205,6 @@ export class ExecutionsTabComponent extends EntryTab implements OnInit, OnChange const metrics = this.metrics.get(partner); this.executionMetricsExist = metrics?.executionStatusCount !== null; - if (this.executionMetricsExist) { - this.showExecutionIcon.emit(true); - } - if (metrics?.executionStatusCount) { this.executionStatusToMetrics = new Map(Object.entries(metrics.executionStatusCount.count)); @@ -291,7 +284,6 @@ export class ExecutionsTabComponent extends EntryTab implements OnInit, OnChange if (this.validatorToolMetricsExist) { this.validatorToolToValidatorInfo = new Map(Object.entries(this.metrics.get(partner).validationStatus.validatorTools)); this.validatorTools = Array.from(this.validatorToolToValidatorInfo.keys()); - this.showValidationIcon.emit(true); if (this.validatorTools.length > 0) { this.onSelectedValidatorToolChange(this.validatorTools[0]); diff --git a/src/app/workflow/versions/versions-datasource.ts b/src/app/workflow/versions/versions-datasource.ts index 47ce04f55..d9f763f67 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 2a835e33c..3811fd095 100644 --- a/src/app/workflow/versions/versions.component.html +++ b/src/app/workflow/versions/versions.component.html @@ -218,14 +218,14 @@ 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 01084a815..bf8d6b8aa 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,8 +83,6 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha @Input() workflowId: number; @Input() verifiedVersionPlatforms: Array; @Input() publicPage: boolean; - @Input() hasExecutionMetrics!: boolean; - @Input() hasValidationMetrics!: boolean; _selectedVersion: WorkflowVersion; Dockstore = Dockstore; @@ -248,4 +247,21 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha trackBy(index: number, item: WorkflowVersion) { return item.id; } + + showExecutionMetricsIcon(version: WorkflowVersion) { + if (version.metricsByPlatform !== null) { + const metrics = version.metricsByPlatform[PartnerEnum.ALL]; + return metrics?.executionStatusCount != null; + } + return false; + } + + showValidationMetricsIcon(version: WorkflowVersion) { + if (version.metricsByPlatform !== null) { + const metrics = version.metricsByPlatform[PartnerEnum.ALL]; + console.log(metrics?.validationStatus); + return metrics?.validationStatus != null; + } + return false; + } } diff --git a/src/app/workflow/workflow.component.html b/src/app/workflow/workflow.component.html index 890fe7960..972154f9b 100644 --- a/src/app/workflow/workflow.component.html +++ b/src/app/workflow/workflow.component.html @@ -343,8 +343,6 @@

[canRead]="canRead" [canWrite]="canWrite" [isOwner]="isOwner" - [hasExecutionMetrics]="hasExecutionMetrics" - [hasValidationMetrics]="hasValidationMetrics" > @@ -458,12 +456,7 @@

- + @@ -521,20 +514,6 @@

- Execution Metrics Icon - Validation Metrics Icon {{ sortedVersion.last_modified | date }} diff --git a/src/app/workflow/workflow.component.ts b/src/app/workflow/workflow.component.ts index ecb286ca3..2d566ba5a 100644 --- a/src/app/workflow/workflow.component.ts +++ b/src/app/workflow/workflow.component.ts @@ -208,9 +208,6 @@ export class WorkflowComponent extends Entry implements AfterVi public selectedVersionDoi: Doi | undefined; public selectedConceptDoi: Doi | undefined; - public hasExecutionMetrics: boolean = false; - public hasValidationMetrics: boolean = false; - @Input() user; @Input() selectedVersion: WorkflowVersion; @Input() shouldClearState: boolean = true; @@ -561,14 +558,6 @@ export class WorkflowComponent extends Entry implements AfterVi }); } - showExecutionMetricsIcon(showExecutionMetricsIcon: boolean) { - this.hasExecutionMetrics = showExecutionMetricsIcon; - } - - showValidationMetricsIcon(showValidationMetricsIcon: boolean) { - this.hasValidationMetrics = showValidationMetricsIcon; - } - resetWorkflowEditData() { const labelArray = this.dockstoreService.getLabelStrings(this.workflow.labels); const workflowLabels = labelArray; From 3abbb6cff00a1f9286367f78356896c22ae06427 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 12 Dec 2024 15:30:48 -0500 Subject: [PATCH 05/16] review feedback --- src/app/workflow/versions/versions.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/workflow/versions/versions.component.ts b/src/app/workflow/versions/versions.component.ts index bf8d6b8aa..5ad412ffc 100644 --- a/src/app/workflow/versions/versions.component.ts +++ b/src/app/workflow/versions/versions.component.ts @@ -259,7 +259,6 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha showValidationMetricsIcon(version: WorkflowVersion) { if (version.metricsByPlatform !== null) { const metrics = version.metricsByPlatform[PartnerEnum.ALL]; - console.log(metrics?.validationStatus); return metrics?.validationStatus != null; } return false; From 3df9e115a7f91a3684238e96426027eb0d8d3111 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 12 Dec 2024 17:20:38 -0500 Subject: [PATCH 06/16] review feedback --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 14707abd8..c29c40472 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "2.13.0", "license": "Apache License 2.0", "config": { - "webservice_version_prefix": "1.17.0", + "webservice_version_prefix": "1.17.0-feature-seab-6341", "webservice_version": "1.17.0", "use_snapshot": true }, From 3a72977a5d188c690cb4b8cac8802fff5f2be871 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 12 Dec 2024 17:20:47 -0500 Subject: [PATCH 07/16] review feedback --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c29c40472..7877dd756 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "config": { "webservice_version_prefix": "1.17.0-feature-seab-6341", "webservice_version": "1.17.0", - "use_snapshot": true + "use_snapshot": false }, "scripts": { "ng": "npx ng", From 1340bb82a7324d370da9a64b7b417f0f89b0c6fb Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 12 Dec 2024 17:37:07 -0500 Subject: [PATCH 08/16] review feedback --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7877dd756..c29c40472 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "config": { "webservice_version_prefix": "1.17.0-feature-seab-6341", "webservice_version": "1.17.0", - "use_snapshot": false + "use_snapshot": true }, "scripts": { "ng": "npx ng", From d653a036ec1b408d69d03526e01f0b262f5bd466 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Tue, 7 Jan 2025 10:05:12 -0500 Subject: [PATCH 09/16] review feedback --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c29c40472..14707abd8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "2.13.0", "license": "Apache License 2.0", "config": { - "webservice_version_prefix": "1.17.0-feature-seab-6341", + "webservice_version_prefix": "1.17.0", "webservice_version": "1.17.0", "use_snapshot": true }, From e525358b837a8c4db856a5621e543da205aecc93 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Tue, 7 Jan 2025 12:44:04 -0500 Subject: [PATCH 10/16] review feedback --- cypress/e2e/group2/myworkflows.ts | 6 +++--- src/app/workflow/versions/versions.component.html | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/group2/myworkflows.ts b/cypress/e2e/group2/myworkflows.ts index 5c12545bd..bdf6e5c72 100644 --- a/cypress/e2e/group2/myworkflows.ts +++ b/cypress/e2e/group2/myworkflows.ts @@ -434,7 +434,7 @@ describe('Dockstore my workflows part 2', () => { cy.get('[data-cy=export-button').click(); cy.fixture('versionWithDoi.json').then((json) => { - cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc&include=metrics', { body: json, statusCode: 200, }).as('getVersionWithDoi'); @@ -453,7 +453,7 @@ describe('Dockstore my workflows part 2', () => { cy.get('[data-cy=export-button').should('be.enabled'); cy.get('[data-cy=export-button').click(); cy.fixture('versionAfterOrcidExport.json').then((json) => { - cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc&include=metrics', { body: json, statusCode: 200, }).as('getVersionAfterOrcidExport'); @@ -525,7 +525,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/src/app/workflow/versions/versions.component.html b/src/app/workflow/versions/versions.component.html index 3811fd095..ff1590d8a 100644 --- a/src/app/workflow/versions/versions.component.html +++ b/src/app/workflow/versions/versions.component.html @@ -221,12 +221,14 @@ *ngIf="showExecutionMetricsIcon(version)" src="../assets/svg/execution-icon.svg" alt="Execution Metrics Icon" + data-cy="execution-metrics-icon" matTooltip="This version contains execution metrics." /> Validation Metrics Icon From 4d81c3d7ca6d52ba41b45b27fc591ddbb2da08b1 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Tue, 7 Jan 2025 13:20:03 -0500 Subject: [PATCH 11/16] review feedback --- src/assets/svg/execution-icon.svg | 1 + src/assets/svg/validation-icon.svg | 1 + 2 files changed, 2 insertions(+) create mode 100644 src/assets/svg/execution-icon.svg create mode 100644 src/assets/svg/validation-icon.svg diff --git a/src/assets/svg/execution-icon.svg b/src/assets/svg/execution-icon.svg new file mode 100644 index 000000000..195314edb --- /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 000000000..d4867f3bb --- /dev/null +++ b/src/assets/svg/validation-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file From eca88d495dc041b1f63f7fb83c197eff4764445a Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Wed, 8 Jan 2025 12:14:11 -0500 Subject: [PATCH 12/16] review feedback --- cypress/e2e/group2/myworkflows.ts | 4 ++-- cypress/e2e/group3/metrics.ts | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/group2/myworkflows.ts b/cypress/e2e/group2/myworkflows.ts index 0df7d9935..14872666b 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&sortCol=lastModified&sortOrder=desc&include=metrics', { + 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&sortCol=lastModified&sortOrder=desc&include=metrics', { + cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc&include=metrics', { body: json, statusCode: 200, }).as('getVersionAfterOrcidExport'); diff --git a/cypress/e2e/group3/metrics.ts b/cypress/e2e/group3/metrics.ts index ba1b4d68a..677db2098 100644 --- a/cypress/e2e/group3/metrics.ts +++ b/cypress/e2e/group3/metrics.ts @@ -22,6 +22,13 @@ 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'); From 289233eee77aaab87198bc02bffbf8df8bb4dca8 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Wed, 8 Jan 2025 12:14:41 -0500 Subject: [PATCH 13/16] review feedback --- cypress/fixtures/versionWithMetrics.json | 541 +++++++++++++++++++++++ 1 file changed, 541 insertions(+) create mode 100644 cypress/fixtures/versionWithMetrics.json diff --git a/cypress/fixtures/versionWithMetrics.json b/cypress/fixtures/versionWithMetrics.json new file mode 100644 index 000000000..cd9bd7202 --- /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": "" + } +] From 1703b282848061fcd3653d688086e8ad76ec7678 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Wed, 8 Jan 2025 14:59:54 -0500 Subject: [PATCH 14/16] review feedback --- cypress/e2e/group2/myworkflows.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/group2/myworkflows.ts b/cypress/e2e/group2/myworkflows.ts index 14872666b..458c18328 100644 --- a/cypress/e2e/group2/myworkflows.ts +++ b/cypress/e2e/group2/myworkflows.ts @@ -456,7 +456,10 @@ 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(); + + goToTab('Versions'); + cy.wait(1000); + cy.get('td').contains('Actions').click(); cy.get('[data-cy=dockstore-export-orcid-button]').should('not.exist'); // Should not be able to export to ORCID again }); }); From 993fe2c4e1db52490ba61a35808a9b4f4eedb393 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 9 Jan 2025 16:57:51 -0500 Subject: [PATCH 15/16] review feedback --- cypress/e2e/group2/myworkflows.ts | 4 +- cypress/fixtures/versionAfterOrcidExport.json | 64 ++++++++++++++----- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/cypress/e2e/group2/myworkflows.ts b/cypress/e2e/group2/myworkflows.ts index 458c18328..808d0ce93 100644 --- a/cypress/e2e/group2/myworkflows.ts +++ b/cypress/e2e/group2/myworkflows.ts @@ -457,9 +457,7 @@ describe('Dockstore my workflows part 2', () => { cy.get('[data-cy=export-button').should('be.enabled'); cy.get('[data-cy=export-button').click(); - goToTab('Versions'); - cy.wait(1000); - cy.get('td').contains('Actions').click(); + gotoVersionsAndClickActions(); cy.get('[data-cy=dockstore-export-orcid-button]').should('not.exist'); // Should not be able to export to ORCID again }); }); diff --git a/cypress/fixtures/versionAfterOrcidExport.json b/cypress/fixtures/versionAfterOrcidExport.json index 914d2346e..84e66a439 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", From bc2ceaa7be61863c84b903696c63ad5e0e3fec6f Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Mon, 13 Jan 2025 14:41:25 -0500 Subject: [PATCH 16/16] review feedback --- .../workflow/versions/versions.component.html | 4 ++-- src/app/workflow/versions/versions.component.ts | 17 +---------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/app/workflow/versions/versions.component.html b/src/app/workflow/versions/versions.component.html index fab13dc24..69809c4f5 100644 --- a/src/app/workflow/versions/versions.component.html +++ b/src/app/workflow/versions/versions.component.html @@ -211,14 +211,14 @@ Execution Metrics Icon Validation Metrics Icon; public pageIndex$: Observable; public versionsLength$: Observable; + protected readonly PartnerEnum = PartnerEnum; private sortCol: string; setNoOrderCols(): Array { @@ -247,20 +248,4 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha trackBy(index: number, item: WorkflowVersion) { return item.id; } - - showExecutionMetricsIcon(version: WorkflowVersion) { - if (version.metricsByPlatform !== null) { - const metrics = version.metricsByPlatform[PartnerEnum.ALL]; - return metrics?.executionStatusCount != null; - } - return false; - } - - showValidationMetricsIcon(version: WorkflowVersion) { - if (version.metricsByPlatform !== null) { - const metrics = version.metricsByPlatform[PartnerEnum.ALL]; - return metrics?.validationStatus != null; - } - return false; - } }