-
Notifications
You must be signed in to change notification settings - Fork 15
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-727:[backend][docs]feat: Merge two API into one #897
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
Hi @Lei010! 👋 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be Changed with the comments
@@ -62,7 +65,7 @@ public ResponseEntity<ReportResponse> generateReport(@PathVariable String report | |||
return ResponseEntity.status(HttpStatus.OK).body(reportResponse); | |||
} | |||
|
|||
@PostMapping("/board") | |||
@PostMapping("/v1/board") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why add v1? please see the doc: http://13.214.14.43:4321/api/v1/swagger-ui/index.html#/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
try { | ||
saveReporterInHandler(generateReporter(request), IdUtil.getBoardReportId(request.getCsvTimeStamp())); | ||
updateMetricsDataReadyInHandler(request.getCsvTimeStamp(), request.getMetrics()); | ||
log.info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the log of start to do something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
IdUtil.getDoraReportId(pipelineRequest.getCsvTimeStamp())); | ||
updateMetricsDataReadyInHandler(pipelineRequest.getCsvTimeStamp(), pipelineRequest.getMetrics()); | ||
log.info( | ||
"Successfully generate pipeline report, _metrics: {}, _considerHoliday: {}, _startTime: {}, _endTime: {}, _pipelineReportId: {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the start to do something,....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
IdUtil.getCodeBaseReportId(codebaseRequest.getCsvTimeStamp())); | ||
updateMetricsDataReadyInHandler(codebaseRequest.getCsvTimeStamp(), codebaseRequest.getMetrics()); | ||
log.info( | ||
"Successfully generate codebase report, _metrics: {}, _considerHoliday: {}, _startTime: {}, _endTime: {}, _codeBaseReportId: {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the start to do something,....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -161,7 +161,7 @@ void shouldReturnAcceptedStatusAndCallbackUrlAndIntervalWhenCallBoardReports() t | |||
doNothing().when(generateReporterService).updateMetricsDataReadyInHandler(any(), any()); | |||
|
|||
MockHttpServletResponse response = mockMvc | |||
.perform(post("/reports/board").contentType(MediaType.APPLICATION_JSON) | |||
.perform(post("/reports/v1/board").contentType(MediaType.APPLICATION_JSON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove v1
is there any design for the new endpoint? i think we should follow the design
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
GenerateReportRequest.class); | ||
ReportResponse reportResponse = mapper.readValue(new File(RESPONSE_FILE_PATH), ReportResponse.class); | ||
reportRequest.setCsvTimeStamp("1683734399999"); | ||
String boardTimeStamp = "board-1683734399999"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is 1683734399999
?
can we refactor with a readable name like board-20240109232359
, even add milliseconds
must be changed with this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ReportResponse reportResponse = mapper.readValue(new File(RESPONSE_FILE_PATH), ReportResponse.class); | ||
GenerateReporterService spyGenerateReporterService = spy(generateReporterService); | ||
reportRequest.setCsvTimeStamp("1683734399999"); | ||
String doraTimeStamp = "dora-1683734399999"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as board
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ReportResponse reportResponse = mapper.readValue(new File(RESPONSE_FILE_PATH), ReportResponse.class); | ||
GenerateReporterService spyGenerateReporterService = spy(generateReporterService); | ||
reportRequest.setCsvTimeStamp("1683734399999"); | ||
String codebaseTimeStamp = "github-1683734399999"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as board
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
...
Before
Generate Report divided into two apis.
Screenshots
If applicable, add screenshots to help explain behavior of your code.
After
Merge two API into one, and asyncly generate pipeline and code base metrics.
Screenshots
If applicable, add screenshots to help explain behavior of your code.
Note
Null