FABRIC/scripts/br-ready-workaround.sh
jeda 57e8193f7b feat(bd-2kf): Add comprehensive test coverage for parser and store
- Add 36 parser tests covering:
  - parseLogLine with valid/invalid inputs
  - parseLogLines for multi-line parsing
  - formatEvent with all options
  - Edge cases: malformed JSON, missing fields, colorization

- Add 35 store tests covering:
  - InMemoryEventStore add/query operations
  - Worker status tracking (active/idle/error)
  - Event filtering by worker, level, bead, timestamp
  - maxEvents limit and LRU trimming
  - getStore/resetStore singleton management

- Close phase beads (bd-2pa, bd-n8l, bd-2nu) as infrastructure complete
- Close test beads (bd-5eh, bd-2en) with comprehensive coverage
- Total: 91 tests passing across parser, store, and tailer

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-03 10:43:24 +00:00

46 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
# br-ready-workaround.sh
# Workaround for "br ready" schema bug (Invalid column type Text at index: 14, name: created_by)
#
# Usage:
# ./br-ready-workaround.sh [--priority N] [--type TYPE]
#
# This script replicates br ready functionality using br list --all --format json
# until the schema bug is fixed.
set -euo pipefail
PRIORITY_FILTER=""
TYPE_FILTER=""
while [[ $# -gt 0 ]]; do
case $1 in
--priority|-p)
PRIORITY_FILTER="$2"
shift 2
;;
--type|-t)
TYPE_FILTER="$2"
shift 2
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
# Get all beads as JSON and filter with jq
br list --all --format json 2>/dev/null | jq -c --arg prio "$PRIORITY_FILTER" --arg type "$TYPE_FILTER" '
.[]
| select(.status == "open")
| select(.issue_type != "human" and .issue_type != "phase" and .issue_type != "epic")
| if $prio != "" then select(.priority == ($prio | tonumber)) else . end
| if $type != "" then select(.issue_type == $type) else . end
| {id, title, priority, issue_type, labels}
| [.id, "P\(.priority)", .issue_type, .title]
| @tsv
' -r | head -20 | column -t -s $'\t'
echo ""
echo "To work on a bead, use: br update <bead-id> --status in_progress"