framework tools/git: lookup-pipeline pipefail + provider-normalization test arm (codex round on PR #1464)
ci/woodpecker/pr/ci Pipeline was canceled
ci/woodpecker/pr/ci Pipeline was canceled
- issue-assign + milestone-create: set -o pipefail; the remove-assignee lookup pipeline now fails loud on provider failure instead of reading an empty result as a silent no-assignees skip (codex blocker). A successful lookup with zero assignees still skips the edit. - test-issue-assign-usage-contract: 6b arm proves provider-exit normalization end to end (gh stub exiting 2 on issue edit -> wrapper exit 1 with the normalized stderr message; codex should-fix). - Battery: 23/23 suites green.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
# Usage: issue-assign.sh -i ISSUE_NUMBER [-a assignee] [-l labels] [-m milestone]
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/detect-platform.sh"
|
||||
@@ -96,7 +97,14 @@ case "$PLATFORM" in
|
||||
fi
|
||||
if [[ "$REMOVE_ASSIGNEE" == true ]]; then
|
||||
# Get current assignees and remove them
|
||||
CURRENT=$(gh issue view "$ISSUE" --json assignees -q '.assignees[].login' 2>/dev/null | tr '\n' ',')
|
||||
# pipefail preserves the provider status through the pipeline;
|
||||
# a FAILED lookup exits here instead of reading as a silent
|
||||
# no-assignees skip (codex PR #1464). A successful lookup with
|
||||
# zero assignees still skips the edit below.
|
||||
CURRENT=$(gh issue view "$ISSUE" --json assignees -q '.assignees[].login' 2>/dev/null | tr '\n' ',') || {
|
||||
echo "Error: could not read current assignees (provider lookup failed)" >&2
|
||||
exit 1
|
||||
}
|
||||
if [[ -n "$CURRENT" ]]; then
|
||||
prov_rc=0
|
||||
gh issue edit "$ISSUE" --remove-assignee "${CURRENT%,}" || prov_rc=$?
|
||||
|
||||
Reference in New Issue
Block a user