fix: dep check — trust closed state, drop merged-PR search
The merged-PR search was over-engineered and caused false negatives (couldn't match PR to issue when title/body didn't contain #NNN). Issue closed = dep satisfied. Factory only closes after merging.
This commit is contained in:
parent
d61dead3f1
commit
98210cc302
1 changed files with 4 additions and 18 deletions
|
|
@ -60,24 +60,10 @@ dep_is_merged() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check there's a merged PR for this issue.
|
# Issue closed = dep satisfied. The factory only closes issues after
|
||||||
# Strategy: search closed PRs for title/body containing "#NNN",
|
# merging, so closed state is trustworthy. No need to hunt for the
|
||||||
# OR check if a PR with the same number exists and is merged.
|
# specific PR — that was over-engineering that caused false negatives.
|
||||||
local has_merged
|
|
||||||
has_merged=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
|
|
||||||
"${API}/pulls?state=closed&limit=30" | \
|
|
||||||
jq -r --arg num "#${dep_num}" \
|
|
||||||
'[.[] | select(.merged == true) | select((.title | contains($num)) or (.body // "" | test("ixes " + $num + "\\b"; "i")))] | length')
|
|
||||||
|
|
||||||
if [ "${has_merged:-0}" -gt 0 ]; then
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
|
|
||||||
# Fallback: check if PR with same number is merged (Codeberg uses shared numbering)
|
|
||||||
local same_pr_merged
|
|
||||||
same_pr_merged=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
|
|
||||||
"${API}/pulls/${dep_num}" 2>/dev/null | jq -r '.merged // false')
|
|
||||||
[ "$same_pr_merged" = "true" ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue