Merge pull request #186 from claude-bot-andresmgsl/build/184-blocked-by-union
fix: blocked_reference_records unions every Blocked by clause (#184)
This commit is contained in:
commit
d9c5b92dd1
3 changed files with 50 additions and 17 deletions
|
|
@ -177,27 +177,37 @@ issue_references() { # text on stdin -> LOCAL/CROSS<TAB>reference
|
||||||
}
|
}
|
||||||
|
|
||||||
blocked_reference_records() { # body on stdin -> classified reference records
|
blocked_reference_records() { # body on stdin -> classified reference records
|
||||||
# Dependency declarations sometimes soft-wrap after a comma. Continue
|
# Every occurrence of the marker contributes a clause. Binding to the first
|
||||||
# through the first sentence terminator; if prose omits one, conservatively
|
# occurrence alone dropped the later sentences of a repeated declaration
|
||||||
# retain later references so ambiguity can keep an issue blocked, never
|
# ("Blocked by #152. Blocked by #153. Blocked by #148 — …") and let earlier
|
||||||
# promote it prematurely.
|
# prose that merely mentioned being blocked hijack the parse — the false
|
||||||
|
# `ready` promotion on rig#154 (#184). Each clause runs to its own first
|
||||||
|
# sentence terminator; declarations sometimes soft-wrap after a comma, so
|
||||||
|
# an open clause continues across lines, and if prose omits the terminator
|
||||||
|
# it retains to end of input. Unioning can over-retain — prose like "this
|
||||||
|
# was blocked by #9 before the split" now contributes #9 — and that is the
|
||||||
|
# correct direction of error: a stale `blocked` is a triage comment away,
|
||||||
|
# a false `ready` sends a builder into work that cannot merge (#184).
|
||||||
awk '
|
awk '
|
||||||
|
BEGIN { marker = "blocked by" }
|
||||||
{
|
{
|
||||||
line = $0
|
line = $0
|
||||||
lower = tolower(line)
|
while (1) {
|
||||||
if (!active) {
|
if (!active) {
|
||||||
marker = "blocked by"
|
start = index(tolower(line), marker)
|
||||||
start = index(lower, marker)
|
|
||||||
if (!start) next
|
if (!start) next
|
||||||
line = substr(line, start + length(marker))
|
line = substr(line, start + length(marker))
|
||||||
active = 1
|
active = 1
|
||||||
}
|
}
|
||||||
if (line ~ /[.;]/) {
|
if (match(line, /[.;]/)) {
|
||||||
sub(/[.;].*/, "", line)
|
print substr(line, 1, RSTART - 1)
|
||||||
|
line = substr(line, RSTART + 1)
|
||||||
|
active = 0
|
||||||
|
} else {
|
||||||
print line
|
print line
|
||||||
exit
|
next
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print line
|
|
||||||
}
|
}
|
||||||
' | issue_references
|
' | issue_references
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
changelog.d/184.md
Normal file
6
changelog.d/184.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- `blocked_reference_records` unions every `Blocked by` clause in the body
|
||||||
|
instead of binding to the first marker occurrence — a repeated declaration
|
||||||
|
no longer promotes on its first sentence alone, and earlier prose that
|
||||||
|
merely mentions being blocked no longer hijacks the parse (#184).
|
||||||
|
|
@ -142,6 +142,23 @@ check "slash-adjacent local references survive" 0 $'14\n15' \
|
||||||
blocked_references <<<"Blocked by #14/#15."
|
blocked_references <<<"Blocked by #14/#15."
|
||||||
check "comma-adjacent local references survive" 0 $'11\n12' \
|
check "comma-adjacent local references survive" 0 $'11\n12' \
|
||||||
blocked_references <<<"Blocked by #11, #12."
|
blocked_references <<<"Blocked by #11, #12."
|
||||||
|
# A repeated declaration contributes every sentence, not just the first —
|
||||||
|
# rig#154's body promoted on `#152` alone while #153 and #148 were open (#184).
|
||||||
|
body="Part of #151. Blocked by #152. Blocked by #153. Blocked by #148 — the registry PR merges under landed governance. Blocks #155."
|
||||||
|
check "repeated blocker sentences all contribute" 0 "" test \
|
||||||
|
"$(blocked_references <<<"$body")" = $'148\n152\n153'
|
||||||
|
body=$'Note: restored because it is blocked by an operator act. See below.\nBlocked by #152, #153, #148.'
|
||||||
|
check "earlier blocked-by prose does not hijack the declaration" 0 "" test \
|
||||||
|
"$(blocked_references <<<"$body")" = $'148\n152\n153'
|
||||||
|
body=$'This was blocked by #9 before the split.\nBlocked by #12.'
|
||||||
|
check "prose refs are retained beside the declaration, never substituted" 0 "" test \
|
||||||
|
"$(blocked_references <<<"$body")" = $'9\n12'
|
||||||
|
repeated_refs="$(blocked_references <<<"Blocked by #152. Blocked by #153.")"
|
||||||
|
check "repeated declaration with one open blocker keeps issue blocked" 0 "KEEP" \
|
||||||
|
blocked_decision "$repeated_refs" $'CLOSED\nOPEN'
|
||||||
|
check "cross-repo ref in a later clause still flags" 0 "FLAG_CROSS_REPO" \
|
||||||
|
blocked_decision "12" "CLOSED" \
|
||||||
|
"$(blocked_cross_references <<<"Blocked by #12. Blocked by rig#7.")"
|
||||||
check "open blocker keeps issue blocked" 0 "KEEP" blocked_decision "$refs" $'CLOSED\nOPEN'
|
check "open blocker keeps issue blocked" 0 "KEEP" blocked_decision "$refs" $'CLOSED\nOPEN'
|
||||||
check "all closed blockers release issue" 0 "READY" blocked_decision "$refs" $'CLOSED\nCLOSED'
|
check "all closed blockers release issue" 0 "READY" blocked_decision "$refs" $'CLOSED\nCLOSED'
|
||||||
check "missing blocked declaration is flagged" 0 "FLAG_UNPARSEABLE" blocked_decision "" ""
|
check "missing blocked declaration is flagged" 0 "FLAG_UNPARSEABLE" blocked_decision "" ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue