Skip to content
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

Fix: Issue 33 comments conducted error #34

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading