Skip to content

Commit

Permalink
ADM-965 [frontend][backend]: add a heartbeat state 'Design' &'Waiting…
Browse files Browse the repository at this point in the history
… for deployment' in board mapping (#1568)

* ADM-965 [frontend]: rename the waiting for testing

* ADM-990 [frontend]: add design and waiting for development to cycle time options

* ADM-990 [backend]: add design and waiting for development to cycle time result and rework

* ADM-990 [backend]: fix sonar issues

* ADM-965 [frontend]: change the cycle time data in the report page

* ADM-965 [frontend]: show the rework data in the board detail page

* ADM-965 [frontend]: fix test

* ADM-965 [frontend]: fix e2e test

* ADM-965 [frontend]: rename

* ADM-965 [backend]: fix comments

* ADM-965 [backend]: fix sonar issues
  • Loading branch information
zhou-yinyuan authored Aug 9, 2024
1 parent 1d16838 commit e71d6b7
Show file tree
Hide file tree
Showing 23 changed files with 2,250 additions and 1,900 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,19 @@ _Image 3-9, Crews/Board Mappings config_

**Cycle Time:** It will list all columns for the current active jira board. Then users need to map the each column to the supported columns. Like, if your board have “in progress” column, it means developer doing this ticket, so it should be mapping with “In Dev” for the list we provide.

| Status | Description |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| To do | It means the ticket needs to be done, waiting for Dev to pick it. Cycle time doesn't include this time. |
| Analysis | BA or other people still need to analyze the ticket. Cycle time doesn't include this time. |
| In Dev | It means dev is doing the ticket. This time should be a part of cycle time. And it is named development time. |
| Block | It means the tickets blocked by some issues, cannot be done now. This time should be a part of cycle time. And it is named block time. |
| Waiting for testing | It means waiting for Dev to pick or QA to testing. This time should be a part of cycle time. And it is named waiting time. |
| Testing | It means QA is testing the tickets. This time should be a part of cycle time. And it is named testing time. |
| Review | It means PO or other people are reviewing the tickets. This time should be a part of cycle time. And it is named review time. |
| Done | It means the tickets are already done. Cycle time doesn't include this time. |
| -- | If you don't need to map, you can select -- |
| Status | Description |
|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| To do | It means the ticket needs to be done, waiting for Dev to pick it. Cycle time doesn't include this time. |
| Analysis | BA or other people still need to analyze the ticket. Cycle time doesn't include this time. |
| Design | UX or other people still need to design the prototype.Cycle time doesn’t include this time. |
| In Dev | It means dev is doing the ticket. This time should be a part of cycle time. And it is named development time. |
| Block | It means the tickets blocked by some issues, cannot be done now. This time should be a part of cycle time. And it is named block time. |
| Waiting for testing | It means waiting for Dev to pick or QA to testing. This time should be a part of cycle time. And it is named waiting time. |
| Testing | It means QA is testing the tickets. This time should be a part of cycle time. And it is named testing time. |
| Review | It means PO or other people are reviewing the tickets. This time should be a part of cycle time. And it is named review time. |
| Waiting for deployment | it means that the ticket has passed the test and is waiting to be deployment. This time should be a part of cycle time. And it is named waiting for deployment time. |
| Done | It means the tickets are already done. Cycle time doesn't include this time. |
| -- | If you don't need to map, you can select -- |

**By Status**: user can click the toggle selected button to choose the mapping relationship by column or by status. It support multiple status map in to one column, just as the picture shows the TODO and INPROGRESS board status can be mapped to different heartbeat states.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

public enum CardStepsEnum {

TODO("To do", "To do"), ANALYSE("Analysis", "Analysis"), DEVELOPMENT("In Dev", "In dev"), BLOCK("Block", "Block"),
FLAG("FLAG", "Flag"), REMOVEFLAG("removeFlag", "Remove flag"), REVIEW("Review", "Review"),
WAITING("Waiting for testing", "Waiting for testing"), TESTING("Testing", "Testing"), DONE("Done", "Done"),
TODO("To do", "To do"), ANALYSE("Analysis", "Analysis"), DESIGN("Design", "Design"),
DEVELOPMENT("In Dev", "In dev"), BLOCK("Block", "Block"), FLAG("FLAG", "Flag"),
REMOVEFLAG("removeFlag", "Remove flag"), REVIEW("Review", "Review"),
WAITING_FOR_TESTING("Waiting for testing", "Waiting for testing"), TESTING("Testing", "Testing"),
WAITING_FOR_DEPLOYMENT("Waiting for deployment", "Waiting for deployment"), DONE("Done", "Done"),
CLOSED("Closed", "Closed"), UNKNOWN("UNKNOWN", "Unknown");

private final String value;
Expand Down Expand Up @@ -37,9 +39,17 @@ public static CardStepsEnum fromValue(String type) {
}

public static final Map<CardStepsEnum, Set<CardStepsEnum>> reworkJudgmentMap = Map.of(TODO,
Set.of(ANALYSE, DEVELOPMENT, BLOCK, FLAG, REVIEW, WAITING, TESTING, DONE), ANALYSE,
Set.of(DEVELOPMENT, BLOCK, FLAG, REVIEW, WAITING, TESTING, DONE), DEVELOPMENT,
Set.of(BLOCK, FLAG, REVIEW, WAITING, TESTING, DONE), BLOCK, Set.of(REVIEW, WAITING, TESTING, DONE), REVIEW,
Set.of(WAITING, TESTING, DONE), WAITING, Set.of(TESTING, DONE), TESTING, Set.of(DONE));
Set.of(ANALYSE, DESIGN, DEVELOPMENT, BLOCK, FLAG, REVIEW, WAITING_FOR_TESTING, TESTING,
WAITING_FOR_DEPLOYMENT, DONE),
ANALYSE,
Set.of(DESIGN, DEVELOPMENT, BLOCK, FLAG, REVIEW, WAITING_FOR_TESTING, TESTING, WAITING_FOR_DEPLOYMENT,
DONE),
DESIGN,
Set.of(DEVELOPMENT, BLOCK, FLAG, REVIEW, WAITING_FOR_TESTING, TESTING, WAITING_FOR_DEPLOYMENT, DONE),
DEVELOPMENT, Set.of(BLOCK, FLAG, REVIEW, WAITING_FOR_TESTING, TESTING, WAITING_FOR_DEPLOYMENT, DONE), BLOCK,
Set.of(REVIEW, WAITING_FOR_TESTING, TESTING, WAITING_FOR_DEPLOYMENT, DONE), REVIEW,
Set.of(WAITING_FOR_TESTING, TESTING, WAITING_FOR_DEPLOYMENT, DONE), WAITING_FOR_TESTING,
Set.of(TESTING, WAITING_FOR_DEPLOYMENT, DONE), TESTING, Set.of(WAITING_FOR_DEPLOYMENT, DONE),
WAITING_FOR_DEPLOYMENT, Set.of(DONE));

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ public class StepsDay {

private double todo;

private double design;

private double waitingForDeployment;

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class Rework {

private Integer fromAnalysis;

private Integer fromDesign;

private Integer fromInDev;

private Integer fromBlock;
Expand All @@ -23,6 +25,8 @@ public class Rework {

private Integer fromTesting;

private Integer fromWaitingForDeployment;

private Integer fromReview;

private Integer fromDone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,6 @@ private List<StatusChangedItem> putStatusChangeEventsIntoAnArray(CardHistoryResp
});
}
return statusChangedArray;

}

