diff --git a/backend/src/main/java/heartbeat/controller/pipeline/dto/request/DeploymentEnvironment.java b/backend/src/main/java/heartbeat/controller/pipeline/dto/request/DeploymentEnvironment.java index db4101b7a..f9d567168 100644 --- a/backend/src/main/java/heartbeat/controller/pipeline/dto/request/DeploymentEnvironment.java +++ b/backend/src/main/java/heartbeat/controller/pipeline/dto/request/DeploymentEnvironment.java @@ -24,6 +24,8 @@ public class DeploymentEnvironment { private String step; + private String repoName; + @Nullable private String repository; diff --git a/backend/src/main/java/heartbeat/service/report/PipelineService.java b/backend/src/main/java/heartbeat/service/report/PipelineService.java index 83d8529cf..0245026a4 100644 --- a/backend/src/main/java/heartbeat/service/report/PipelineService.java +++ b/backend/src/main/java/heartbeat/service/report/PipelineService.java @@ -96,6 +96,7 @@ private PipelineCSVInfo getPipelineCSVInfo(String startTime, String endTime, return PipelineCSVInfo.builder() .organizationName(deploymentEnvironment.getOrgName()) + .repoName(deploymentEnvironment.getRepoName()) .pipeLineName(deploymentEnvironment.getName()) .stepName(deployInfo.getJobName()) .valid(deployInfo.getJobName().equals(deploymentEnvironment.getStep())) diff --git a/frontend/__tests__/containers/ReportStep/ReportStep.test.tsx b/frontend/__tests__/containers/ReportStep/ReportStep.test.tsx index 80b530493..1f914a1d4 100644 --- a/frontend/__tests__/containers/ReportStep/ReportStep.test.tsx +++ b/frontend/__tests__/containers/ReportStep/ReportStep.test.tsx @@ -34,6 +34,7 @@ import { updateDateRange, updateJiraVerifyResponse, updateMetrics, + updatePipelineTool, updatePipelineToolVerifyResponse, } from '@src/context/config/configSlice'; import { act, render, renderHook, screen, waitFor, within } from '@testing-library/react'; @@ -230,6 +231,24 @@ describe('Report Step', () => { expect(screen.getByText('Pipeline Mean Time To Recovery')).toBeInTheDocument(); }); + it('should call startToRequestData with no pipeline settings when pipeline configuration select Other', () => { + store.dispatch( + updatePipelineTool({ + type: 'Other', + token: '', + }), + ); + setup([LEAD_TIME_FOR_CHANGES], [emptyValueDateRange]); + + expect(useGenerateReportEffect().startToRequestData).toBeCalledWith( + expect.objectContaining({ + buildKiteSetting: expect.objectContaining({ + deploymentEnvList: [], + }), + }), + ); + }); + it('should render loading page when report data is empty', () => { setup(REQUIRED_DATA_LIST, [emptyValueDateRange]); diff --git a/frontend/__tests__/fixtures.ts b/frontend/__tests__/fixtures.ts index 5468e6833..47fdf1288 100644 --- a/frontend/__tests__/fixtures.ts +++ b/frontend/__tests__/fixtures.ts @@ -200,6 +200,7 @@ export const MOCK_GENERATE_REPORT_REQUEST_PARAMS: ReportRequestDTO = { name: 'mockPipelineName', orgId: 'mockOrgId', orgName: 'mockOrgName', + repoName: 'mockRepoName', repository: 'mockRep', step: 'step', branches: [], diff --git a/frontend/e2e/fixtures/create-new/pipeline-20240812-20240818.csv b/frontend/e2e/fixtures/create-new/pipeline-20240812-20240818.csv index 920fa8a0c..7c07521e6 100644 --- a/frontend/e2e/fixtures/create-new/pipeline-20240812-20240818.csv +++ b/frontend/e2e/fixtures/create-new/pipeline-20240812-20240818.csv @@ -1,11 +1,11 @@ "Organization","Pipeline Name","Repo Name","Pipeline Step","Valid","Build Number","Pull Number","Code Committer","Build Creator","First Code Committed Time In PR","PR Created Time","PR Merged Time","No PR Committed Time","Job Start Time","Pipeline Start Time","Pipeline Finish Time","Non-Workdays (Hours)","Total Lead Time (HH:mm:ss)","PR Lead Time (HH:mm:ss)","Pipeline Lead Time (HH:mm:ss)","Status","Branch","Revert" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4185","1579","zhou-yinyuan",,"2024-08-16T09:34:03Z","2024-08-16T09:34:35Z","2024-08-16T09:42:39Z",,"2024-08-16T10:05:48Z","2024-08-16T09:42:39Z","2024-08-16T10:06:16.456Z","0","0:32:13","0:8:36","0:23:37","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4183","1578","zhou-yinyuan",,"2024-08-16T09:11:02Z","2024-08-16T09:11:32Z","2024-08-16T09:16:37Z",,"2024-08-16T09:40:33Z","2024-08-16T09:16:37Z","2024-08-16T09:41:01.451Z","0","0:29:59","0:5:35","0:24:24","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4181","1577","zhou-yinyuan","heartbeat-user","2024-08-15T07:40:45Z","2024-08-15T07:41:18Z","2024-08-16T03:27:54Z",,"2024-08-16T03:50:27Z","2024-08-16T03:27:54Z","2024-08-16T03:50:58.880Z","0","20:10:13","19:47:9","0:23:4","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4175",,"guzhongren",,,,,,,,"2024-08-15T00:54:47.563Z","0",,,,"passed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4173","1576","zhou-yinyuan",,"2024-08-14T07:07:54Z","2024-08-14T09:21:18Z","2024-08-14T09:29:12Z",,"2024-08-14T09:52:23Z","2024-08-14T09:29:12Z","2024-08-14T09:52:49.797Z","0","2:44:55","2:21:18","0:23:37","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4170","1575","zhou-yinyuan",,"2024-08-14T07:07:54Z","2024-08-14T07:08:40Z","2024-08-14T07:13:45Z",,"2024-08-14T07:37:14Z","2024-08-14T07:13:45Z","2024-08-14T07:37:42.686Z","0","0:29:48","0:5:51","0:23:57","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4168","1574","zhou-yinyuan",,"2024-08-14T02:18:08Z","2024-08-14T02:18:46Z","2024-08-14T02:25:41Z",,"2024-08-14T02:51:00Z","2024-08-14T02:25:41Z","2024-08-14T02:51:29.410Z","0","0:33:21","0:7:33","0:25:48","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4165","1573","zhou-yinyuan",,"2024-08-12T02:58:15Z","2024-08-13T06:09:53Z","2024-08-13T07:00:49Z",,"2024-08-13T07:28:33Z","2024-08-13T07:00:49Z","2024-08-13T07:29:05.011Z","0","28:30:50","28:2:34","0:28:16","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4162","1572","zhou-yinyuan",,"2024-08-12T02:58:15Z","2024-08-12T02:59:01Z","2024-08-13T05:56:53Z",,"2024-08-13T06:24:55Z","2024-08-13T05:56:53Z","2024-08-13T06:25:32.138Z","0","27:27:17","26:58:38","0:28:39","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4153","1571","zhou-yinyuan",,"2024-08-09T03:54:06Z","2024-08-09T07:16:19Z","2024-08-12T01:08:39Z",,"2024-08-12T01:36:41Z","2024-08-12T01:08:39Z","2024-08-12T01:37:13.163Z","48","21:43:7","21:14:33","0:28:34","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4185","1579","zhou-yinyuan",,"2024-08-16T09:34:03Z","2024-08-16T09:34:35Z","2024-08-16T09:42:39Z",,"2024-08-16T10:05:48Z","2024-08-16T09:42:39Z","2024-08-16T10:06:16.456Z","0","0:32:13","0:8:36","0:23:37","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4183","1578","zhou-yinyuan",,"2024-08-16T09:11:02Z","2024-08-16T09:11:32Z","2024-08-16T09:16:37Z",,"2024-08-16T09:40:33Z","2024-08-16T09:16:37Z","2024-08-16T09:41:01.451Z","0","0:29:59","0:5:35","0:24:24","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4181","1577","zhou-yinyuan","heartbeat-user","2024-08-15T07:40:45Z","2024-08-15T07:41:18Z","2024-08-16T03:27:54Z",,"2024-08-16T03:50:27Z","2024-08-16T03:27:54Z","2024-08-16T03:50:58.880Z","0","20:10:13","19:47:9","0:23:4","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4175",,"guzhongren",,,,,,,,"2024-08-15T00:54:47.563Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4173","1576","zhou-yinyuan",,"2024-08-14T07:07:54Z","2024-08-14T09:21:18Z","2024-08-14T09:29:12Z",,"2024-08-14T09:52:23Z","2024-08-14T09:29:12Z","2024-08-14T09:52:49.797Z","0","2:44:55","2:21:18","0:23:37","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4170","1575","zhou-yinyuan",,"2024-08-14T07:07:54Z","2024-08-14T07:08:40Z","2024-08-14T07:13:45Z",,"2024-08-14T07:37:14Z","2024-08-14T07:13:45Z","2024-08-14T07:37:42.686Z","0","0:29:48","0:5:51","0:23:57","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4168","1574","zhou-yinyuan",,"2024-08-14T02:18:08Z","2024-08-14T02:18:46Z","2024-08-14T02:25:41Z",,"2024-08-14T02:51:00Z","2024-08-14T02:25:41Z","2024-08-14T02:51:29.410Z","0","0:33:21","0:7:33","0:25:48","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4165","1573","zhou-yinyuan",,"2024-08-12T02:58:15Z","2024-08-13T06:09:53Z","2024-08-13T07:00:49Z",,"2024-08-13T07:28:33Z","2024-08-13T07:00:49Z","2024-08-13T07:29:05.011Z","0","28:30:50","28:2:34","0:28:16","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4162","1572","zhou-yinyuan",,"2024-08-12T02:58:15Z","2024-08-12T02:59:01Z","2024-08-13T05:56:53Z",,"2024-08-13T06:24:55Z","2024-08-13T05:56:53Z","2024-08-13T06:25:32.138Z","0","27:27:17","26:58:38","0:28:39","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4153","1571","zhou-yinyuan",,"2024-08-09T03:54:06Z","2024-08-09T07:16:19Z","2024-08-12T01:08:39Z",,"2024-08-12T01:36:41Z","2024-08-12T01:08:39Z","2024-08-12T01:37:13.163Z","48","21:43:7","21:14:33","0:28:34","passed","main","false" diff --git a/frontend/e2e/fixtures/create-new/pipeline-20240819-20240825.csv b/frontend/e2e/fixtures/create-new/pipeline-20240819-20240825.csv index 927d4a722..285c31666 100644 --- a/frontend/e2e/fixtures/create-new/pipeline-20240819-20240825.csv +++ b/frontend/e2e/fixtures/create-new/pipeline-20240819-20240825.csv @@ -1,7 +1,7 @@ "Organization","Pipeline Name","Repo Name","Pipeline Step","Valid","Build Number","Pull Number","Code Committer","Build Creator","First Code Committed Time In PR","PR Created Time","PR Merged Time","No PR Committed Time","Job Start Time","Pipeline Start Time","Pipeline Finish Time","Non-Workdays (Hours)","Total Lead Time (HH:mm:ss)","PR Lead Time (HH:mm:ss)","Pipeline Lead Time (HH:mm:ss)","Status","Branch","Revert" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy e2e","false","4224",,"zhou-yinyuan","heartbeat-user",,,,,,,"2024-08-25T00:50:29.642Z","0",,,,"passed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4221",,"Unknown","heartbeat-user",,,,,,,"2024-08-25T00:49:05.117Z","0",,,,"failed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4207",,"zhou-yinyuan",,,,,,,,"2024-08-21T09:48:48.575Z","0",,,,"passed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4201","1583","zhou-yinyuan",,"2024-08-21T03:04:10Z","2024-08-21T03:04:36Z","2024-08-21T03:16:16Z",,"2024-08-21T03:39:02Z","2024-08-21T03:16:16Z","2024-08-21T03:39:31.606Z","0","0:35:21","0:12:6","0:23:15","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4197","1582","zhou-yinyuan",,"2024-08-20T01:58:55Z","2024-08-20T01:59:41Z","2024-08-20T09:34:31Z",,"2024-08-20T10:02:47Z","2024-08-20T09:34:31Z","2024-08-20T10:03:29.671Z","0","8:4:34","7:35:36","0:28:58","passed","main","false" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4188",,"renovate[bot]",,,,,,,,"2024-08-20T00:53:29.705Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy e2e","false","4224",,"zhou-yinyuan","heartbeat-user",,,,,,,"2024-08-25T00:50:29.642Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4221",,"Unknown","heartbeat-user",,,,,,,"2024-08-25T00:49:05.117Z","0",,,,"failed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4207",,"zhou-yinyuan",,,,,,,,"2024-08-21T09:48:48.575Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4201","1583","zhou-yinyuan",,"2024-08-21T03:04:10Z","2024-08-21T03:04:36Z","2024-08-21T03:16:16Z",,"2024-08-21T03:39:02Z","2024-08-21T03:16:16Z","2024-08-21T03:39:31.606Z","0","0:35:21","0:12:6","0:23:15","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4197","1582","zhou-yinyuan",,"2024-08-20T01:58:55Z","2024-08-20T01:59:41Z","2024-08-20T09:34:31Z",,"2024-08-20T10:02:47Z","2024-08-20T09:34:31Z","2024-08-20T10:03:29.671Z","0","8:4:34","7:35:36","0:28:58","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4188",,"renovate[bot]",,,,,,,,"2024-08-20T00:53:29.705Z","0",,,,"passed","main","" diff --git a/frontend/e2e/fixtures/create-new/pipeline-20240826-20240902.csv b/frontend/e2e/fixtures/create-new/pipeline-20240826-20240902.csv index ad175ab45..6a2a80daf 100644 --- a/frontend/e2e/fixtures/create-new/pipeline-20240826-20240902.csv +++ b/frontend/e2e/fixtures/create-new/pipeline-20240826-20240902.csv @@ -1,6 +1,6 @@ "Organization","Pipeline Name","Repo Name","Pipeline Step","Valid","Build Number","Pull Number","Code Committer","Build Creator","First Code Committed Time In PR","PR Created Time","PR Merged Time","No PR Committed Time","Job Start Time","Pipeline Start Time","Pipeline Finish Time","Non-Workdays (Hours)","Total Lead Time (HH:mm:ss)","PR Lead Time (HH:mm:ss)","Pipeline Lead Time (HH:mm:ss)","Status","Branch","Revert" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4259",,"renovate[bot]",,,,,,,,"2024-08-30T10:17:49.663Z","0",,,,"passed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4255",,"renovate[bot]",,,,,,,,"2024-08-30T09:10:56.484Z","0",,,,"passed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4249",,"guzhongren",,,,,,,,"2024-08-29T11:34:06.071Z","0",,,,"passed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Run e2e","false","4240",,"Zhongren GU","heartbeat-user",,,,,,,"2024-08-27T15:40:47.556Z","0",,,,"passed","main","" -"Heartbeat-backup","Heartbeat",,":rocket: Deploy prod","true","4230","1589","zhou-yinyuan",,"2024-08-26T01:56:02Z","2024-08-26T01:56:46Z","2024-08-26T02:02:59Z",,"2024-08-26T02:26:28Z","2024-08-26T02:02:59Z","2024-08-26T02:26:56.722Z","0","0:30:54","0:6:57","0:23:57","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4259",,"renovate[bot]",,,,,,,,"2024-08-30T10:17:49.663Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4255",,"renovate[bot]",,,,,,,,"2024-08-30T09:10:56.484Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4249",,"guzhongren",,,,,,,,"2024-08-29T11:34:06.071Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4240",,"Zhongren GU","heartbeat-user",,,,,,,"2024-08-27T15:40:47.556Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4230","1589","zhou-yinyuan",,"2024-08-26T01:56:02Z","2024-08-26T01:56:46Z","2024-08-26T02:02:59Z",,"2024-08-26T02:26:28Z","2024-08-26T02:02:59Z","2024-08-26T02:26:56.722Z","0","0:30:54","0:6:57","0:23:57","passed","main","false" diff --git a/frontend/e2e/fixtures/create-new/report-result.ts b/frontend/e2e/fixtures/create-new/report-result.ts index 3469474a0..db4b60e89 100644 --- a/frontend/e2e/fixtures/create-new/report-result.ts +++ b/frontend/e2e/fixtures/create-new/report-result.ts @@ -9,9 +9,9 @@ export interface IBoardMetricsResult { reworkThroughput: string; } export interface IDoraMetricsResultItem { - prLeadTime: string; - pipelineLeadTime: string; - totalLeadTime: string; + prLeadTime: string | string[]; + pipelineLeadTime: string | string[]; + totalLeadTime: string | string[]; deploymentTimes?: string; deploymentFrequency?: string; failureRate?: string; @@ -821,6 +821,48 @@ export const DORA_METRICS_RESULT_FOR_SOURCE_CONTROL: IDoraMetricsResultItem[] = }, ]; +export const DORA_METRICS_RESULT_WITH_PIPELINE_AND_SOURCE_CONTROL: IDoraMetricsResultItem[] = [ + { + prLeadTime: '2.33', + pipelineLeadTime: '0.20', + totalLeadTime: '2.53', + deploymentFrequency: '0.60', + deploymentTimes: '6', + failureRate: '14.29% (1/7)', + pipelineMeanTimeToRecovery: '25.63', + }, + { + prLeadTime: '29.05', + pipelineLeadTime: '0.22', + totalLeadTime: '29.28', + deploymentFrequency: '2.00', + deploymentTimes: '20', + failureRate: '9.09% (2/22)', + pipelineMeanTimeToRecovery: '1.10', + }, +]; + +export const DORA_METRICS_RESULT_WITH_PIPELINE_AND_SOURCE_CONTROL_DETAIL: IDoraMetricsResultItem[] = [ + { + prLeadTime: ['4.66', '0.00', '2.33'], + pipelineLeadTime: ['0.41', '0.00', '0.20'], + totalLeadTime: ['5.06', '0.00', '2.53'], + deploymentFrequency: '0.60', + deploymentTimes: '6', + failureRate: '14.29% (1/7)', + pipelineMeanTimeToRecovery: '25.63', + }, + { + prLeadTime: ['12.96', '45.14', '29.05'], + pipelineLeadTime: ['0.45', '0.00', '0.22'], + totalLeadTime: ['13.41', '45.14', '29.28'], + deploymentFrequency: '2.00', + deploymentTimes: '20', + failureRate: '9.09% (2/22)', + pipelineMeanTimeToRecovery: '1.10', + }, +]; + export const CYCLE_TIME_WITH_ANALYSIS_STATUS_PROJECT_BOARD_METRICS_RESULT: IBoardMetricsResult = { velocity: '8', throughput: '3', diff --git a/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-metric-20240801-20240814.csv b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-metric-20240801-20240814.csv new file mode 100644 index 000000000..2d5d43036 --- /dev/null +++ b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-metric-20240801-20240814.csv @@ -0,0 +1,14 @@ +"Group","Metrics","Value" +"Deployment frequency","Heartbeat / Deploy prod / Deployment frequency(Deployments/Day)","2.00" +"Deployment frequency","Heartbeat / Deploy prod / Deployment frequency(Deployment times)","20" +"Lead time for changes","Heartbeat / Deploy prod / PR Lead Time","12.96" +"Lead time for changes","Heartbeat / Deploy prod / Pipeline Lead Time","0.45" +"Lead time for changes","Heartbeat / Deploy prod / Total Lead Time","13.41" +"Lead time for changes","MYOB-Technology / AD-Framework / PR Lead Time","45.14" +"Lead time for changes","MYOB-Technology / AD-Framework / Pipeline Lead Time","0" +"Lead time for changes","MYOB-Technology / AD-Framework / Total Lead Time","45.14" +"Lead time for changes","Average / PR Lead Time","29.05" +"Lead time for changes","Average / Pipeline Lead Time","0.22" +"Lead time for changes","Average / Total Lead Time","29.28" +"Pipeline change failure rate","Heartbeat / Deploy prod / Pipeline change failure rate(%)","9.09" +"Pipeline mean time to recovery","Heartbeat / Deploy prod / Pipeline mean time to recovery","1.10" diff --git a/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-metric-20240815-20240828.csv b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-metric-20240815-20240828.csv new file mode 100644 index 000000000..782b77276 --- /dev/null +++ b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-metric-20240815-20240828.csv @@ -0,0 +1,14 @@ +"Group","Metrics","Value" +"Deployment frequency","Heartbeat / Deploy prod / Deployment frequency(Deployments/Day)","0.60" +"Deployment frequency","Heartbeat / Deploy prod / Deployment frequency(Deployment times)","6" +"Lead time for changes","Heartbeat / Deploy prod / PR Lead Time","4.66" +"Lead time for changes","Heartbeat / Deploy prod / Pipeline Lead Time","0.41" +"Lead time for changes","Heartbeat / Deploy prod / Total Lead Time","5.06" +"Lead time for changes","MYOB-Technology / AD-Framework / PR Lead Time","0" +"Lead time for changes","MYOB-Technology / AD-Framework / Pipeline Lead Time","0" +"Lead time for changes","MYOB-Technology / AD-Framework / Total Lead Time","0" +"Lead time for changes","Average / PR Lead Time","2.33" +"Lead time for changes","Average / Pipeline Lead Time","0.20" +"Lead time for changes","Average / Total Lead Time","2.53" +"Pipeline change failure rate","Heartbeat / Deploy prod / Pipeline change failure rate(%)","14.29" +"Pipeline mean time to recovery","Heartbeat / Deploy prod / Pipeline mean time to recovery","25.63" diff --git a/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-pipeline-20240801-20240814.csv b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-pipeline-20240801-20240814.csv new file mode 100644 index 000000000..e81cf22f4 --- /dev/null +++ b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-pipeline-20240801-20240814.csv @@ -0,0 +1,25 @@ +"Organization","Pipeline Name","Repo Name","Pipeline Step","Valid","Build Number","Pull Number","Code Committer","Build Creator","First Code Committed Time In PR","PR Created Time","PR Merged Time","No PR Committed Time","Job Start Time","Pipeline Start Time","Pipeline Finish Time","Non-Workdays (Hours)","Total Lead Time (HH:mm:ss)","PR Lead Time (HH:mm:ss)","Pipeline Lead Time (HH:mm:ss)","Status","Branch","Revert" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4173","1576","zhou-yinyuan",,"2024-08-14T07:07:54Z","2024-08-14T09:21:18Z","2024-08-14T09:29:12Z",,"2024-08-14T09:52:23Z","2024-08-14T09:29:12Z","2024-08-14T09:52:49.797Z","0","2:44:55","2:21:18","0:23:37","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4170","1575","zhou-yinyuan",,"2024-08-14T07:07:54Z","2024-08-14T07:08:40Z","2024-08-14T07:13:45Z",,"2024-08-14T07:37:14Z","2024-08-14T07:13:45Z","2024-08-14T07:37:42.686Z","0","0:29:48","0:5:51","0:23:57","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4168","1574","zhou-yinyuan",,"2024-08-14T02:18:08Z","2024-08-14T02:18:46Z","2024-08-14T02:25:41Z",,"2024-08-14T02:51:00Z","2024-08-14T02:25:41Z","2024-08-14T02:51:29.410Z","0","0:33:21","0:7:33","0:25:48","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4165","1573","zhou-yinyuan",,"2024-08-12T02:58:15Z","2024-08-13T06:09:53Z","2024-08-13T07:00:49Z",,"2024-08-13T07:28:33Z","2024-08-13T07:00:49Z","2024-08-13T07:29:05.011Z","0","28:30:50","28:2:34","0:28:16","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4162","1572","zhou-yinyuan",,"2024-08-12T02:58:15Z","2024-08-12T02:59:01Z","2024-08-13T05:56:53Z",,"2024-08-13T06:24:55Z","2024-08-13T05:56:53Z","2024-08-13T06:25:32.138Z","0","27:27:17","26:58:38","0:28:39","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4153","1571","zhou-yinyuan",,"2024-08-09T03:54:06Z","2024-08-09T07:16:19Z","2024-08-12T01:08:39Z",,"2024-08-12T01:36:41Z","2024-08-12T01:08:39Z","2024-08-12T01:37:13.163Z","48","21:43:7","21:14:33","0:28:34","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4149","1568","zhou-yinyuan",,"2024-08-07T07:23:20Z","2024-08-07T07:24:09Z","2024-08-09T02:49:23Z",,"2024-08-09T03:19:19Z","2024-08-09T02:49:23Z","2024-08-09T03:19:50.023Z","0","43:56:30","43:26:3","0:30:27","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4142","1570","Unknown","heartbeat-user","2024-08-08T06:15:41Z","2024-08-08T06:16:10Z","2024-08-08T06:22:15Z",,"2024-08-08T07:15:18Z","2024-08-08T06:22:15Z","2024-08-08T07:15:45.521Z","0","1:0:4","0:6:34","0:53:30","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4140","1570","zhou-yinyuan",,"2024-08-08T06:15:41Z","2024-08-08T06:16:10Z","2024-08-08T06:22:15Z",,"2024-08-08T07:15:18Z","2024-08-08T06:22:15Z","2024-08-08T06:46:47.388Z","0","1:0:4","0:6:34","0:53:30","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4134","1569","zhou-yinyuan",,"2024-08-08T02:19:39Z","2024-08-08T02:20:19Z","2024-08-08T02:29:09Z",,"2024-08-08T02:50:46Z","2024-08-08T02:29:09Z","2024-08-08T02:51:13.224Z","0","0:31:34","0:9:30","0:22:4","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4131","1567","zhou-yinyuan",,"2024-08-07T03:08:11Z","2024-08-07T03:08:41Z","2024-08-08T01:33:15Z",,"2024-08-08T01:54:28Z","2024-08-08T01:33:15Z","2024-08-08T01:54:57.059Z","0","22:46:46","22:25:4","0:21:42","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4122","1566","zhou-yinyuan",,"2024-08-06T06:36:42Z","2024-08-06T08:36:38Z","2024-08-06T08:55:35Z",,"2024-08-06T09:22:18Z","2024-08-06T08:55:35Z","2024-08-06T09:22:49.345Z","0","2:46:7","2:18:53","0:27:14","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4118","1565","zhou-yinyuan",,"2024-08-06T06:36:42Z","2024-08-06T07:21:26Z","2024-08-06T07:27:10Z",,"2024-08-06T07:54:12Z","2024-08-06T07:27:10Z","2024-08-06T07:54:42.802Z","0","1:18:0","0:50:28","0:27:32","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4116","1563","zhou-yinyuan",,"2024-08-06T01:58:37Z","2024-08-06T01:59:21Z","2024-08-06T03:56:40Z",,"2024-08-06T04:19:25Z","2024-08-06T03:56:40Z","2024-08-06T04:19:53.911Z","0","2:21:16","1:58:3","0:23:13","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4114","1564","zhou-yinyuan",,"2024-08-05T09:44:51Z","2024-08-06T03:15:14Z","2024-08-06T03:23:45Z",,"2024-08-06T03:50:25Z","2024-08-06T03:23:45Z","2024-08-06T03:50:56.203Z","0","18:6:5","17:38:54","0:27:11","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4110",,"zhou-yinyuan",,,,,,,,"2024-08-06T02:15:42.545Z","0",,,,"failed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4105","1561","Mandy-Tang",,"2024-08-05T03:08:09Z","2024-08-05T03:09:17Z","2024-08-05T03:15:33Z",,"2024-08-05T03:36:57Z","2024-08-05T03:15:33Z","2024-08-05T03:37:27.315Z","0","0:29:18","0:7:24","0:21:54","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4103","1560","Mandy-Tang",,"2024-08-05T01:20:58Z","2024-08-05T01:22:20Z","2024-08-05T01:42:16Z",,"2024-08-05T02:07:46Z","2024-08-05T01:42:16Z","2024-08-05T02:08:14.713Z","0","0:47:16","0:21:18","0:25:58","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4100","1556","Mandy-Tang",,"2024-07-31T14:08:24Z","2024-07-31T14:14:38Z","2024-08-02T08:14:10Z",,"2024-08-02T08:35:37Z","2024-08-02T08:14:10Z","2024-08-02T08:36:05.272Z","0","42:27:41","42:5:46","0:21:55","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4096","1558","zhou-yinyuan",,"2024-08-01T02:52:18Z","2024-08-02T02:10:28Z","2024-08-02T07:07:50Z",,"2024-08-02T07:34:30Z","2024-08-02T07:07:50Z","2024-08-02T07:34:57.092Z","0","28:42:39","28:15:32","0:27:7","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4094","1559","zhou-yinyuan",,"2024-08-01T07:30:10Z","2024-08-02T03:57:34Z","2024-08-02T04:05:48Z",,"2024-08-02T04:27:00Z","2024-08-02T04:05:48Z","2024-08-02T04:27:28.700Z","0","20:57:18","20:35:38","0:21:40","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4089",,"zhou-yinyuan",,,,,,,,"2024-08-02T03:51:09.748Z","0",,,,"failed","main","" +"MYOB-Technology",,"AD-Framework",,,,"594","zhouqiangGroot",,"2024-08-09T07:49:44Z","2024-08-09T08:12:45Z","2024-08-12T09:30:33Z",,,"2024-08-12T09:30:33Z",,"48","25:40:49","25:40:49","0:0:0",,"master","false" +"MYOB-Technology",,"AD-Framework",,,,"592","wangjian-007",,"2024-08-05T09:18:51Z","2024-08-06T05:47:32Z","2024-08-08T01:55:21Z",,,"2024-08-08T01:55:21Z",,"0","64:36:30","64:36:30","0:0:0",,"master","false" diff --git a/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-pipeline-20240815-20240828.csv b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-pipeline-20240815-20240828.csv new file mode 100644 index 000000000..31e98cd3b --- /dev/null +++ b/frontend/e2e/fixtures/create-new/with-pipeline-and-source-control-configuration-pipeline-20240815-20240828.csv @@ -0,0 +1,12 @@ +"Organization","Pipeline Name","Repo Name","Pipeline Step","Valid","Build Number","Pull Number","Code Committer","Build Creator","First Code Committed Time In PR","PR Created Time","PR Merged Time","No PR Committed Time","Job Start Time","Pipeline Start Time","Pipeline Finish Time","Non-Workdays (Hours)","Total Lead Time (HH:mm:ss)","PR Lead Time (HH:mm:ss)","Pipeline Lead Time (HH:mm:ss)","Status","Branch","Revert" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4240",,"Zhongren GU","heartbeat-user",,,,,,,"2024-08-27T15:40:47.556Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4230","1589","zhou-yinyuan",,"2024-08-26T01:56:02Z","2024-08-26T01:56:46Z","2024-08-26T02:02:59Z",,"2024-08-26T02:26:28Z","2024-08-26T02:02:59Z","2024-08-26T02:26:56.722Z","0","0:30:54","0:6:57","0:23:57","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4221",,"Unknown","heartbeat-user",,,,,,,"2024-08-25T00:49:05.117Z","0",,,,"failed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4207",,"zhou-yinyuan",,,,,,,,"2024-08-21T09:48:48.575Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4201","1583","zhou-yinyuan",,"2024-08-21T03:04:10Z","2024-08-21T03:04:36Z","2024-08-21T03:16:16Z",,"2024-08-21T03:39:02Z","2024-08-21T03:16:16Z","2024-08-21T03:39:31.606Z","0","0:35:21","0:12:6","0:23:15","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4197","1582","zhou-yinyuan",,"2024-08-20T01:58:55Z","2024-08-20T01:59:41Z","2024-08-20T09:34:31Z",,"2024-08-20T10:02:47Z","2024-08-20T09:34:31Z","2024-08-20T10:03:29.671Z","0","8:4:34","7:35:36","0:28:58","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4188",,"renovate[bot]",,,,,,,,"2024-08-20T00:53:29.705Z","0",,,,"passed","main","" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4185","1579","zhou-yinyuan",,"2024-08-16T09:34:03Z","2024-08-16T09:34:35Z","2024-08-16T09:42:39Z",,"2024-08-16T10:05:48Z","2024-08-16T09:42:39Z","2024-08-16T10:06:16.456Z","0","0:32:13","0:8:36","0:23:37","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4183","1578","zhou-yinyuan",,"2024-08-16T09:11:02Z","2024-08-16T09:11:32Z","2024-08-16T09:16:37Z",,"2024-08-16T09:40:33Z","2024-08-16T09:16:37Z","2024-08-16T09:41:01.451Z","0","0:29:59","0:5:35","0:24:24","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Deploy prod","true","4181","1577","zhou-yinyuan","heartbeat-user","2024-08-15T07:40:45Z","2024-08-15T07:41:18Z","2024-08-16T03:27:54Z",,"2024-08-16T03:50:27Z","2024-08-16T03:27:54Z","2024-08-16T03:50:58.880Z","0","20:10:13","19:47:9","0:23:4","passed","main","false" +"Heartbeat-backup","Heartbeat","au-heartbeat/Heartbeat",":rocket: Run e2e","false","4175",,"guzhongren",,,,,,,,"2024-08-15T00:54:47.563Z","0",,,,"passed","main","" diff --git a/frontend/e2e/fixtures/import-file/chart-result.ts b/frontend/e2e/fixtures/import-file/chart-result.ts index e210b21b5..c552b064c 100644 --- a/frontend/e2e/fixtures/import-file/chart-result.ts +++ b/frontend/e2e/fixtures/import-file/chart-result.ts @@ -1,6 +1,7 @@ -type DoraChartType = { +export type DoraChartType = { [key: string]: { [key: string]: { + exist: boolean; type: string; color: string; value: string; @@ -37,45 +38,140 @@ export const DORA_CHART_VALUE: DoraChartType = { type: 'trend down', color: '#02C4A8', value: '87.99%', + exist: true, }, 'Deployment Frequency': { type: 'trend down', color: '#E82107', value: '57.50%', + exist: true, }, 'Pipeline Change Failure Rate': { type: 'trend down', color: '#02C4A8', value: '59.99%', + exist: false, }, 'Pipeline Mean Time To Recovery': { type: 'trend down', color: '#02C4A8', value: '22.19%', + exist: false, }, }, 'Heartbeat/ Deploy prod': { 'Lead Time For Changes': { type: 'trend down', color: '#02C4A8', - value: '80.49%', + value: '87.99%', + exist: true, }, 'Deployment Frequency': { type: 'trend down', color: '#E82107', - value: '75.00%', + exist: true, + value: '57.50%', }, 'Pipeline Change Failure Rate': { type: 'trend down', color: '#02C4A8', + exist: false, value: '59.99%', }, 'Pipeline Mean Time To Recovery': { type: 'trend down', color: '#02C4A8', + exist: false, value: '22.19%', }, }, }; export const DORA_CHART_PIPELINES = ['All', 'Heartbeat/ Deploy prod']; + +export const DORA_CHART_VALUE_WITH_PIPELINE_AND_SOURCE_CONTROL: DoraChartType = { + All: { + 'Lead Time For Changes': { + type: 'trend down', + color: '#02C4A8', + value: '91.36%', + exist: true, + }, + 'Deployment Frequency': { + type: 'trend down', + color: '#E82107', + value: '70.00%', + exist: true, + }, + 'Pipeline Change Failure Rate': { + type: 'trend up', + color: '#E82107', + value: '57.21%', + exist: true, + }, + 'Pipeline Mean Time To Recovery': { + type: 'trend up', + color: '#E82107', + value: '2230.00%', + exist: true, + }, + }, + 'Heartbeat/ Deploy prod': { + 'Lead Time For Changes': { + type: 'trend down', + color: '#02C4A8', + value: '62.27%', + exist: true, + }, + 'Deployment Frequency': { + type: 'trend down', + color: '#E82107', + value: '70.00%', + exist: true, + }, + 'Pipeline Change Failure Rate': { + type: 'trend up', + color: '#E82107', + value: '57.21%', + exist: true, + }, + 'Pipeline Mean Time To Recovery': { + type: 'trend up', + color: '#E82107', + value: '2230.00%', + exist: true, + }, + }, + 'MYOB-Technology/AD-Framework': { + 'Lead Time For Changes': { + type: 'trend down', + color: '#02C4A8', + value: '62.27%', + exist: false, + }, + 'Deployment Frequency': { + type: 'trend down', + color: '#E82107', + value: '70.00%', + exist: false, + }, + 'Pipeline Change Failure Rate': { + type: 'trend up', + color: '#E82107', + value: '57.21%', + exist: false, + }, + 'Pipeline Mean Time To Recovery': { + type: 'trend up', + color: '#E82107', + value: '2230.00%', + exist: false, + }, + }, +}; + +export const DORA_CHART_PIPELINES_WITH_PIPELINE_AND_SOURCE_CONTROL = [ + 'All', + 'Heartbeat/ Deploy prod', + 'MYOB-Technology/AD-Framework', +]; diff --git a/frontend/e2e/fixtures/import-file/with-pipeline-and-source-control-configuration-config-file.ts b/frontend/e2e/fixtures/import-file/with-pipeline-and-source-control-configuration-config-file.ts new file mode 100644 index 000000000..704f30e03 --- /dev/null +++ b/frontend/e2e/fixtures/import-file/with-pipeline-and-source-control-configuration-config-file.ts @@ -0,0 +1,24 @@ +export const withPipelineAndSourceControlConfigurationConfig = { + projectName: 'with pipeline and source control configuration', + deployment: [ + { + id: 0, + isStepEmptyString: false, + organization: 'Heartbeat-backup', + pipelineName: 'Heartbeat', + repoName: 'au-heartbeat/Heartbeat', + step: ':rocket: Deploy prod', + branches: ['main'], + }, + ], + pipelineCrews: [], + sourceControlCrews: [], + sourceControlConfigurationSettings: [ + { + id: 1, + organization: 'MYOB-Technology', + repo: 'AD-Framework', + branches: ['master'], + }, + ], +}; diff --git a/frontend/e2e/fixtures/input-files/lead-time-for-changes-with-pipeline-and-source-control-configuration.template.json b/frontend/e2e/fixtures/input-files/lead-time-for-changes-with-pipeline-and-source-control-configuration.template.json new file mode 100644 index 000000000..e6666d90d --- /dev/null +++ b/frontend/e2e/fixtures/input-files/lead-time-for-changes-with-pipeline-and-source-control-configuration.template.json @@ -0,0 +1,54 @@ +{ + "projectName": "with pipeline and source control configuration", + "dateRange": [ + { + "startDate": "2024-08-01T00:00:00.000+08:00", + "endDate": "2024-08-14T23:59:59.999+08:00" + }, + { + "startDate": "2024-08-15T00:00:00.000+08:00", + "endDate": "2024-08-28T23:59:59.999+08:00" + } + ], + "calendarType": "REGULAR", + "metrics": [ + "Lead time for changes", + "Deployment frequency", + "Pipeline change failure rate", + "Pipeline mean time to recovery" + ], + "sortType": "DEFAULT", + "pipelineTool": { + "type": "BuildKite", + "token": "" + }, + "sourceControl": { + "type": "GitHub", + "token": "" + }, + "assigneeFilter": "lastAssignee", + "advancedSettings": null, + "deployment": [ + { + "id": 0, + "isStepEmptyString": true, + "organization": "Heartbeat-backup", + "pipelineName": "Heartbeat", + "step": ":rocket: Deploy prod", + "repoName": "au-heartbeat/Heartbeat", + "branches": ["main"] + } + ], + "sourceControlConfigurationSettings": [ + { + "id": 1, + "organization": "MYOB-Technology", + "repo": "AD-Framework", + "branches": ["master"] + } + ], + "reworkTimesSettings": { + "reworkState": null, + "excludeStates": [] + } +} diff --git a/frontend/e2e/pages/metrics/report-step.ts b/frontend/e2e/pages/metrics/report-step.ts index d3e65b90e..e7b46686d 100644 --- a/frontend/e2e/pages/metrics/report-step.ts +++ b/frontend/e2e/pages/metrics/report-step.ts @@ -4,13 +4,9 @@ import { IBoardCycletimeDetailItem, IBoardClassificationDetailItem, } from '../../fixtures/create-new/report-result'; -import { - ICsvComparedLines, - IDoraMetricsResultItem, - DORA_METRICS_RESULT_MULTIPLE_RANGES, -} from '../../fixtures/create-new/report-result'; +import { ICsvComparedLines, IDoraMetricsResultItem } from '../../fixtures/create-new/report-result'; import { checkDownloadReportCycleTimeByStatus, downloadFileAndCheck } from 'e2e/utils/download'; -import { BOARD_CHART_VALUE, DORA_CHART_VALUE } from '../../fixtures/import-file/chart-result'; +import { BOARD_CHART_VALUE, DoraChartType } from '../../fixtures/import-file/chart-result'; import { DOWNLOAD_EVENTS_WAIT_THRESHOLD } from '../../fixtures/index'; import { expect, Locator, Page, Download } from '@playwright/test'; import { parse } from 'csv-parse/sync'; @@ -100,10 +96,6 @@ export class ReportStep { readonly pipelineChangeFailureRateTrendContainer: Locator; readonly deploymentFrequencyTrendContainer: Locator; readonly leadTimeForChangesTrendContainer: Locator; - readonly pipelineMeanTimeToRecoveryTrendIcon: Locator; - readonly pipelineChangeFailureRateTrendIcon: Locator; - readonly deploymentFrequencyTrendIcon: Locator; - readonly leadTimeForChangesTrendIcon: Locator; readonly classificationIssueTypeChartSwitchIcon: Locator; readonly classificationIssueTypeChartSwitchCardCountModel: Locator; readonly classificationIssueTypeChartSwitchStoryPointsModel: Locator; @@ -234,10 +226,6 @@ export class ReportStep { this.pipelineMeanTimeToRecoveryTrendContainer = this.page.getByLabel( 'pipeline mean time to recovery trend container', ); - this.leadTimeForChangesTrendIcon = this.leadTimeForChangesTrendContainer.getByLabel('trend down'); - this.deploymentFrequencyTrendIcon = this.deploymentFrequencyTrendContainer.getByLabel('trend down'); - this.pipelineChangeFailureRateTrendIcon = this.pipelineChangeFailureRateTrendContainer.getByLabel('trend down'); - this.pipelineMeanTimeToRecoveryTrendIcon = this.pipelineMeanTimeToRecoveryTrendContainer.getByLabel('trend down'); this.leadTimeForChangesExplanationIcon = this.page.getByLabel('lead time for changes explanation'); this.deploymentFrequencyExplanationIcon = this.page.getByLabel('deployment frequency explanation'); @@ -268,6 +256,36 @@ export class ReportStep { } async checkDoraMetricsReportDetails(doraMetricsDetailData: IDoraMetricsResultItem) { + this.checkDoraMetricsReportDetailsWithoutLeadTimeForChanges(doraMetricsDetailData); + + await expect(this.leadTimeForChangesRows.nth(2)).toContainText( + this.combineStrings(['PR Lead Time', doraMetricsDetailData.prLeadTime.toString()]), + ); + await expect(this.leadTimeForChangesRows.nth(3)).toContainText( + this.combineStrings(['Pipeline Lead Time', doraMetricsDetailData.pipelineLeadTime.toString()]), + ); + await expect(this.leadTimeForChangesRows.nth(4)).toContainText( + this.combineStrings(['Total Lead Time', doraMetricsDetailData.totalLeadTime.toString()]), + ); + } + + async checkDoraMetricsReportDetailsWithMultipleLeadTimeForChanges(doraMetricsDetailData: IDoraMetricsResultItem) { + this.checkDoraMetricsReportDetailsWithoutLeadTimeForChanges(doraMetricsDetailData); + const pipelineLength = (doraMetricsDetailData.prLeadTime as string[]).length; + for (let i = 0; i < pipelineLength; i++) { + await expect(this.leadTimeForChangesRows.nth(2 + 4 * i)).toContainText( + this.combineStrings(['PR Lead Time', doraMetricsDetailData.prLeadTime[i]]), + ); + await expect(this.leadTimeForChangesRows.nth(3 + 4 * i)).toContainText( + this.combineStrings(['Pipeline Lead Time', doraMetricsDetailData.pipelineLeadTime[i]]), + ); + await expect(this.leadTimeForChangesRows.nth(4 + 4 * i)).toContainText( + this.combineStrings(['Total Lead Time', doraMetricsDetailData.totalLeadTime[i]]), + ); + } + } + + async checkDoraMetricsReportDetailsWithoutLeadTimeForChanges(doraMetricsDetailData: IDoraMetricsResultItem) { if (doraMetricsDetailData.deploymentFrequency) { await expect(this.deploymentFrequencyRows.getByRole('cell').nth(0)).toContainText('Heartbeat/ Deploy prod'); await expect(this.deploymentFrequencyRows.getByRole('cell').nth(1)).toContainText( @@ -281,16 +299,6 @@ export class ReportStep { ); } - await expect(this.leadTimeForChangesRows.nth(2)).toContainText( - this.combineStrings(['PR Lead Time', doraMetricsDetailData.prLeadTime]), - ); - await expect(this.leadTimeForChangesRows.nth(3)).toContainText( - this.combineStrings(['Pipeline Lead Time', doraMetricsDetailData.pipelineLeadTime]), - ); - await expect(this.leadTimeForChangesRows.nth(4)).toContainText( - this.combineStrings(['Total Lead Time', doraMetricsDetailData.totalLeadTime]), - ); - if (doraMetricsDetailData.failureRate) { await expect(this.pipelineChangeFailureRateRows.getByRole('cell').nth(0)).toContainText('Heartbeat/ Deploy prod'); await expect(this.pipelineChangeFailureRateRows.getByRole('cell').nth(1)).toContainText( @@ -315,6 +323,15 @@ export class ReportStep { } } + async checkDoraMetricsReportDetailsForMultipleRangesWithMultipleLeadTimeForChanges( + doraMetricsReportData: IDoraMetricsResultItem[], + ) { + for (let i = 0; i < doraMetricsReportData.length; i++) { + await this.changeTimeRange(i); + await this.checkDoraMetricsReportDetailsWithMultipleLeadTimeForChanges(doraMetricsReportData[i]); + } + } + async checkDoraMetricsDetailsForMultipleRanges({ projectCreationType, doraMetricsReportData, @@ -331,14 +348,18 @@ export class ReportStep { projectCreationType === ProjectCreationType.IMPORT_PROJECT_FROM_FILE || projectCreationType === ProjectCreationType.CREATE_A_NEW_PROJECT ) { - await this.checkDoraMetricsReportDetailsForMultipleRanges(doraMetricsReportData); + if (Array.isArray(doraMetricsReportData[0].prLeadTime)) { + await this.checkDoraMetricsReportDetailsForMultipleRangesWithMultipleLeadTimeForChanges(doraMetricsReportData); + } else { + await this.checkDoraMetricsReportDetailsForMultipleRanges(doraMetricsReportData); + } } else { throw Error('The board detail type is not correct, please give a correct one.'); } await this.downloadFileAndCheckForMultipleRanges({ trigger: this.exportPipelineDataButton, - rangeCount: DORA_METRICS_RESULT_MULTIPLE_RANGES.length, + rangeCount: doraMetricsReportData.length, fileNamePrefix, }); @@ -894,23 +915,22 @@ export class ReportStep { } async checkChartDoraTabStatus({ + doraChartValue, pipeline, showLeadTimeForChangeChart, showDeploymentFrequencyChart, - showPipelineChangeFailureRateTrendContainer, showPipelineChangeFailureRateChart, showPipelineMeanTimeToRecoveryChart, - showPipelineMeanTimeToRecoveryTrendContainer, }: { + doraChartValue: DoraChartType; pipeline: string; showLeadTimeForChangeChart: boolean; showDeploymentFrequencyChart: boolean; - showPipelineChangeFailureRateTrendContainer: boolean; showPipelineChangeFailureRateChart: boolean; - showPipelineMeanTimeToRecoveryTrendContainer: boolean; showPipelineMeanTimeToRecoveryChart: boolean; }) { - const pipelineDoraChartValue = DORA_CHART_VALUE[pipeline]; + const pipelineDoraChartValue = doraChartValue[pipeline]; + expect(await this.displayBoardChartTab.getAttribute('aria-selected')).toEqual('false'); expect(await this.displayDoraChartTab.getAttribute('aria-selected')).toEqual('true'); await this.displayListTab.click(); @@ -923,82 +943,104 @@ export class ReportStep { await expect(this.meanTimeToRecoveryLoading).toBeHidden(); await expect(this.changeFailureRateLoading).toBeHidden(); + const leadTimeForChangesTrendIcon = this.leadTimeForChangesTrendContainer.getByLabel( + pipelineDoraChartValue['Lead Time For Changes'].type, + ); if (showLeadTimeForChangeChart) { await expect(this.leadTimeForChangeChart).toBeVisible(); - await expect(this.leadTimeForChangesTrendContainer).toBeVisible(); - await expect(this.leadTimeForChangesTrendContainer).toHaveAttribute( - 'color', - pipelineDoraChartValue['Lead Time For Changes'].color, - ); - await expect(this.leadTimeForChangesTrendIcon).toBeVisible(); - await expect(this.leadTimeForChangesTrendContainer).toContainText( - pipelineDoraChartValue['Lead Time For Changes'].value, - ); + if (pipelineDoraChartValue['Lead Time For Changes'].exist) { + await expect(this.leadTimeForChangesTrendContainer).toBeVisible(); + await expect(this.leadTimeForChangesTrendContainer).toHaveAttribute( + 'color', + pipelineDoraChartValue['Lead Time For Changes'].color, + ); + await expect(leadTimeForChangesTrendIcon).toBeVisible(); + await expect(this.leadTimeForChangesTrendContainer).toContainText( + pipelineDoraChartValue['Lead Time For Changes'].value, + ); + } else { + await expect(leadTimeForChangesTrendIcon).not.toBeVisible(); + await expect(this.leadTimeForChangesTrendContainer).not.toBeVisible(); + } } else { await expect(this.leadTimeForChangeChart).not.toBeVisible(); await expect(this.leadTimeForChangesTrendContainer).not.toBeVisible(); - await expect(this.leadTimeForChangesTrendIcon).not.toBeVisible(); + await expect(leadTimeForChangesTrendIcon).not.toBeVisible(); } + const deploymentFrequencyTrendIcon = this.deploymentFrequencyTrendContainer.getByLabel( + pipelineDoraChartValue['Deployment Frequency'].type, + ); if (showDeploymentFrequencyChart) { await expect(this.deploymentFrequencyChart).toBeVisible(); - await expect(this.deploymentFrequencyTrendContainer).toBeVisible(); - await expect(this.deploymentFrequencyTrendContainer).toHaveAttribute( - 'color', - pipelineDoraChartValue['Deployment Frequency'].color, - ); - await expect(this.deploymentFrequencyTrendIcon).toBeVisible(); - await expect(this.deploymentFrequencyTrendContainer).toContainText( - pipelineDoraChartValue['Deployment Frequency'].value, - ); + if (pipelineDoraChartValue['Deployment Frequency'].exist) { + await expect(this.deploymentFrequencyTrendContainer).toBeVisible(); + await expect(this.deploymentFrequencyTrendContainer).toHaveAttribute( + 'color', + pipelineDoraChartValue['Deployment Frequency'].color, + ); + await expect(deploymentFrequencyTrendIcon).toBeVisible(); + await expect(this.deploymentFrequencyTrendContainer).toContainText( + pipelineDoraChartValue['Deployment Frequency'].value, + ); + } else { + await expect(deploymentFrequencyTrendIcon).not.toBeVisible(); + await expect(this.deploymentFrequencyTrendContainer).not.toBeVisible(); + } } else { await expect(this.deploymentFrequencyChart).not.toBeVisible(); await expect(this.deploymentFrequencyTrendContainer).not.toBeVisible(); - await expect(this.deploymentFrequencyTrendIcon).not.toBeVisible(); + await expect(deploymentFrequencyTrendIcon).not.toBeVisible(); } + const pipelineChangeFailureRateTrendIcon = this.pipelineChangeFailureRateTrendContainer.getByLabel( + pipelineDoraChartValue['Pipeline Change Failure Rate'].type, + ); if (showPipelineChangeFailureRateChart) { await expect(this.changeFailureRateChart).toBeVisible(); - if (showPipelineChangeFailureRateTrendContainer) { + if (pipelineDoraChartValue['Pipeline Change Failure Rate'].exist) { await expect(this.pipelineChangeFailureRateTrendContainer).toBeVisible(); await expect(this.pipelineChangeFailureRateTrendContainer).toHaveAttribute( 'color', pipelineDoraChartValue['Pipeline Change Failure Rate'].color, ); - await expect(this.pipelineChangeFailureRateTrendIcon).toBeVisible(); + await expect(pipelineChangeFailureRateTrendIcon).toBeVisible(); await expect(this.pipelineChangeFailureRateTrendContainer).toContainText( pipelineDoraChartValue['Pipeline Change Failure Rate'].value, ); } else { await expect(this.pipelineChangeFailureRateTrendContainer).not.toBeVisible(); - await expect(this.pipelineChangeFailureRateTrendIcon).not.toBeVisible(); + await expect(pipelineChangeFailureRateTrendIcon).not.toBeVisible(); } } else { await expect(this.changeFailureRateChart).not.toBeVisible(); await expect(this.pipelineChangeFailureRateTrendContainer).not.toBeVisible(); - await expect(this.pipelineChangeFailureRateTrendIcon).not.toBeVisible(); + await expect(pipelineChangeFailureRateTrendIcon).not.toBeVisible(); } + const pipelineMeanTimeToRecoveryTrendIcon = this.pipelineMeanTimeToRecoveryTrendContainer.getByLabel( + pipelineDoraChartValue['Pipeline Mean Time To Recovery'].type, + ); if (showPipelineMeanTimeToRecoveryChart) { await expect(this.meanTimeToRecoveryChart).toBeVisible(); - if (showPipelineMeanTimeToRecoveryTrendContainer) { + if (pipelineDoraChartValue['Pipeline Mean Time To Recovery'].exist) { await expect(this.pipelineMeanTimeToRecoveryTrendContainer).toBeVisible(); await expect(this.pipelineMeanTimeToRecoveryTrendContainer).toHaveAttribute( 'color', pipelineDoraChartValue['Pipeline Mean Time To Recovery'].color, ); - await expect(this.pipelineMeanTimeToRecoveryTrendIcon).toBeVisible(); + await expect(pipelineMeanTimeToRecoveryTrendIcon).toBeVisible(); await expect(this.pipelineMeanTimeToRecoveryTrendContainer).toContainText( pipelineDoraChartValue['Pipeline Mean Time To Recovery'].value, ); } else { await expect(this.pipelineMeanTimeToRecoveryTrendContainer).not.toBeVisible(); - await expect(this.pipelineMeanTimeToRecoveryTrendIcon).not.toBeVisible(); + await expect(pipelineMeanTimeToRecoveryTrendIcon).not.toBeVisible(); } } else { await expect(this.meanTimeToRecoveryChart).not.toBeVisible(); await expect(this.pipelineMeanTimeToRecoveryTrendContainer).not.toBeVisible(); - await expect(this.pipelineMeanTimeToRecoveryTrendIcon).not.toBeVisible(); + await expect(pipelineMeanTimeToRecoveryTrendIcon).not.toBeVisible(); } } @@ -1006,67 +1048,61 @@ export class ReportStep { pipelines, showLeadTimeForChangeChart, showDeploymentFrequencyChart, - showPipelineChangeFailureRateTrendContainer, showPipelineChangeFailureRateChart, showPipelineMeanTimeToRecoveryChart, - showPipelineMeanTimeToRecoveryTrendContainer, + doraChartValue, }: { pipelines: string[]; showLeadTimeForChangeChart: boolean; showDeploymentFrequencyChart: boolean; - showPipelineChangeFailureRateTrendContainer: boolean; showPipelineChangeFailureRateChart: boolean; - showPipelineMeanTimeToRecoveryTrendContainer: boolean; showPipelineMeanTimeToRecoveryChart: boolean; + doraChartValue: DoraChartType; }) { await expect(this.doraPipelineSelector).toBeVisible(); await this.checkPipelineSelectorOptions({ + doraChartValue, pipelines, showLeadTimeForChangeChart, showDeploymentFrequencyChart, - showPipelineChangeFailureRateTrendContainer, showPipelineChangeFailureRateChart, showPipelineMeanTimeToRecoveryChart, - showPipelineMeanTimeToRecoveryTrendContainer, }); } async checkPipelineSelectorOptions({ + doraChartValue, pipelines, showLeadTimeForChangeChart, showDeploymentFrequencyChart, - showPipelineChangeFailureRateTrendContainer, showPipelineChangeFailureRateChart, showPipelineMeanTimeToRecoveryChart, - showPipelineMeanTimeToRecoveryTrendContainer, }: { + doraChartValue: DoraChartType; pipelines: string[]; showLeadTimeForChangeChart: boolean; showDeploymentFrequencyChart: boolean; - showPipelineChangeFailureRateTrendContainer: boolean; showPipelineChangeFailureRateChart: boolean; - showPipelineMeanTimeToRecoveryTrendContainer: boolean; showPipelineMeanTimeToRecoveryChart: boolean; }) { await this.doraPipelineSelector.click(); - const singleOption = this.page.getByLabel(`single-option`); - await expect(singleOption).toHaveCount(2); + const singleOption = await this.page.getByLabel(`single-option`); + await expect(singleOption).toHaveCount(pipelines.length); - for (let i = 0; i < 1; i++) { + for (let i = 0; i < pipelines.length; i++) { await expect(singleOption.nth(i)).toHaveText(pipelines[i]); } - for (let i = 0; i < 1; i++) { + for (let i = 0; i < pipelines.length; i++) { await this.doraPipelineSelector.click(); await singleOption.nth(i).click(); - this.checkChartDoraTabStatus({ + await this.checkChartDoraTabStatus({ + doraChartValue, pipeline: pipelines[i], showLeadTimeForChangeChart, showDeploymentFrequencyChart, - showPipelineChangeFailureRateTrendContainer, showPipelineChangeFailureRateChart, showPipelineMeanTimeToRecoveryChart, - showPipelineMeanTimeToRecoveryTrendContainer, }); } } diff --git a/frontend/e2e/specs/major-path/import-project-from-file.spec.ts b/frontend/e2e/specs/major-path/import-project-from-file.spec.ts index 82350da05..de44725f4 100644 --- a/frontend/e2e/specs/major-path/import-project-from-file.spec.ts +++ b/frontend/e2e/specs/major-path/import-project-from-file.spec.ts @@ -9,13 +9,21 @@ import { DORA_METRICS_RESULT_MULTIPLE_RANGES, CYCLE_TIME_WITH_ANALYSIS_STATUS_PROJECT_BOARD_METRICS_RESULT, DORA_METRICS_RESULT_FOR_SOURCE_CONTROL, + DORA_METRICS_RESULT_WITH_PIPELINE_AND_SOURCE_CONTROL, + DORA_METRICS_RESULT_WITH_PIPELINE_AND_SOURCE_CONTROL_DETAIL, } from '../../fixtures/create-new/report-result'; +import { + DORA_CHART_PIPELINES, + DORA_CHART_PIPELINES_WITH_PIPELINE_AND_SOURCE_CONTROL, + DORA_CHART_VALUE, + DORA_CHART_VALUE_WITH_PIPELINE_AND_SOURCE_CONTROL, +} from '../../fixtures/import-file/chart-result'; +import { withPipelineAndSourceControlConfigurationConfig } from '../../fixtures/import-file/with-pipeline-and-source-control-configuration-config-file'; import { cycleTimeByStatusFixture } from '../../fixtures/cycle-time-by-status/cycle-time-by-status-fixture'; import { importMultipleDoneProjectFromFile } from '../../fixtures/import-file/multiple-done-config-file'; import { partialTimeRangesSuccess } from '../../fixtures/import-file/partial-time-ranges-success'; import { partialMetricsShowChart } from '../../fixtures/import-file/partial-metrics-show-chart'; import { selectNoneConfig } from '../../fixtures/import-file/select-none-config'; -import { DORA_CHART_PIPELINES } from '../../fixtures/import-file/chart-result'; import { ProjectCreationType } from 'e2e/pages/metrics/report-step'; import { test } from '../../fixtures/test-with-extend-fixtures'; import { clearTempDir } from 'e2e/utils/clear-temp-dir'; @@ -132,13 +140,12 @@ test('Import project from file with partial ranges API failed', async ({ }); await reportStep.goToCharDoraTab(); await reportStep.checkPipelineSelectorAndDoraChart({ + doraChartValue: DORA_CHART_VALUE, pipelines: DORA_CHART_PIPELINES, showLeadTimeForChangeChart: true, showDeploymentFrequencyChart: true, showPipelineChangeFailureRateChart: true, - showPipelineChangeFailureRateTrendContainer: false, showPipelineMeanTimeToRecoveryChart: true, - showPipelineMeanTimeToRecoveryTrendContainer: false, }); }); @@ -183,13 +190,12 @@ test('Import project from file with no all metrics', async ({ homePage, configSt }); await reportStep.goToCharDoraTab(); await reportStep.checkPipelineSelectorAndDoraChart({ + doraChartValue: DORA_CHART_VALUE, pipelines: DORA_CHART_PIPELINES, - showPipelineMeanTimeToRecoveryTrendContainer: false, showPipelineChangeFailureRateChart: false, showPipelineMeanTimeToRecoveryChart: true, showLeadTimeForChangeChart: true, showDeploymentFrequencyChart: false, - showPipelineChangeFailureRateTrendContainer: false, }); }); @@ -292,3 +298,52 @@ test('Import project from file when select none in pipeline tool configuration', }); await reportStep.checkMetricDownloadDataForMultipleRanges(3, prefix); }); + +test('Import project from file with pipeline and source control configuration', async ({ + homePage, + configStep, + metricsStep, + reportStep, +}) => { + const fileNamePrefix = 'with-pipeline-and-source-control-configuration-'; + await homePage.goto(); + + await homePage.importProjectFromFile( + '../fixtures/input-files/lead-time-for-changes-with-pipeline-and-source-control-configuration.json', + ); + await configStep.clickPreviousButtonAndClickCancelThenRemainPage(); + await configStep.goToMetrics(); + + await metricsStep.waitForShown(); + await metricsStep.selectGivenPipelineCrews(withPipelineAndSourceControlConfigurationConfig.pipelineCrews); + await metricsStep.checkPipelineConfigurationAreChanged(withPipelineAndSourceControlConfigurationConfig.deployment); + await metricsStep.selectGivenSourceControlCrews(withPipelineAndSourceControlConfigurationConfig.sourceControlCrews); + await metricsStep.checkSourceControlConfigurationAreChanged( + withPipelineAndSourceControlConfigurationConfig.sourceControlConfigurationSettings, + ); + await metricsStep.validateNextButtonClickable(); + + await metricsStep.goToReportPage(); + await reportStep.checkProjectName(withPipelineAndSourceControlConfigurationConfig.projectName); + await reportStep.confirmGeneratedReport(); + await reportStep.checkShareReport(); + await reportStep.goToReportListTab(); + await reportStep.checkDoraMetricsForMultipleRanges(DORA_METRICS_RESULT_WITH_PIPELINE_AND_SOURCE_CONTROL); + await reportStep.checkDoraMetricsDetailsForMultipleRanges({ + doraMetricsReportData: DORA_METRICS_RESULT_WITH_PIPELINE_AND_SOURCE_CONTROL_DETAIL, + projectCreationType: ProjectCreationType.IMPORT_PROJECT_FROM_FILE, + showMoreIndex: 0, + fileNamePrefix, + }); + await reportStep.checkMetricDownloadDataForMultipleRanges(2, fileNamePrefix); + await reportStep.goToChartBoardTab(); + await reportStep.goToCharDoraTab(); + await reportStep.checkPipelineSelectorAndDoraChart({ + doraChartValue: DORA_CHART_VALUE_WITH_PIPELINE_AND_SOURCE_CONTROL, + pipelines: DORA_CHART_PIPELINES_WITH_PIPELINE_AND_SOURCE_CONTROL, + showPipelineChangeFailureRateChart: true, + showPipelineMeanTimeToRecoveryChart: true, + showLeadTimeForChangeChart: true, + showDeploymentFrequencyChart: true, + }); +}); diff --git a/frontend/scripts/generate-config-files.sh b/frontend/scripts/generate-config-files.sh index d5ec4cbbf..aac00e97d 100755 --- a/frontend/scripts/generate-config-files.sh +++ b/frontend/scripts/generate-config-files.sh @@ -84,3 +84,11 @@ sed -i -e "s//${E2E_TOKEN_JIRA}/g" "${import_file_name}" sed -i -e "s//${E2E_TOKEN_BUILD_KITE}/g" "${import_file_name}" sed -i -e "s//${E2E_TOKEN_GITHUB}/g" "${import_file_name}" echo "Successfully generate ${import_file_name}" + +import_file_name='./e2e/fixtures/input-files/lead-time-for-changes-with-pipeline-and-source-control-configuration.json' +echo "Start to generate ${import_file_name}" +cat ./e2e/fixtures/input-files/lead-time-for-changes-with-pipeline-and-source-control-configuration.template.json > "${import_file_name}" +sed -i -e "s//${E2E_TOKEN_JIRA}/g" "${import_file_name}" +sed -i -e "s//${E2E_TOKEN_BUILD_KITE}/g" "${import_file_name}" +sed -i -e "s//${E2E_TOKEN_GITHUB_WITH_OTHER_SOURCE_CONTROL}/g" "${import_file_name}" +echo "Successfully generate ${import_file_name}" diff --git a/frontend/src/clients/report/dto/request.ts b/frontend/src/clients/report/dto/request.ts index 057bbbcc1..10a88b267 100644 --- a/frontend/src/clients/report/dto/request.ts +++ b/frontend/src/clients/report/dto/request.ts @@ -13,6 +13,7 @@ export interface ReportRequestDTO extends IBasicReportRequestDTO { orgId: string; orgName: string; repository: string; + repoName: string; step: string; branches: string[]; }[] diff --git a/frontend/src/containers/ReportStep/DoraMetricsChart/PipelineSelector/index.tsx b/frontend/src/containers/ReportStep/DoraMetricsChart/PipelineSelector/index.tsx index 4851e1aff..05047051a 100644 --- a/frontend/src/containers/ReportStep/DoraMetricsChart/PipelineSelector/index.tsx +++ b/frontend/src/containers/ReportStep/DoraMetricsChart/PipelineSelector/index.tsx @@ -48,10 +48,10 @@ export default function PipelineSelector({ options, value, onUpDatePipeline, tit placement='right' followCursor > - + {emojiWrap} - + diff --git a/frontend/src/containers/ReportStep/index.tsx b/frontend/src/containers/ReportStep/index.tsx index d49e72e4f..9fd54af33 100644 --- a/frontend/src/containers/ReportStep/index.tsx +++ b/frontend/src/containers/ReportStep/index.tsx @@ -15,6 +15,7 @@ import { selectBasicInfo, selectConfig, selectDateRange, + selectPipelineTool, } from '@src/context/config/configSlice'; import { selectReportId, @@ -22,9 +23,9 @@ import { selectTimeStamp, } from '@src/context/stepper/StepperSlice'; import { IPipelineConfig, selectClassificationCharts, selectMetricsContent } from '@src/context/Metrics/metricsSlice'; +import { MESSAGE, PIPELINE_TOOL_OTHER_OPTION, RequiredData } from '@src/constants/resources'; import { ReportResponseDTO } from '@src/clients/report/dto/response'; import { getTotalDateRangeLoadingStatus } from '@src/utils/report'; -import { MESSAGE, RequiredData } from '@src/constants/resources'; import { useAppDispatch } from '@src/hooks/useAppDispatch'; import { MetricTypes } from '@src/constants/commons'; import ReportContent from './ReportContent'; @@ -66,6 +67,7 @@ const ReportStep = ({ handleSave }: ReportStepProps) => { const reportPageTimeRangeLoadingStatus = useAppSelector(selectReportPageFailedTimeRangeInfos); const allDateRangeLoadingFinished = !getTotalDateRangeLoadingStatus(dateRanges, reportPageTimeRangeLoadingStatus) .isLoading; + const pipelineTools = useAppSelector(selectPipelineTool); const { startToRequestData, reportInfos, stopPollingReports, hasPollingStarted } = useGenerateReportEffect(); @@ -148,7 +150,7 @@ const ReportStep = ({ handleSave }: ReportStepProps) => { buildKiteSetting: { pipelineCrews, ...pipelineTool.config, - deploymentEnvList: getPipelineConfig(pipelineSettings), + deploymentEnvList: pipelineTools.type !== PIPELINE_TOOL_OTHER_OPTION ? getPipelineConfig(pipelineSettings) : [], }, codebaseSetting: { type: sourceControl.config.type, @@ -161,7 +163,7 @@ const ReportStep = ({ handleSave }: ReportStepProps) => { }; const getPipelineConfig = (pipelineConfigs: IPipelineConfig[]) => - pipelineConfigs.flatMap(({ organization, pipelineName, step, branches }) => { + pipelineConfigs.flatMap(({ organization, pipelineName, step, branches, repoName }) => { const pipelineConfigFromPipelineList = configData.pipelineTool.verifiedResponse.pipelineList.find( (pipeline) => pipeline.name === pipelineName && pipeline.orgName === organization, ); @@ -176,6 +178,7 @@ const ReportStep = ({ handleSave }: ReportStepProps) => { step, repository, branches, + repoName, }, ]; }