Skip to content

feat: 新增不需 API Key 的重大變更摘要模式(繁體中文輸出) - #11

Merged
hondayaya123 merged 2 commits into
mainfrom
copilot/add-significant-change-summary-mode
Apr 4, 2026
Merged

feat: 新增不需 API Key 的重大變更摘要模式(繁體中文輸出)#11
hondayaya123 merged 2 commits into
mainfrom
copilot/add-significant-change-summary-mode

Conversation

Copilot AI commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

摘要

在不需要 OpenAI API Key / 不需要額外付費的前提下,新增「精簡摘要模式」,讓每週報告只列重大變更,並以繁體中文固定格式輸出。


變更說明

config.json

  • 新增 compact_summary: true(預設 true
    • true → 使用新的精簡摘要模式(無需 LLM)
    • false → 使用原本的完整報告模式

scripts/watch_dog.py

新增輔助函式

函式 說明
_is_major_version_bump(tag) 判斷 tag 是否為 major version 升級(vX.0.0)
_compute_severity(title, labels) 依關鍵字計算嚴重性分數(security/CVE=3, breaking=2, deprecate/remove/migration=1)
_item_severity(item, type) 對 release/PR/issue 計算嚴重性
filter_critical_changes(releases, prs, issues) 過濾並依嚴重性排序重大變更(最多 10 條)
_get_impact_and_action(item, type, severity) 規則式推導「影響」與「我需要做」說明
_generate_risks(critical, releases) 生成最多 3 條風險與注意事項
_generate_actions(critical, ...) 生成 3 條建議行動 checklist
build_compact_report(watch_repos, token, since) 輸出固定格式繁體中文精簡報告

重大變更判定關鍵字

breakingsecurityCVEdeprecateremovemigrationpriority/highbreaking change;或 release tag 為 major version bump(vX.0.0)。

輸出格式(compact_summary: true

# 📦 RepoWatchDog 週報摘要

一句話總結(本週共 N 項更新,發現 X 項安全性問題 / Y 項破壞性變更)

## 🔥 重大變更
### 1. [🔴 安全] Security patch CVE-2024-9999
- **影響:** 存在安全漏洞,可能影響系統安全性
- **我需要做:** 立即更新至最新版本,並確認系統是否受到影響
- **參考連結:** [owner/repo](https://github.com/...)

## 🛡️ 風險與注意事項
1. 存在安全漏洞,若未及時修補可能導致系統遭受攻擊或資料外洩

## ✅ 建議行動
- [ ] 優先安裝含安全修補的最新版本
- [ ] 閱讀破壞性變更的 migration guide
- [ ] 定期檢視相依套件版本

main() 分派邏輯

  • compact_summary: true → 呼叫 build_compact_report()
  • compact_summary: false → 呼叫原有 build_report()(含 LLM 選項)

tests/test_watch_dog.py

  • 新增 19 個測試涵蓋所有新函式
  • 修正既有測試 test_lookback_days_env_override:在測試 config 中補上 compact_summary: false,確保繼續測試 build_report 路徑
  • 全部 53 個測試通過

如何手動觸發 Workflow 觀看新摘要結果

  1. 前往 ActionsWeekly Repo Summary Report
  2. 點選右上角 Run workflow
  3. 選填 lookback_days(留空預設 7 天)
  4. 點選 Run workflow 執行

執行完成後會在 Issues 建立一個標題為 [RepoWatchDog] Weekly Summary YYYY-WNN 的 Issue,內容即為新格式的繁體中文精簡報告。

若要改回原本完整報告模式,只需將 config.json 中的 compact_summary 改為 false

Copilot AI and others added 2 commits April 4, 2026 14:00
…ion in Traditional Chinese

- Add `compact_summary` key to config.json (default: true)
- Add `_is_major_version_bump()`, `_compute_severity()`, `_item_severity()`
- Add `filter_critical_changes()` - rule-based filter for breaking/security/deprecation changes
- Add `build_compact_report()` - outputs fixed-format zh-TW report:
  - 一句話總結
  - 🔥 重大變更 (影響 / 我需要做 / 參考連結, max 10)
  - 🛡️ 風險與注意事項 (max 3)
  - ✅ 建議行動 checklist (3 items)
- Update main() to dispatch to compact or full report based on config
- Add 19 new unit tests covering all new functions
- Fix pre-existing test to set compact_summary: false so it keeps testing build_report

Agent-Logs-Url: https://github.com/hondayaya123/RepoWatchDog/sessions/205f3043-436e-4372-8189-212c75e821dd

Co-authored-by: hondayaya123 <50391999+hondayaya123@users.noreply.github.com>
…rename patch_ var, extract join variable

Agent-Logs-Url: https://github.com/hondayaya123/RepoWatchDog/sessions/205f3043-436e-4372-8189-212c75e821dd

Co-authored-by: hondayaya123 <50391999+hondayaya123@users.noreply.github.com>
Copilot AI requested a review from hondayaya123 April 4, 2026 14:03
@hondayaya123
hondayaya123 marked this pull request as ready for review April 4, 2026 14:21
@hondayaya123
hondayaya123 merged commit dbb274c into main Apr 4, 2026
1 check passed
@hondayaya123
hondayaya123 deleted the copilot/add-significant-change-summary-mode branch April 4, 2026 14:23
@hondayaya123
hondayaya123 restored the copilot/add-significant-change-summary-mode branch April 4, 2026 14:23
@hondayaya123
hondayaya123 deleted the copilot/add-significant-change-summary-mode branch April 4, 2026 14:30
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