private CardCycleTime calculateCardCycleTime(String cardId, List<CycleTimeInfo> cycleTimeInfos,
Expand All @@ -932,14 +931,18 @@ private CardCycleTime calculateCardCycleTime(String cardId, List<CycleTimeInfo>
stepsDay.setDevelopment(stepsDay.getDevelopment() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
}
case WAITING -> {
case WAITING_FOR_TESTING -> {
stepsDay.setWaitingForTesting(stepsDay.getWaitingForTesting() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
}
case TESTING -> {
stepsDay.setTesting(stepsDay.getTesting() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
}
case WAITING_FOR_DEPLOYMENT -> {
stepsDay.setWaitingForDeployment(stepsDay.getWaitingForDeployment() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
}
case BLOCK -> {
stepsDay.setBlocked(stepsDay.getBlocked() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
Expand All @@ -948,6 +951,10 @@ private CardCycleTime calculateCardCycleTime(String cardId, List<CycleTimeInfo>
stepsDay.setReview(stepsDay.getReview() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
}
case DESIGN -> {
stepsDay.setDesign(stepsDay.getDesign() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
}
case ANALYSE -> {
stepsDay.setAnalyse(stepsDay.getAnalyse() + cycleTimeInfo.getDay());
total += cycleTimeInfo.getDay();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ public Rework calculateRework(CardCollection realDoneCardCollection, CardStepsEn
switch (reworkTimesInfo.getState()) {
case ANALYSE ->
rework.setFromAnalysis(Optional.ofNullable(rework.getFromAnalysis()).orElse(0) + times);
case DESIGN -> rework.setFromDesign(Optional.ofNullable(rework.getFromDesign()).orElse(0) + times);
case DEVELOPMENT ->
rework.setFromInDev(Optional.ofNullable(rework.getFromInDev()).orElse(0) + times);
case BLOCK -> rework.setFromBlock(Optional.ofNullable(rework.getFromBlock()).orElse(0) + times);
case WAITING -> rework.setFromWaitingForTesting(
case WAITING_FOR_TESTING -> rework.setFromWaitingForTesting(
Optional.ofNullable(rework.getFromWaitingForTesting()).orElse(0) + times);
case TESTING ->
rework.setFromTesting(Optional.ofNullable(rework.getFromTesting()).orElse(0) + times);
case REVIEW -> rework.setFromReview(Optional.ofNullable(rework.getFromReview()).orElse(0) + times);
case WAITING_FOR_DEPLOYMENT -> rework.setFromWaitingForDeployment(
Optional.ofNullable(rework.getFromWaitingForDeployment()).orElse(0) + times);
case DONE -> rework.setFromDone(Optional.ofNullable(rework.getFromDone()).orElse(0) + times);
default -> throw new IllegalStateException("Unexpected value: " + reworkTimesInfo.getState());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class JiraBoardConfigDTOFixture {

public static final String ANALYSE = "Analysis";

public static final String DESIGN = "Design";

public static final String IN_DEV = "In Dev";

public static final String REVIEW = "Review";
Expand All @@ -66,6 +68,8 @@ public class JiraBoardConfigDTOFixture {

public static final String WAITING_FOR_TESTING = "Waiting for testing";

public static final String WAITING_FOR_DEPLOYMENT = "Waiting for deployment";

public static final String ASSIGNEE_NAME = "Zhang San";

public static final String DISPLAY_NAME_ONE = "Da Pei";
Expand Down Expand Up @@ -448,6 +452,11 @@ public static JiraBoardSetting.JiraBoardSettingBuilder JIRA_BOARD_SETTING_BUILD(
.boardId(BOARD_ID)
.boardColumns(List.of(RequestJiraBoardColumnSetting.builder().name(IN_DEV).value(IN_DEV).build(),
RequestJiraBoardColumnSetting.builder().name(ANALYSE).value(ANALYSE).build(),
RequestJiraBoardColumnSetting.builder().name(DESIGN).value(DESIGN).build(),
RequestJiraBoardColumnSetting.builder()
.name(WAITING_FOR_DEPLOYMENT)
.value(WAITING_FOR_DEPLOYMENT)
.build(),
RequestJiraBoardColumnSetting.builder()
.name(WAITING_FOR_TESTING)
.value(WAITING_FOR_TESTING)
Expand Down Expand Up @@ -650,6 +659,8 @@ public static List<CycleTimeInfo> CYCLE_TIME_INFO_LIST() {
CycleTimeInfo.builder().column("IN DEV").day(3.0).build(),
CycleTimeInfo.builder().column("REVIEW").day(4.0).build(),
CycleTimeInfo.builder().column("ANALYSIS").day(9.0).build(),
CycleTimeInfo.builder().column("DESIGN").day(1.0).build(),
CycleTimeInfo.builder().column("WAITING FOR DEPLOYMENT").day(2.0).build(),
CycleTimeInfo.builder().column(UNKNOWN).day(5.0).build(),
CycleTimeInfo.builder().column("BLOCK").day(6.0).build());
}
Expand Down
Loading

0 comments on commit e71d6b7

Please sign in to comment.