[WIP] Consolidate changes from non-main branches into main - #9
Merged
Conversation
… per-repo summary via OpenAI API Integrates the one unique commit from `copilot/summarize-recent-changes` that was not yet in `main` (feat: LLM-powered weekly summary using OpenAI Chat API). Changes: - scripts/watch_dog.py: add OPENAI_API_URL constants, _build_llm_prompt, summarize_with_llm functions; extend build_report() with llm_config/llm_api_key params for optional per-repo LLM summarization; read OPENAI_API_KEY in main() - config.json: add 'llm' section (model, tech_stack, focus_areas) - .github/workflows/weekly_report.yml: pass OPENAI_API_KEY secret to workflow - tests/test_watch_dog.py: add 5 new LLM tests (34 total, all passing) Agent-Logs-Url: https://github.com/hondayaya123/RepoWatchDog/sessions/19fa0160-40bb-4b50-b943-2a9d92e7eba3 Co-authored-by: hondayaya123 <50391999+hondayaya123@users.noreply.github.com>
hondayaya123
marked this pull request as ready for review
April 4, 2026 10:39
Copilot stopped work on behalf of
hondayaya123 due to an error
April 4, 2026 10:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
copilot/summarize-recent-changeshas commits not inmainmaincopilot/summarize-recent-changeschanges into integration branchsummarize_with_llm()using direct OpenAI API callsllmsection toconfig.json(model, tech_stack, focus_areas)build_report()withllm_config/llm_api_keyparams for per-repo summarizationOPENAI_API_KEYenv var to GitHub Actions workflowOriginal prompt
Repository: hondayaya123/RepoWatchDog
Goal (newbie-friendly): consolidate all work into a single clean
mainbranch.Requirements:
main.copilot/*:main.main.mainwith a clear title and description summarizing what was consolidated.After PR is opened, do NOT delete branches automatically; just mention which branches appear fully integrated and are safe to delete later.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: 請問我現在這個 repo 裡面的程式 都已經merge了嗎? 我搞不清楚現在 main 跟其他分支的關係
Assistant: 目前看起來:你的主要功能(至少 PR #1、#2、#8)都已經 merge 進
main了,但 repo 裡還有 4 個copilot/...分支沒有合併進main(它們目前各自有不同的最新 commit)。下面我用「最具體的方式」把
main跟其他分支的關係講清楚(以你提供的 repo:hondayaya123/RepoWatchDog,預設分支是main)。1) 哪些東西「確定已經 merge 到 main」?
我查到 repo 目前有這些 PR,而且它們都是 closed 且有
merged_at時間(代表真的有 merge,不是只關掉):所以如果你問「repo 裡面的程式是不是都 merge 了?」——至少以 PR 流程進來的那幾個功能,是已經進
main了。2) 為什麼你會覺得搞不清楚?(
main跟其他分支的現況)你現在 repo 裡有 5 個分支:
maincopilot/enhance-repowatchdog-weekly-reportcopilot/fix-default-target-repocopilot/implement-watch-doe-featurecopilot/summarize-recent-changes我做
main...<branch>的比較時:copilot/summarize-recent-changes:是「有差異」的(代表它不是完全等同於 main)main不同,這通常表示 分支上還有 main 沒有的 commit,或是歷史不同。3) 你要怎麼自己快速確認「某分支是否已經完全合併到 main」?
你可以用這幾種方式(最準):
方法 A:看 GitHub UI(最直覺)
到
Pull requests頁面,看該分支對應的 PR 是否顯示 Merged。方法 B:用 git 指令(最準、最不會被 UI 誤導)
在本機 repo:
如果你看到
origin/copilot/xxx出現在清單裡,代表它的 commit 已經都在main裡了(等同於「已合併/已包含」)。再查某個特定分支是否已被包含:
0:該分支內容已被 main 包含1:還沒(分支有 main 沒有的東西)4) 我建議你下一步做什麼?
copilot/...分支?(例如copilot/summarize-recent-changes).../tree/copilot/summarize-recent-changes)。我就能幫你判斷每個分支到底是:
你想先從哪個分支開始釐清?
User: H:\githubProject\RepoWatchDog>git merge-base --is-ancestor origin/copilot/summarize-recent-changes origin/main
H:\githubProject\RepoWatchDog>echo $?
$?
Assistant: 你現在是在 Windows 的 cmd.exe(看起來是
H:\...>),所以echo $?這個寫法是 bash / zsh / Git Bash 才有的;在 cmd 裡它只會原樣印出$?,所以你看不到回傳碼。用下面其中一個方式查回傳碼就行:
方法 1:cmd.exe(你目前這個視窗)
請改用:
判讀:
%ERRORLEVEL%= 0 → 這個分支的內容 已經被 main 包含(等同「已 merge 進 main」或被其他 commit 吸收了)%ERRORLEVEL%= 1 → 還沒(分支上有 main 沒有的 commit)git fetch)方法 2:PowerShell
如果你是在 PowerShell,請用:
另外提醒:在跑前最好先更新遠端分支資訊:
你把
echo %ERRORLEVEL%的結果貼上來,我就能直接告訴你copilot/summarize-recent-changes到底算不算已經進main。User: H:\githubProject\RepoWatchDog>git merge-base --is-ancestor origin/copilot/summarize-recent-changes origin/main
H:\githubProject\RepoWatchDog>echo %ERRORLEVEL%
1
Assistant:
%ERRORLEVEL% = 1代表:origin/copilot/summarize-recent-changes這個分支「還沒有」被origin/main包含也就是說:那個分支上有一些 commit,
main目前沒有(所以不算已 merge 進 main)。這代表你現在的分支關係是什麼?
main:目前是你的預設/正式分支copilot/summarize-recent-changes:還有未合併的變更(需要開 PR 合併,或你手動 merge/cherry-pick)下一步我建議你做 2 個檢查(快速看差異與方向)
1) 看這個分支「領先 main 幾個 commit」
輸出會是兩個數字:
A BA= main 比分支多幾個 commitB= 分支比 main 多幾個 commit(這就是「還沒 merge 進 main」的數量)2) 直接看分支比 main 多了哪些 commit
...
This pull request was created from Copilot chat.