fix: dev-agent preflight treats ## Related refs as dependencies
The broad regex `(?:^|\n)\s*-\s*#\K[0-9]+` matched ANY bullet with #NNN, including ## Related sections. This caused #893 (and likely others) to be permanently blocked by sibling issues that aren't actual dependencies. Now only extracts deps from: - Inline 'depends on #NNN' / 'blocked by #NNN' phrases - ## Dependencies / ## Depends on / ## Blocked by sections This matches the same logic used by dev-poll.sh get_deps().
This commit is contained in:
parent
2fd18b086d
commit
5aa0b42481
1 changed files with 12 additions and 11 deletions
|
|
@ -142,18 +142,19 @@ log "Issue: ${ISSUE_TITLE}"
|
||||||
status "preflight check"
|
status "preflight check"
|
||||||
|
|
||||||
# Extract dependency references from issue body
|
# Extract dependency references from issue body
|
||||||
# Formats supported:
|
# Only from ## Dependencies / ## Depends on / ## Blocked by sections
|
||||||
# - Depends on #315
|
# and inline "depends on #NNN" / "blocked by #NNN" phrases.
|
||||||
# - depends on #315, #316
|
# NEVER extract from ## Related or other sections.
|
||||||
# - Blocked by #315
|
DEP_NUMBERS=""
|
||||||
# - Requires #315
|
|
||||||
# - ## Dependencies\n- #315\n- #316
|
|
||||||
DEP_NUMBERS=$(echo "$ISSUE_BODY" | \
|
|
||||||
grep -ioP '(?:depends on|blocked by|requires|after)\s+#\K[0-9]+|(?:^|\n)\s*-\s*#\K[0-9]+' | \
|
|
||||||
sort -un || true)
|
|
||||||
|
|
||||||
# Also extract from a ## Dependencies section (lines starting with - #NNN or - Depends on #NNN)
|
# 1. Inline phrases anywhere in body (explicit dep language only)
|
||||||
DEP_SECTION=$(echo "$ISSUE_BODY" | sed -n '/^## Dependencies/,/^## /p' | sed '1d;$d')
|
INLINE_DEPS=$(echo "$ISSUE_BODY" | \
|
||||||
|
grep -ioP '(?:depends on|blocked by)\s+#\K[0-9]+' | \
|
||||||
|
sort -un || true)
|
||||||
|
[ -n "$INLINE_DEPS" ] && DEP_NUMBERS="$INLINE_DEPS"
|
||||||
|
|
||||||
|
# 2. ## Dependencies / ## Depends on / ## Blocked by section (bullet items)
|
||||||
|
DEP_SECTION=$(echo "$ISSUE_BODY" | sed -n '/^##\?\s*\(Dependencies\|Depends on\|Blocked by\)/I,/^##/p' | sed '1d;$d')
|
||||||
if [ -n "$DEP_SECTION" ]; then
|
if [ -n "$DEP_SECTION" ]; then
|
||||||
SECTION_DEPS=$(echo "$DEP_SECTION" | grep -oP '#\K[0-9]+' | sort -un || true)
|
SECTION_DEPS=$(echo "$DEP_SECTION" | grep -oP '#\K[0-9]+' | sort -un || true)
|
||||||
DEP_NUMBERS=$(printf '%s\n%s' "$DEP_NUMBERS" "$SECTION_DEPS" | sort -un | grep -v '^$' || true)
|
DEP_NUMBERS=$(printf '%s\n%s' "$DEP_NUMBERS" "$SECTION_DEPS" | sort -un | grep -v '^$' || true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue