Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 29, 2025

  • Add HIDE_PR_STATISTICS configuration flag (default True) to config.py
  • Add pr_comment_count field to IssueWithMetrics class
  • Create pr_comments.py module to count comments on PRs (excluding bots)
  • Add PR comment statistics calculation functions (mean, median, 90th percentile)
  • Integrate PR comment counting in get_per_issue_metrics for pull requests only
  • Update markdown_writer.py to display PR comment statistics when not hidden
  • Update json_writer.py to include PR comment statistics in output
  • Document HIDE_PR_STATISTICS in README.md
  • Add comprehensive tests for the new functionality
  • Run security and lint checks
  • Address code review feedback: improve type annotations and remove side effects
  • Fix markdown formatting with prettier
Original prompt

This section details on the original issue you should resolve

<issue_title>Number of comments on PRs</issue_title>
<issue_description>### Is your feature request related to a problem?

I think a metric that will often scale with how long a PR is open for is the number of comments on a PR.
More comments suggests either a large number of changes that need to be made OR some async back-and-forth that may be better resolved with a call.

Describe the solution you'd like

In the report I would like to see some of the following (excluding bot comments):

  • Mean number of comments per PR.
  • Median number of comments per PR.
  • 90th percentile number of comments per PR.
  • Number of comments on each PR.

Describe alternatives you've considered

No response

Additional context

No response</issue_description>

<agent_instructions>Lets add these desired pull request statistics but put them all behind a configuration flag called HIDE_PR_STATISTICS and have it set to true by default. Be sure to also document all this in the README.md.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@zkoppert Sounds awesome! Looks like this would be both a per PR metric and then have the overall stats as well.
Fixes #534

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 29, 2025 01:21
…guration

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
…e effects

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Number of comments on PRs Add PR comment statistics behind HIDE_PR_STATISTICS configuration flag Sep 29, 2025
@Copilot Copilot AI requested a review from zkoppert September 29, 2025 01:29
Copilot finished work on behalf of zkoppert September 29, 2025 01:29
@zkoppert zkoppert changed the title Add PR comment statistics behind HIDE_PR_STATISTICS configuration flag feat: Add PR comment statistics behind HIDE_PR_STATISTICS configuration flag Sep 29, 2025
@zkoppert zkoppert marked this pull request as ready for review September 29, 2025 15:55
@zkoppert zkoppert requested a review from a team as a code owner September 29, 2025 15:55
@Copilot Copilot AI review requested due to automatic review settings September 29, 2025 15:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a PR comment statistics feature that can be toggled via the HIDE_PR_STATISTICS configuration flag. The feature displays mean, median, and 90th percentile comment counts for pull requests, helping identify PRs that may need attention due to high comment activity.

Key Changes:

  • Adds a new pr_comments.py module for counting PR comments (excluding bot comments and ignored users)
  • Extends configuration system with HIDE_PR_STATISTICS environment variable (defaults to true)
  • Integrates PR comment statistics into both Markdown and JSON output formats

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pr_comments.py New module implementing PR comment counting and statistics functions
config.py Adds HIDE_PR_STATISTICS configuration option to environment variables
classes.py Extends IssueWithMetrics class with pr_comment_count field
issue_metrics.py Integrates PR comment counting into metrics collection pipeline
markdown_writer.py Updates Markdown output to include PR comment statistics and individual counts
json_writer.py Updates JSON output to include PR comment statistics
README.md Documents the new HIDE_PR_STATISTICS configuration option
test_*.py Comprehensive test coverage for new functionality and updates to existing tests

Copilot finished work on behalf of zkoppert September 29, 2025 16:12
@zkoppert
Copy link
Member

@copilot can you fix the failing actions on this pr by running prettier on the markdown files and making the proper fixes?

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 29, 2025

@copilot can you fix the failing actions on this pr by running prettier on the markdown files and making the proper fixes?

Fixed the markdown formatting by running prettier on all markdown files. The README.md table formatting has been corrected. Commit: c69f8d2

Copilot finished work on behalf of zkoppert September 29, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Number of comments on PRs
2 participants