From f50b56cd86a60e74b8b1ae6d2eeeb4a520665b8b Mon Sep 17 00:00:00 2001 From: Dev Agent Date: Tue, 21 Apr 2026 06:59:44 +0000 Subject: [PATCH] fix(kanban): make move-issue.sh board update failures fatal Board update failures were swallowed as warnings (exit 0), causing agents to believe issue moves succeeded when only the label changed but the project board status remained stale. - Promote "item not found on board" from WARNING to ERROR (exit 2) - Promote "failed to update board status" from WARNING to ERROR (exit 2) - Promote "failed to query board items" from WARNING to ERROR (exit 2) - Stop swallowing stderr on gh project item-edit so failures are diagnosable Co-Authored-By: Claude Opus 4.6 (1M context) --- github-kanban/scripts/move-issue.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/github-kanban/scripts/move-issue.sh b/github-kanban/scripts/move-issue.sh index dd71b15..0400bf7 100755 --- a/github-kanban/scripts/move-issue.sh +++ b/github-kanban/scripts/move-issue.sh @@ -174,21 +174,24 @@ echo "Labels updated: ${FROM_STAGE_LABEL:-none} → $TO_STAGE_LABEL" >&2 # --- Update board status --- ITEM_ID=$(gh project item-list "$PROJECT_NUMBER" --owner "$OWNER" --format json \ | jq -r --argjson num "$ISSUE" '.items[] | select(.content.number == $num) | .id') || { - echo "WARNING: Failed to get project item ID" >&2 + echo "ERROR: Failed to query project board items" >&2 + exit 2 } -if [ -n "$ITEM_ID" ]; then - gh project item-edit --id "$ITEM_ID" \ - --project-id "$PROJECT_ID" \ - --field-id "$STATUS_FIELD_ID" \ - --single-select-option-id "$TO_OPTION_ID" >/dev/null 2>&1 || { - echo "WARNING: Failed to update board status" >&2 - } - echo "Board updated: $TO_STAGE" >&2 -else - echo "WARNING: Issue not found on project board — labels updated but board status unchanged" >&2 +if [ -z "$ITEM_ID" ]; then + echo "ERROR: Issue #$ISSUE not found on project board — labels updated but board status unchanged" >&2 + exit 2 fi +gh project item-edit --id "$ITEM_ID" \ + --project-id "$PROJECT_ID" \ + --field-id "$STATUS_FIELD_ID" \ + --single-select-option-id "$TO_OPTION_ID" 2>&1 || { + echo "ERROR: Failed to update board status for issue #$ISSUE" >&2 + exit 2 +} +echo "Board updated: $TO_STAGE" >&2 + # --- JSON output --- jq -n \ --argjson issue "$ISSUE" \