Skip to content

feat: Merged PRs tracking, issue label filtering, AI summary, and commit activity stats - #8

Merged
hondayaya123 merged 1 commit into
mainfrom
copilot/enhance-repowatchdog-weekly-report
Apr 4, 2026
Merged

feat: Merged PRs tracking, issue label filtering, AI summary, and commit activity stats#8
hondayaya123 merged 1 commit into
mainfrom
copilot/enhance-repowatchdog-weekly-report

Conversation

Copilot AI commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Enhances the weekly report from a basic releases+issues dump into a high-signal digest of meaningful technical activity, with four new capabilities added to scripts/watch_dog.py.

New functions

  • fetch_merged_prs()GET /pulls?state=closed&sort=updated&direction=desc, filtered to merged_at > since; renders a 🔀 Merged PRs section (number, title, link, merge date, author)
  • fetch_commit_stats()GET /commits?since=…; renders a 📊 開發活躍度 section with total commit count and top-3 contributor breakdown
  • generate_ai_summary() — aggregates releases, PRs, and issues across all watched repos into a prompt sent to gpt-4o-mini via https://models.inference.ai.azure.com using GITHUB_TOKEN; prepends a ≤150-character Traditional-Chinese summary to the report; fails silently

Modified

  • fetch_issues() — accepts important_labels: list[str] | None; non-empty list filters to issues carrying at least one matching label; empty list/None preserves original show-all behaviour
  • build_report() — collects all repo data upfront (required for cross-repo AI aggregation), then renders sections: AI summary → Merged PRs → Releases → Important Issues → Commit stats; new optional params important_labels and ai_summary
  • main() — reads important_labels and ai_summary from config.json

Config additions

{
  "important_labels": ["bug", "enhancement", "breaking change", "priority/high"],
  "ai_summary": true
}

important_labels: [] disables filtering (backward-compatible default).

Dependencies

openai>=1.0.0 added to requirements.txt. The OpenAI import is wrapped in try/except ImportError so the module loads cleanly without the package (AI summary returns None).

Tests

19 new unit tests added (29 total); all existing tests updated to supply mock responses for the two additional API calls per repo (/pulls, /commits).

@hondayaya123
hondayaya123 marked this pull request as ready for review April 4, 2026 08:40
@hondayaya123
hondayaya123 merged commit cc65145 into main Apr 4, 2026
1 check passed
@hondayaya123
hondayaya123 deleted the copilot/enhance-repowatchdog-weekly-report branch April 4, 2026 10:41
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