Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .agents/scripts/supervisor/issue-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ state_to_status_label() {
return 0
}

#######################################
# All status labels that can be set on an issue (t1009)
# Used to remove stale labels before applying the new one.
# Restored from pre-modularisation supervisor-helper.sh (t1035).
#######################################
ALL_STATUS_LABELS="status:available,status:queued,status:claimed,status:in-review,status:blocked,status:verify-failed,status:done"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better maintainability and robustness, it's recommended to define this list of labels as a bash array instead of a comma-separated string. Using an array avoids the need for string splitting (e.g., with tr or by changing IFS) and allows for safer iteration over the elements, preventing potential issues with word splitting or globbing.

The repository style guide also encourages the use of arrays for dynamic command construction, and this principle extends well to managing lists of values.

Suggested change
ALL_STATUS_LABELS="status:available,status:queued,status:claimed,status:in-review,status:blocked,status:verify-failed,status:done"
ALL_STATUS_LABELS=("status:available" "status:queued" "status:claimed" "status:in-review" "status:blocked" "status:verify-failed" "status:done")
References
  1. The style guide recommends using bash arrays for dynamic command construction, which implies a preference for arrays over delimited strings for managing lists of items to avoid issues like word splitting and make iteration safer. (link)


#######################################
# Sync GitHub issue status label on state transition (t1009)
# Called from cmd_transition() after each state change.
Expand Down