Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADM-989 [frontend][backend]: unified report data percentage display #1565

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ private List<String[]> getRowsFromCycleTime(CycleTime cycleTime) {
swimlaneList.forEach(cycleTimeForSelectedStepItem -> {
String stepName = formatStepName(cycleTimeForSelectedStepItem);
double proportion = cycleTimeForSelectedStepItem.getTotalTime() / cycleTime.getTotalTimeForCards();
rows.add(new String[] { cycleTimeTitle, "Total " + stepName + " time / Total cycle time",
rows.add(new String[] { cycleTimeTitle, "Total " + stepName + " time / Total cycle time(%)",
DecimalUtil.formatDecimalTwo(proportion * 100) });
rowsForSelectedStepItemAverageTime
.add(new String[] { cycleTimeTitle, "Average " + stepName + " time(days/storyPoint)",
Expand All @@ -421,7 +421,7 @@ private List<String[]> getRowFromRework(Rework rework) {
List<String[]> rows = new ArrayList<>();
rows.add(new String[] { REWORK_FIELD, "Total rework times", String.valueOf(rework.getTotalReworkTimes()) });
rows.add(new String[] { REWORK_FIELD, "Total rework cards", String.valueOf(rework.getTotalReworkCards()) });
rows.add(new String[] { REWORK_FIELD, "Rework cards ratio(Total rework cards/Throughput)",
rows.add(new String[] { REWORK_FIELD, "Rework cards ratio(Total rework cards/Throughput%)",
formatDecimalFour(rework.getReworkCardsRatio()) });
return rows;
}
Expand All @@ -442,9 +442,9 @@ private List<String[]> getRowsFormClassification(Classification classificationLi
List<String[]> rows = new ArrayList<>();
String fieldName = String.valueOf((classificationList.getFieldName()));
List<ClassificationInfo> pairList = classificationList.getClassificationInfos();
pairList.forEach(
nameValuePair -> rows.add(new String[] { "Classifications", fieldName + " / " + nameValuePair.getName(),
DecimalUtil.formatDecimalTwo(nameValuePair.getValue() * 100) }));
pairList.forEach(nameValuePair -> rows
.add(new String[] { "Classifications", fieldName + " / " + nameValuePair.getName() + "(%)",
DecimalUtil.formatDecimalTwo(nameValuePair.getValue() * 100) }));
return rows;
}

Expand Down Expand Up @@ -521,14 +521,14 @@ private List<String[]> getRowsFromPipelineChangeFailureRate(PipelineChangeFailur
.getPipelineChangeFailureRateOfPipelines();
pipelineChangeFailureRateOfPipelines.forEach(pipeline -> rows.add(new String[] { "Pipeline change failure rate",
pipeline.getName() + " / " + extractPipelineStep(pipeline.getStep())
+ " / Pipeline change failure rate",
DecimalUtil.formatDecimalFour(pipeline.getFailureRate()) }));
+ " / Pipeline change failure rate(%)",
DecimalUtil.formatDecimalFour(pipeline.getFailureRate() * 100) }));

AvgPipelineChangeFailureRate avgPipelineChangeFailureRate = pipelineChangeFailureRate
.getAvgPipelineChangeFailureRate();
if (pipelineChangeFailureRateOfPipelines.size() > 1)
rows.add(new String[] { "Pipeline change failure rate",
avgPipelineChangeFailureRate.getName() + " / Pipeline change failure rate",
avgPipelineChangeFailureRate.getName() + " / Pipeline change failure rate(%)",
DecimalUtil.formatDecimalTwo(avgPipelineChangeFailureRate.getFailureRate() * 100) });

return rows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,12 @@ void shouldConvertMetricDataToCsv() {
{ "Velocity", "Velocity(Story Point)", "7.0" }, { "Velocity", "Throughput(Cards Count)", "2" },
{ "Cycle time", "Average cycle time(days/storyPoint)", "4.18" },
{ "Cycle time", "Average cycle time(days/card)", "9.75" },
{ "Cycle time", "Total development time / Total cycle time", "62.10" },
{ "Cycle time", "Total analysis time / Total cycle time", "1087.39" },
{ "Cycle time", "Total block time / Total cycle time", "0.34" },
{ "Cycle time", "Total review time / Total cycle time", "37.39" },
{ "Cycle time", "Total testing time / Total cycle time", "0.17" },
{ "Cycle time", "Total time / Total cycle time", "0.17" },
{ "Cycle time", "Total development time / Total cycle time(%)", "62.10" },
{ "Cycle time", "Total analysis time / Total cycle time(%)", "1087.39" },
{ "Cycle time", "Total block time / Total cycle time(%)", "0.34" },
{ "Cycle time", "Total review time / Total cycle time(%)", "37.39" },
{ "Cycle time", "Total testing time / Total cycle time(%)", "0.17" },
{ "Cycle time", "Total time / Total cycle time(%)", "0.17" },
{ "Cycle time", "Average development time(days/storyPoint)", "2.60" },
{ "Cycle time", "Average development time(days/card)", "6.06" },
{ "Cycle time", "Average analysis time(days/storyPoint)", "12.60" },
Expand All @@ -563,8 +563,8 @@ void shouldConvertMetricDataToCsv() {
{ "Cycle time", "Average testing time(days/card)", "0.02" },
{ "Cycle time", "Average time(days/storyPoint)", "0.01" },
{ "Cycle time", "Average time(days/card)", "0.02" },
{ "Classifications", "Issue Type / Bug", "33.33" },
{ "Classifications", "Issue Type / Story", "66.67" },
{ "Classifications", "Issue Type / Bug(%)", "33.33" },
{ "Classifications", "Issue Type / Story(%)", "66.67" },
{ "Deployment frequency", "Heartbeat / Deploy prod / Deployment frequency(Deployments/Day)",
"0.78" },
{ "Deployment frequency", "Heartbeat / Deploy prod / Deployment frequency(Deployment times)", "0" },
Expand All @@ -583,11 +583,11 @@ void shouldConvertMetricDataToCsv() {
{ "Lead time for changes", "Average / PR Lead Time", "0" },
{ "Lead time for changes", "Average / Pipeline Lead Time", "0.05" },
{ "Lead time for changes", "Average / Total Lead Time", "0.05" },
{ "Pipeline change failure rate", "Heartbeat / Deploy prod / Pipeline change failure rate",
{ "Pipeline change failure rate", "Heartbeat / Deploy prod / Pipeline change failure rate(%)",
"0.0000" },
{ "Pipeline change failure rate",
"Heartbeat / Check Frontend License / Pipeline change failure rate", "0.0000" },
{ "Pipeline change failure rate", "Average / Pipeline change failure rate", "0" },
"Heartbeat / Check Frontend License / Pipeline change failure rate(%)", "0.0000" },
{ "Pipeline change failure rate", "Average / Pipeline change failure rate(%)", "0" },
{ "Pipeline mean time to recovery", "Heartbeat / Deploy prod / Pipeline mean time to recovery",
"0" },
{ "Pipeline mean time to recovery",
Expand Down Expand Up @@ -749,13 +749,13 @@ void shouldHasContentWhenGetDataFromCsvGivenDataTypeIsMetric() {
{ "Velocity", "Velocity(Story Point)", "7.0" }, { "Velocity", "Throughput(Cards Count)", "2" },
{ "Cycle time", "Average cycle time(days/storyPoint)", "4.18" },
{ "Cycle time", "Average cycle time(days/card)", "9.75" },
{ "Cycle time", "Total development time / Total cycle time", "62.10" },
{ "Cycle time", "Total analysis time / Total cycle time", "1087.39" },
{ "Cycle time", "Total block time / Total cycle time", "0.34" },
{ "Cycle time", "Total review time / Total cycle time", "37.39" },
{ "Cycle time", "Total testing time / Total cycle time", "0.17" },
{ "Cycle time", "Total time / Total cycle time", "0.17" },
{ "Cycle time", "Total waiting for testing time / Total cycle time", "62.10" },
{ "Cycle time", "Total development time / Total cycle time(%)", "62.10" },
{ "Cycle time", "Total analysis time / Total cycle time(%)", "1087.39" },
{ "Cycle time", "Total block time / Total cycle time(%)", "0.34" },
{ "Cycle time", "Total review time / Total cycle time(%)", "37.39" },
{ "Cycle time", "Total testing time / Total cycle time(%)", "0.17" },
{ "Cycle time", "Total time / Total cycle time(%)", "0.17" },
{ "Cycle time", "Total waiting for testing time / Total cycle time(%)", "62.10" },
{ "Cycle time", "Average development time(days/storyPoint)", "2.60" },
{ "Cycle time", "Average development time(days/card)", "6.06" },
{ "Cycle time", "Average analysis time(days/storyPoint)", "12.60" },
Expand All @@ -770,8 +770,8 @@ void shouldHasContentWhenGetDataFromCsvGivenDataTypeIsMetric() {
{ "Cycle time", "Average time(days/card)", "0.02" },
{ "Cycle time", "Average waiting for testing time(days/storyPoint)", "2.60" },
{ "Cycle time", "Average waiting for testing time(days/card)", "6.06" },
{ "Classifications", "Issue Type / Bug", "33.33" },
{ "Classifications", "Issue Type / Story", "66.67" },
{ "Classifications", "Issue Type / Bug(%)", "33.33" },
{ "Classifications", "Issue Type / Story(%)", "66.67" },
{ "Deployment frequency", "Heartbeat / Deploy prod / Deployment frequency(Deployments/Day)",
"0.78" },
{ "Deployment frequency", "Heartbeat / Deploy prod / Deployment frequency(Deployment times)", "1" },
Expand All @@ -790,11 +790,11 @@ void shouldHasContentWhenGetDataFromCsvGivenDataTypeIsMetric() {
{ "Lead time for changes", "Average / PR Lead Time", "0" },
{ "Lead time for changes", "Average / Pipeline Lead Time", "0.05" },
{ "Lead time for changes", "Average / Total Lead Time", "0.05" },
{ "Pipeline change failure rate", "Heartbeat / Deploy prod / Pipeline change failure rate",
{ "Pipeline change failure rate", "Heartbeat / Deploy prod / Pipeline change failure rate(%)",
"0.0000" },
{ "Pipeline change failure rate",
"Heartbeat / Check Frontend License / Pipeline change failure rate", "0.0000" },
{ "Pipeline change failure rate", "Average / Pipeline change failure rate", "0" },
"Heartbeat / Check Frontend License / Pipeline change failure rate(%)", "0.0000" },
{ "Pipeline change failure rate", "Average / Pipeline change failure rate(%)", "0" },
{ "Pipeline mean time to recovery", "Heartbeat / Deploy prod / Pipeline mean time to recovery",
"0" },
{ "Pipeline mean time to recovery",
Expand Down Expand Up @@ -876,14 +876,14 @@ void shouldHasNoContentForAveragesWhenGetDataFromCsvGivenDataTypeIsMetricAndTheQ
.build();
String[][] expectedSavedData = new String[][] { { "Group", "Metrics", "Value" },
{ "Rework", "Total rework times", "3" }, { "Rework", "Total rework cards", "3" },
{ "Rework", "Rework cards ratio(Total rework cards/Throughput)", "0.9900" },
{ "Rework", "Rework cards ratio(Total rework cards/Throughput%)", "0.9900" },
{ "Deployment frequency", "Heartbeat / Deploy prod / Deployment frequency(Deployments/Day)",
"0.78" },
{ "Deployment frequency", "Heartbeat / Deploy prod / Deployment frequency(Deployment times)", "1" },
{ "Lead time for changes", "Heartbeat / Deploy prod / PR Lead Time", "0" },
{ "Lead time for changes", "Heartbeat / Deploy prod / Pipeline Lead Time", "0.02" },
{ "Lead time for changes", "Heartbeat / Deploy prod / Total Lead Time", "0.02" },
{ "Pipeline change failure rate", "Heartbeat / Deploy prod / Pipeline change failure rate",
{ "Pipeline change failure rate", "Heartbeat / Deploy prod / Pipeline change failure rate(%)",
"0.0000" },
{ "Pipeline mean time to recovery", "Heartbeat / Deploy prod / Pipeline mean time to recovery",
"0" }, };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('dev change failure rate data mapper', () => {
name: 'Average',
valueList: [
{
value: '0.00',
value: '0.00%',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/__tests__/hooks/reportMapper/report.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const EXPECTED_REPORT_VALUES = {
name: 'Average',
valueList: [
{
value: '0.00',
value: '0.00%',
},
],
},
Expand Down
70 changes: 35 additions & 35 deletions frontend/e2e/fixtures/create-new/metric-20240603-20240604.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"Velocity","Throughput(Cards Count)","3"
"Cycle time","Average cycle time(days/storyPoint)","5.39"
"Cycle time","Average cycle time(days/card)","9.88"
"Cycle time","Total waiting for testing time / Total cycle time","3.34"
"Cycle time","Total development time / Total cycle time","74.29"
"Cycle time","Total block time / Total cycle time","6.71"
"Cycle time","Total review time / Total cycle time","12.35"
"Cycle time","Total testing time / Total cycle time","3.31"
"Cycle time","Total waiting for testing time / Total cycle time(%)","3.34"
"Cycle time","Total development time / Total cycle time(%)","74.29"
"Cycle time","Total block time / Total cycle time(%)","6.71"
"Cycle time","Total review time / Total cycle time(%)","12.35"
"Cycle time","Total testing time / Total cycle time(%)","3.31"
"Cycle time","Average waiting for testing time(days/storyPoint)","0.18"
"Cycle time","Average waiting for testing time(days/card)","0.33"
"Cycle time","Average development time(days/storyPoint)","4.00"
Expand All @@ -18,41 +18,41 @@
"Cycle time","Average review time(days/card)","1.22"
"Cycle time","Average testing time(days/storyPoint)","0.18"
"Cycle time","Average testing time(days/card)","0.33"
"Classifications","Issue Type / Task","66.67"
"Classifications","Issue Type / Story","33.33"
"Classifications","Parent / ADM-868","100.00"
"Classifications","Story testing-2 / None","100.00"
"Classifications","Story testing-1 / 1.0","66.67"
"Classifications","Story testing-1 / None","33.33"
"Classifications","Design / None","100.00"
"Classifications","Vulnerability / None","100.00"
"Classifications","Sprint / Sprint37","100.00"
"Classifications","Sprint / Sprint 35","33.33"
"Classifications","Sprint / Sprint 36","66.67"
"Classifications","Sprint / Sprint34","33.33"
"Classifications","Project / Auto Dora Metrics","100.00"
"Classifications","Flagged / None","100.00"
"Classifications","Fix versions / None","100.00"
"Classifications","Priority / Medium","100.00"
"Classifications","Partner / YinYuan Zhou","33.33"
"Classifications","Partner / None","66.67"
"Classifications","Labels / 1.1.7","100.00"
"Classifications","Time tracking / None","100.00"
"Classifications","Story point estimate / 2.0","33.33"
"Classifications","Story point estimate / 3.0","33.33"
"Classifications","Story point estimate / 0.5","33.33"
"Classifications","QA / None","100.00"
"Classifications","Feature/Operation / None","100.00"
"Classifications","Assignee / Chao Wang","33.33"
"Classifications","Assignee / YinYuan Zhou","33.33"
"Classifications","Assignee / Qiuhong Lei","33.33"
"Classifications","Issue Type / Task(%)","66.67"
"Classifications","Issue Type / Story(%)","33.33"
"Classifications","Parent / ADM-868(%)","100.00"
"Classifications","Story testing-2 / None(%)","100.00"
"Classifications","Story testing-1 / 1.0(%)","66.67"
"Classifications","Story testing-1 / None(%)","33.33"
"Classifications","Design / None(%)","100.00"
"Classifications","Vulnerability / None(%)","100.00"
"Classifications","Sprint / Sprint37(%)","100.00"
"Classifications","Sprint / Sprint 35(%)","33.33"
"Classifications","Sprint / Sprint 36(%)","66.67"
"Classifications","Sprint / Sprint34(%)","33.33"
"Classifications","Project / Auto Dora Metrics(%)","100.00"
"Classifications","Flagged / None(%)","100.00"
"Classifications","Fix versions / None(%)","100.00"
"Classifications","Priority / Medium(%)","100.00"
"Classifications","Partner / YinYuan Zhou(%)","33.33"
"Classifications","Partner / None(%)","66.67"
"Classifications","Labels / 1.1.7(%)","100.00"
"Classifications","Time tracking / None(%)","100.00"
"Classifications","Story point estimate / 2.0(%)","33.33"
"Classifications","Story point estimate / 3.0(%)","33.33"
"Classifications","Story point estimate / 0.5(%)","33.33"
"Classifications","QA / None(%)","100.00"
"Classifications","Feature/Operation / None(%)","100.00"
"Classifications","Assignee / Chao Wang(%)","33.33"
"Classifications","Assignee / YinYuan Zhou(%)","33.33"
"Classifications","Assignee / Qiuhong Lei(%)","33.33"
"Rework","Total rework times","1"
"Rework","Total rework cards","1"
"Rework","Rework cards ratio(Total rework cards/Throughput)","0.3333"
"Rework","Rework cards ratio(Total rework cards/Throughput%)","0.3333"
"Deployment frequency","Heartbeat / Deploy prod / Deployment frequency(Deployments/Day)","2.00"
"Deployment frequency","Heartbeat / Deploy prod / Deployment frequency(Deployment times)","4"
"Lead time for changes","Heartbeat / Deploy prod / PR Lead Time","10.78"
"Lead time for changes","Heartbeat / Deploy prod / Pipeline Lead Time","0.59"
"Lead time for changes","Heartbeat / Deploy prod / Total Lead Time","11.38"
"Pipeline change failure rate","Heartbeat / Deploy prod / Pipeline change failure rate","0.0000"
"Pipeline change failure rate","Heartbeat / Deploy prod / Pipeline change failure rate(%)","0.0000"
"Pipeline mean time to recovery","Heartbeat / Deploy prod / Pipeline mean time to recovery","0"
Loading
Loading