Skip to content

feat: Switch BAD Issues/MRs to assignee-based queries and add issue tracking metrics

DALIBOINA SATISH requested to merge bad-issues into feature-final

Summary

Enhanced the BAD Issues and BAD MRs analysis to fetch data based on assignee instead of author, and added comprehensive issue tracking metrics including total assigned and opened issues.

Changes Made

Backend Changes (gitlab_utils/client.py):

  • Assignee-based queries: Updated _fetch_user_issues() and _fetch_user_mrs() to support both author_id and assignee_id filters via new issue_scope and mr_scope parameters
  • Issue metrics expansion:
    • Added Total Assigned and Opened Issues tracking to _ZERO_ISSUE_ROW
    • Added is_opened flag to _evaluate_single_issue() to differentiate opened vs closed issues
  • Removed improper description:
    • Removed improper_desc flag from MR and issue evaluation logic
    • Removed analyze_description() import (no longer needed)
    • Cleaned up both _ZERO_ROW and _ZERO_ISSUE_ROW templates

Frontend - BAD Issues (modes/bad_issue.py):

  • Updated summary metrics to display 4 columns: Total Assigned, Opened Issues, Closed Issues, Total Users
  • Enhanced single-user metrics display with assigned/opened/closed breakdown
  • Updated Excel export to include new metrics: Total Assigned, Total Opened, Total Closed Issues
  • Removed "Improper Desc" from all UI components and reports
  • Reorganized metrics display for better readability

Frontend - BAD MRs (modes/bad_mrs_batch.py):

  • Updated docstring to reflect assignee-based API endpoint
  • Modified cached_batch_evaluate_mrs() and cached_single_user_mrs() to use mr_scope="assignee"
  • Updated Excel export summary to remove "Improper Desc"
  • Updated single-user metrics display with new metric layout

Benefits

Focus on assigned work instead of authored items (better reflects workload) Clearer picture of open vs closed issues per user Simplified quality checks by removing subjective "improper description" metric Better alignment with team productivity tracking

Testing

  • Verify BAD Issues report shows Total Assigned, Opened, and Closed counts
  • Verify single user metrics display correctly for both assigned issues and MRs
  • Verify Excel exports include all new metrics
  • Confirm no "Improper Desc" appears in any reports

Related Issues

Merge request reports

Loading