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

Github API integration fix and previous job empty commit list fix #144

Closed xloypaypa closed 1 year ago

xloypaypa commented 1 year ago

Github API integration fix

According to this doc: https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28 the since and until should be ISO string instead of a long number.

So the change just updated the CommitService. After this change, it only accept the ZonedDateTime for the time range.

previous job empty commit list fix

In PipelineCommitService.getCommitsBetweenPeriodPerBranch when then commit of previous build is empty, then previousRunZonedDateTime will be null. So the current build will fetch all commit from github again.

So the change make will use the build run time as the previousRunZonedDateTime if the commit of build is empty

codecov-commenter commented 1 year ago

Codecov Report

Base: 93.13% // Head: 93.16% // Increases project coverage by +0.02% :tada:

Coverage data is based on head (49f4daa) compared to base (653c050). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #144 +/- ## ========================================== + Coverage 93.13% 93.16% +0.02% ========================================== Files 97 97 Lines 4591 4591 Branches 278 278 ========================================== + Hits 4276 4277 +1 Misses 177 177 + Partials 138 137 -1 ``` | [Impacted Files](https://codecov.io/gh/thoughtworks/metrik/pull/144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thoughtworks) | Coverage Δ | | |---|---|---| | [...ject/domain/service/githubactions/CommitService.kt](https://codecov.io/gh/thoughtworks/metrik/pull/144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thoughtworks#diff-YmFja2VuZC9zcmMvbWFpbi9rb3RsaW4vbWV0cmlrL3Byb2plY3QvZG9tYWluL3NlcnZpY2UvZ2l0aHViYWN0aW9ucy9Db21taXRTZXJ2aWNlLmt0) | `87.23% <100.00%> (+0.27%)` | :arrow_up: | | [...ain/service/githubactions/PipelineCommitService.kt](https://codecov.io/gh/thoughtworks/metrik/pull/144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thoughtworks#diff-YmFja2VuZC9zcmMvbWFpbi9rb3RsaW4vbWV0cmlrL3Byb2plY3QvZG9tYWluL3NlcnZpY2UvZ2l0aHViYWN0aW9ucy9QaXBlbGluZUNvbW1pdFNlcnZpY2Uua3Q=) | `98.24% <100.00%> (+1.69%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thoughtworks). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thoughtworks)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.