Skip to content

Commit

Permalink
Fix: Issue 33 comments conducted error (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSim93 committed Apr 11, 2024
1 parent 407e2ca commit 616dd1a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pull request analytics action

![Version](https://img.shields.io/badge/version-2.2.4-blue) ![License](https://img.shields.io/badge/license-MIT-green)
![Version](https://img.shields.io/badge/version-2.2.5-blue) ![License](https://img.shields.io/badge/license-MIT-green)

**pull-request-analytics-action**: A powerful tool for analyzing the effectiveness of both teams and individual developers. This action generates reports based on data from pull requests, code reviews, and comments, enabling you to identify your team's strengths as well as areas needing improvement. The statistics collected by this GitHub Action can be displayed in the form of tables and graphs or passed on for further operations as markdown or a data collection.

Expand Down
6 changes: 6 additions & 0 deletions build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pull-request-analytics-action",
"version": "2.2.4",
"version": "2.2.5",
"description": "Generates detailed PR analytics reports within GitHub, focusing on review efficiency and team performance.",
"main": "build/index.js",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions src/converters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ type Discussion = {
};

export type Collection = {
opened: number;
closed: number;
additions: number;
deletions: number;
merged: number;
opened?: number;
closed?: number;
additions?: number;
deletions?: number;
merged?: number;
median?: TimelinePoints;
percentile?: TimelinePoints;
average?: TimelinePoints;
Expand All @@ -58,8 +58,8 @@ export type Collection = {
timeToReview?: number[];
timeToApprove?: number[];
timeToMerge?: number[];
comments: number;
totalReviewComments: number;
comments?: number;
totalReviewComments?: number;
reviewComments?: number;
reviewRequestsConducted?: number;
reviewsConducted?: {
Expand Down
6 changes: 6 additions & 0 deletions src/converters/utils/prepareDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ export const prepareDiscussions = (
comments[index]?.forEach((comment) => {
const userLogin = comment.user?.login || invalidUserLogin;
if (pullRequestLogin !== userLogin) {
if (!collection[userLogin]) {
collection[userLogin] = {};
}
if (!collection[userLogin][key]) {
collection[userLogin][key] = {};
}
collection[userLogin][key].commentsConducted =
(collection[userLogin][key].commentsConducted || 0) + 1;
collection.total[key].commentsConducted =
Expand Down

0 comments on commit 616dd1a

Please sign in to comment.