feat/gitea-comment-pagination/main #78

Merged
admin merged 3 commits from feat/gitea-comment-pagination/main into master 2026-09-22 06:54:19 +00:00
Member

摘要

修正 Gitea 議題留言跨頁讀取,改由 timeline 取得完整留言集合。

需求議題

需求議題未能由工作包抽取契約帶出;本變更直接處理工作包 #74 指定的 Gitea 留言讀取問題。

工作包議題

#74 [工作包 G] Gitea 留言跨頁讀取

變更內容

  • listIssueComments 改讀 /issues/{index}/timeline,逐頁篩選 comment 事件並以留言 id 去重。
  • issue extract、work package extract、comments merge、PR comments、PR reply 與 PR watch 共用新的留言 iterator。
  • 更新 dry-run 預覽端點與測試 fixture,補上超過 50 則、重複事件與 timeline 錯誤測試。

設計重點

沿用既有 pages 分頁與 HTTP 錯誤契約;只把 timeline 的 comment 事件交給既有留言處理,保留 reaction、留言驗證與 PR review timeline 的既有規則。

解決的問題

Gitea 議題 comments 端點無法可靠套用預期的 page/limit,超過 50 則時會遺失留言。Timeline 分頁可取得完整事件集合,並避免跨頁重複事件造成未處理數誤計。

影響的功能

issue extract、work package extract、comments merge、PR comments、PR reply、PR watch。

測試結果

  • node --test test/issue-extract.test.js test/comments-merge.test.js test/pr-comments.test.js test/pr-reply.test.js test/pr-watch.test.js:111 passed, 0 failed。
  • npm test:541 passed, 1 failed;唯一失敗為既有 test/bin-entry.test.js 依賴 npm pack JSON 陣列格式,現行 npm 回傳物件,與本次留言變更無關。
  • 實際查證 Gitea /repos/plugins/tea-sdlc/issues/74/timeline?page=1&limit=1 回傳分頁事件;同參數的 /comments 回傳空集合。
## 摘要 修正 Gitea 議題留言跨頁讀取,改由 timeline 取得完整留言集合。 ## 需求議題 需求議題未能由工作包抽取契約帶出;本變更直接處理工作包 #74 指定的 Gitea 留言讀取問題。 ## 工作包議題 #74 [工作包 G] Gitea 留言跨頁讀取 ## 變更內容 - `listIssueComments` 改讀 `/issues/{index}/timeline`,逐頁篩選 `comment` 事件並以留言 id 去重。 - issue extract、work package extract、comments merge、PR comments、PR reply 與 PR watch 共用新的留言 iterator。 - 更新 dry-run 預覽端點與測試 fixture,補上超過 50 則、重複事件與 timeline 錯誤測試。 ## 設計重點 沿用既有 `pages` 分頁與 HTTP 錯誤契約;只把 timeline 的 `comment` 事件交給既有留言處理,保留 reaction、留言驗證與 PR review timeline 的既有規則。 ## 解決的問題 Gitea 議題 comments 端點無法可靠套用預期的 page/limit,超過 50 則時會遺失留言。Timeline 分頁可取得完整事件集合,並避免跨頁重複事件造成未處理數誤計。 ## 影響的功能 issue extract、work package extract、comments merge、PR comments、PR reply、PR watch。 ## 測試結果 - `node --test test/issue-extract.test.js test/comments-merge.test.js test/pr-comments.test.js test/pr-reply.test.js test/pr-watch.test.js`:111 passed, 0 failed。 - `npm test`:541 passed, 1 failed;唯一失敗為既有 `test/bin-entry.test.js` 依賴 npm pack JSON 陣列格式,現行 npm 回傳物件,與本次留言變更無關。 - 實際查證 Gitea `/repos/plugins/tea-sdlc/issues/74/timeline?page=1&limit=1` 回傳分頁事件;同參數的 `/comments` 回傳空集合。
jiantw83 added 2 commits 2026-09-22 06:38:10 +00:00
Gitea 議題留言端點無法可靠處理分頁;改由 timeline 逐頁篩選 comment 事件並去重,讓抽取、整併與 PR 留言流程取得完整集合。
Gitea 議題留言端點無法可靠處理分頁;改由 timeline 逐頁篩選 comment 事件並去重,讓抽取、整併與 PR 留言流程取得完整集合。
jiantw83 added 1 commit 2026-09-22 06:39:02 +00:00
留言共用 iterator 已改走 timeline,預覽只列一次該端點,避免把端點種類誤報成重複請求。
admin approved these changes 2026-09-22 06:54:15 +00:00
admin merged commit 8222a4043e into master 2026-09-22 06:54:19 +00:00
admin deleted branch feat/gitea-comment-pagination/main 2026-09-22 06:54:20 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: plugins/tea-sdlc#78