thoughtworks / metrik

An easy-to-use, cross-platform measurement tool that pulls data out of CD pipelines and analysis the four key metrics for you.
MIT License
354 stars 87 forks source link

fix sync failed error when fetching commits of deleted branch #124

Closed ATPEEE closed 2 years ago

ATPEEE commented 2 years ago

Our team fix sync failed error when fetching commits of deleted branch as the following ideas: https://github.com/thoughtworks/metrik/issues/114#issuecomment-1140765521

Also, we refactor GithubPipelineService following the picture below: WeChatWorkScreenshot_b00388a9-c06f-413d-a35f-1a7afff5b586

We extract several services from GithubPipelineService to make it independent. Thus, we add some unit tests according to new services and fix GithubPipelineServiceTest.

codecov-commenter commented 2 years ago

Codecov Report

Merging #124 (2fe101a) into main (3b70143) will decrease coverage by 0.04%. The diff coverage is 94.01%.

@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
- Coverage   94.26%   94.22%   -0.05%     
==========================================
  Files          88       92       +4     
  Lines        4306     4344      +38     
  Branches      251      255       +4     
==========================================
+ Hits         4059     4093      +34     
- Misses        124      125       +1     
- Partials      123      126       +3     
Impacted Files Coverage Δ
...etrik/project/domain/repository/BuildRepository.kt 80.95% <ø> (ø)
...domain/service/githubactions/ExecutionConverter.kt 100.00% <ø> (ø)
...project/domain/service/githubactions/RunService.kt 88.57% <ø> (ø)
...t/infrastructure/github/feign/GithubFeignClient.kt 23.07% <ø> (ø)
...infrastructure/jenkins/feign/JenkinsFeignClient.kt 50.00% <ø> (ø)
...n/metrik/project/rest/SynchronizationController.kt 56.66% <ø> (ø)
...in/metrik/project/rest/validation/EnumValidator.kt 33.33% <0.00%> (ø)
...astructure/github/feign/response/BranchResponse.kt 50.00% <50.00%> (ø)
...ject/domain/service/githubactions/BranchService.kt 94.44% <94.44%> (ø)
...domain/service/githubactions/PipelineRunService.kt 94.44% <94.44%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1bbddbc...2fe101a. Read the comment docs.

kevinlzw commented 2 years ago

Approved

zhe-zhao commented 2 years ago

Hey @ATPEEE found a few conflicts after the last review. Could you please have a look?

ATPEEE commented 2 years ago

Hey @ATPEEE found a few conflicts after the last review. Could you please have a look?

Hi, because roujing forked my repo, so my changes has been involved in. please look at https://github.com/thoughtworks/metrik/pull/125 So I will close this PR.