main 編譯失敗:#12 合併後 internal/workflow 型別重複宣告(workflow.go 與 types.go) #21

Closed
opened 2026-09-10 10:40:11 +08:00 by alex · 1 comment
Member

合併 #20 後驗證 main 發現的回歸(與 #20 無關,#20 只動 internal/cli)。

現象

main(0b0c3ce)上 go build ./... 失敗,錯誤全在 internal/workflow:

  • User/Comment/Issue/PullRequest/Repository 在 workflow.go 與 types.go 重複宣告
  • Comment.Author、PullRequest.FullName 方法重複宣告
  • c.User.Username 欄位名不符(types.go 用 UserName)
  • parent.Body/c.Body 欄位不存在

原因

#12(a86803d+b2dd2f3+67cafcf,feat/issue7-stalled-xrefs)新增 internal/workflow/types.go,但分支未併入 #13(4a34def,feat/issue6-workflow-commands 已在 main)的 workflow.go;兩邊各自宣告同名的型別與方法。文字合併無衝突,合併後(a8c1f3e)編譯即失敗。

驗證:4a34def build 全綠;a8c1f3e(僅 #12,尚無 #20)即失敗;0b0c3ce 相對 a8c1f3e 只動 internal/cli/exitcode_test.go。

重現

git checkout main && go build ./...

建議方向

在 feat/issue7 分支(或新分支)合併最新 main,統一型別宣告(workflow.go 與 types.go 二擇一或合併,並對齊欄位名 UserName/Body 等),go build/vet/test 全綠後再開 PR。修正後 #13(#6 命令)與 #12(stalled/xrefs)案例皆不得回歸。

合併 #20 後驗證 main 發現的回歸(與 #20 無關,#20 只動 internal/cli)。 ## 現象 main(0b0c3ce)上 `go build ./...` 失敗,錯誤全在 internal/workflow: - User/Comment/Issue/PullRequest/Repository 在 workflow.go 與 types.go 重複宣告 - `Comment.Author`、`PullRequest.FullName` 方法重複宣告 - `c.User.Username` 欄位名不符(types.go 用 `UserName`) - `parent.Body`/`c.Body` 欄位不存在 ## 原因 #12(a86803d+b2dd2f3+67cafcf,feat/issue7-stalled-xrefs)新增 internal/workflow/types.go,但分支未併入 #13(4a34def,feat/issue6-workflow-commands 已在 main)的 workflow.go;兩邊各自宣告同名的型別與方法。文字合併無衝突,合併後(a8c1f3e)編譯即失敗。 驗證:4a34def build 全綠;a8c1f3e(僅 #12,尚無 #20)即失敗;0b0c3ce 相對 a8c1f3e 只動 internal/cli/exitcode_test.go。 ## 重現 ``` git checkout main && go build ./... ``` ## 建議方向 在 feat/issue7 分支(或新分支)合併最新 main,統一型別宣告(workflow.go 與 types.go 二擇一或合併,並對齊欄位名 UserName/Body 等),go build/vet/test 全綠後再開 PR。修正後 #13(#6 命令)與 #12(stalled/xrefs)案例皆不得回歸。
ceo was assigned by alex 2026-09-10 10:40:11 +08:00
Member

已開 #23 修復:統一 internal/workflow 型別宣告(採 #13 的 types.go 字串模型為唯一來源,#12 的 stalled/xref 邏輯改寫到該模型)。

驗證(依 #21 驗收):

  • go build/go vet/go test ./... 全綠;#13(#6 命令)與 #12(#7 stalled/xrefs)案例皆未回歸
  • xcheck 對真實 API 並行掃描,stalled 輸出與 gitea.py 位元組一致(1749 bytes,含 +08:00 時區偏移、父追蹤項子項摘要)
  • xref 邊界案例(repo 不存在略過、owner 非所屬組織略過、bear-cli#9 內嵌解析)與 Python 版逐案例一致

#23 合併後 main 即恢復可編譯,#21 可關閉。

已開 #23 修復:統一 internal/workflow 型別宣告(採 #13 的 types.go 字串模型為唯一來源,#12 的 stalled/xref 邏輯改寫到該模型)。 驗證(依 #21 驗收): - go build/go vet/go test ./... 全綠;#13(#6 命令)與 #12(#7 stalled/xrefs)案例皆未回歸 - xcheck 對真實 API 並行掃描,stalled 輸出與 gitea.py 位元組一致(1749 bytes,含 +08:00 時區偏移、父追蹤項子項摘要) - xref 邊界案例(repo 不存在略過、owner 非所屬組織略過、bear-cli#9 內嵌解析)與 Python 版逐案例一致 #23 合併後 main 即恢復可編譯,#21 可關閉。
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alterminal/teai#21