Skip to content

Conversation

@amargiovanni
Copy link
Contributor

Summary

  • Add comprehensive quality metrics calculation for Jira issues (10 metrics per issue)
  • Generate 3 new aggregated CSV exports: project, person, and issue-type summaries
  • Extend jira_issues_export.csv with 10 new metric columns
  • Implement changelog API integration for reopen tracking with graceful degradation

New CSV Exports

File Description
jira_issues_export.csv Extended with 10 quality metrics columns
jira_project_metrics.csv Per-project aggregations (14 columns)
jira_person_metrics.csv Per-assignee metrics (6 columns)
jira_type_metrics.csv Per-issue-type metrics (5 columns)

Issue-Level Metrics

  • cycle_time_days - Days from creation to resolution
  • aging_days - Days since creation for open issues
  • comments_count - Total number of comments
  • description_quality_score - Quality score 0-100 (length + AC + formatting)
  • acceptance_criteria_present - Given/When/Then, AC:, checkbox detection
  • comment_velocity_hours - Time to first comment
  • silent_issue - No comments exist
  • same_day_resolution - Resolved on creation day
  • cross_team_score - Collaboration score (0-100) based on distinct commenters
  • reopen_count - Status transitions from Done to non-Done

Test Plan

  • 665 unit tests passing
  • 92% code coverage
  • Integration tests for full metrics flow
  • Ruff linting clean
  • README documentation updated

Add comprehensive quality metrics calculation and export for Jira issues:

Issue-level metrics (10 new columns in jira_issues_export.csv):
- cycle_time_days: Days from creation to resolution
- aging_days: Days since creation for open issues
- comments_count: Total number of comments
- description_quality_score: Quality score 0-100 based on length, AC, formatting
- acceptance_criteria_present: Detection of Given/When/Then, AC:, checkboxes
- comment_velocity_hours: Time to first comment
- silent_issue: Issues with no comments
- same_day_resolution: Resolved on creation day
- cross_team_score: Collaboration score based on distinct commenters
- reopen_count: Status transitions from Done to non-Done

New aggregated CSV exports:
- jira_project_metrics.csv: Per-project aggregations (14 columns)
- jira_person_metrics.csv: Per-assignee metrics (6 columns)
- jira_type_metrics.csv: Per-issue-type metrics (5 columns)

Implementation details:
- MetricsCalculator class with TDD approach (665 tests, 92% coverage)
- JiraMetricsExporter for aggregated CSV exports
- get_issue_changelog() with graceful 403/404 degradation
- CLI integration: metrics auto-calculated with --sources jira
@gemini-code-assist
Copy link

Summary of Changes

Hello @amargiovanni, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Jira integration by introducing a robust system for calculating and exporting various quality metrics. It provides granular insights into individual issue quality, team performance, and project health through new and extended CSV reports. The changes aim to empower users with deeper analytical capabilities for their Jira data, covering aspects from issue lifecycle to collaboration patterns.

Highlights

  • Comprehensive Jira Quality Metrics: Implemented 10 new quality metrics per Jira issue, including cycle time, aging, description quality score, acceptance criteria presence, comment velocity, silent issue detection, same-day resolution, cross-team collaboration score, and reopen count.
  • New Aggregated CSV Exports: Introduced three new CSV files: jira_project_metrics.csv for per-project aggregations, jira_person_metrics.csv for per-assignee metrics, and jira_type_metrics.csv for per-issue-type metrics.
  • Extended Jira Issues Export: The existing jira_issues_export.csv has been extended with the 10 new issue-level quality metric columns, maintaining backward compatibility by appending them.
  • Jira Changelog API Integration: Integrated with the Jira changelog API to track issue reopens, with a robust graceful degradation mechanism for permission or not-found errors.
  • Extensive Documentation and Testing: Added comprehensive documentation including specification, data model, contracts, quickstart guide, research, and detailed task breakdown. New unit and integration tests ensure the accuracy and reliability of all new metrics and exports.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is an excellent and comprehensive pull request that adds significant value with the new Jira quality metrics. The implementation is well-structured, following a clear plan laid out in the specification documents. The code is robust, with good error handling (especially the graceful degradation for the changelog API) and thorough test coverage, including unit, integration, and fixture updates. I've included a few minor suggestions to improve maintainability by enhancing type specificity and reducing code duplication, but overall, this is a very high-quality contribution.


output.log("Fetching comments...", "info")
all_comments = []
issue_comments_map: dict[str, list] = {} # Map issue key to comments

Choose a reason for hiding this comment

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

medium

The type hint for issue_comments_map is dict[str, list], which is a bit vague. For better type safety and readability, you could use a more specific type like dict[str, list[JiraComment]]. A similar improvement can be made for issues_by_project on line 744 to dict[str, list[IssueMetrics]].

Suggested change
issue_comments_map: dict[str, list] = {} # Map issue key to comments
issue_comments_map: dict[str, list[JiraComment]] = {} # Map issue key to comments

Comment on lines +165 to +170
@staticmethod
def _format_float(value: float | None) -> str:
"""Format float with 2 decimal places, or empty string if None."""
if value is None:
return ""
return f"{value:.2f}"

Choose a reason for hiding this comment

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

medium

This _format_float static method is a duplicate of the one in jira_exporter.py. To avoid code duplication and ensure consistent formatting logic, consider moving this helper to a shared utility module (e.g., src/github_analyzer/exporters/utils.py) and importing it in both exporter files.

Add type annotation for changelog values return to satisfy mypy's
no-any-return check.
@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

❌ Patch coverage is 88.62876% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/github_analyzer/cli/main.py 0.00% 31 Missing ⚠️
src/github_analyzer/analyzers/jira_metrics.py 98.46% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Improve type safety by replacing generic `dict[str, list]` with
specific types `dict[str, list[JiraComment]]` and
`dict[str, list[IssueMetrics]]`.
@amargiovanni amargiovanni merged commit 0e71b7d into main Nov 29, 2025
5 of 6 checks passed
@amargiovanni amargiovanni deleted the 003-jira-quality-metrics branch November 29, 2025 13:19
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.

2 participants