fix: ALL_COMMENTS fetch is capped at limit=50 — watermark search may miss reviews on high-comment PRs (#100)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f4abe63b1b
commit
9fa4846581
4 changed files with 26 additions and 8 deletions
|
|
@ -112,8 +112,7 @@ inject_review_into_dev_session() {
|
|||
[ "${current_phase}" = "PHASE:awaiting_review" ] || return 0
|
||||
|
||||
local review_comment
|
||||
review_comment=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||
"${API_BASE}/issues/${pr_num}/comments?limit=50" | \
|
||||
review_comment=$(codeberg_api_all "/issues/${pr_num}/comments" | \
|
||||
jq -r --arg sha "${pr_sha}" \
|
||||
'[.[] | select(.body | contains("<!-- reviewed: " + $sha))] | last // empty') || true
|
||||
if [ -z "${review_comment}" ] || [ "${review_comment}" = "null" ]; then
|
||||
|
|
|
|||
|
|
@ -187,8 +187,7 @@ fi
|
|||
|
||||
# --- Check for existing reviews ---
|
||||
status "checking existing reviews"
|
||||
ALL_COMMENTS=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||
"${API_BASE}/issues/${PR_NUMBER}/comments?limit=50")
|
||||
ALL_COMMENTS=$(codeberg_api_all "/issues/${PR_NUMBER}/comments")
|
||||
|
||||
# Check review-comment watermarks — skip if a comment with <!-- reviewed: SHA --> exists
|
||||
COMMENT_REVIEWED=$(echo "$ALL_COMMENTS" | \
|
||||
|
|
@ -797,8 +796,7 @@ if [ "$FOLLOWUP_COUNT" -gt 0 ]; then
|
|||
FU_DETAILS=$(printf '%s' "$fu" | jq -r '.details')
|
||||
|
||||
# Check for duplicate
|
||||
EXISTING=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||
"${API_BASE}/issues?state=open&labels=tech-debt&limit=50" | \
|
||||
EXISTING=$(codeberg_api_all "/issues?state=open&labels=tech-debt" | \
|
||||
jq -r --arg t "$FU_TITLE" '[.[] | select(.title == $t)] | length')
|
||||
|
||||
if [ "${EXISTING:-0}" -gt 0 ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue