Skip to content

Aryan Quality Distribution Charts Backend#1899

Merged
one-community merged 2 commits intodevelopmentfrom
aryan_quality_distribution_charts_backend
Nov 20, 2025
Merged

Aryan Quality Distribution Charts Backend#1899
one-community merged 2 commits intodevelopmentfrom
aryan_quality_distribution_charts_backend

Conversation

@aryanrachala54
Copy link
Copy Markdown
Contributor

@aryanrachala54 aryanrachala54 commented Nov 14, 2025

Description

Screenshot 2025-11-18 111854

Related PRs (if any)

  • This backend PR is related to frontend PR #4389.
  • To test the backend PR, you may need to check out the corresponding frontend PR #4389.

Main changes explained

  • Updated the PR Quality Distribution component to append a new UI element (circle badge) next to each team name.
  • Added logic to fetch and display the number of members belonging to each team.
  • Updated chart label rendering to support custom JSX for team metadata.

How to test

  1. Check out the current branch.

  2. Run:

    • npm install
    • npm run build
    • npm start
  3. Start the frontend to load the updated UI.

  4. Clear site data / cache.

  5. Log in as an admin user.

  6. Navigate to:

    localhost:5173/pull-request-analytics/reviews-insight

  7. Set:

    • DurationAll Time
    • Team CodeAll Teams
  8. Observe the PR Quality Distribution section.

    • You should now see the number of team members displayed next to each team name in the pie chart.
    • While hovering over the graph, you should see a list of key–value pairs for all the colors in the pie chart.

Screenshots of changes

Screenshot 2025-11-18 112529

Copy link
Copy Markdown
Contributor

@Aditya-gam Aditya-gam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I followed the provided test plan (fresh install, cache cleared, logged in as owner) to verify this PR.
  • The PR successfully adds team member count functionality to the PR Quality Distribution endpoint.
  • All test cases pass (verified in test video), including basic requests returning memberCount correctly and edge cases (invalid duration, empty/missing params, non-existent teams) being handled appropriately.
  • The implementation correctly passes userProfile through the controller and router layers.
TestVideo.mov

Minor non-breaking Issues:

  1. Date mutation bug: now.setDate() and now.setMonth() mutate the Date object. While the current if-else structure prevents issues, this is fragile and could cause problems if the code is refactored.
  2. Missing null/undefined handling: If team._id is null or undefined, countDocuments may behave unexpectedly.
  3. Error handling in Promise.all: If any single countDocuments call fails, the entire Promise.all will reject, causing the whole request to fail.

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit 9d35930 into development Nov 20, 2025
1 check passed
@Anusha-Gali Anusha-Gali removed the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants