Bug Description
When gh api --paginate repos/{owner}/{repo}/issues/{pr}/timeline --jq ... returns a JSON array (such as empty array [] when no copilot timeline events match), _parse_timeline_copilot_state attempts to call evt.get('event') on the parsed list object, raising:
AttributeError: 'list' object has no attribute 'get'
Stack Trace
File "/workspaces/devops-cli/src/devops_cli/github/pr_monitor.py", line 258, in _parse_timeline_copilot_state
evt_name = evt.get("event")
AttributeError: 'list' object has no attribute 'get'
Proposed Remediation
Support both list and dict structures in _parse_timeline_copilot_state, safely handling top-level arrays, NDJSON, and empty lists. Add unit tests covering list payloads.
Bug Description
When
gh api --paginate repos/{owner}/{repo}/issues/{pr}/timeline --jq ...returns a JSON array (such as empty array[]when no copilot timeline events match),_parse_timeline_copilot_stateattempts to callevt.get('event')on the parsed list object, raising:AttributeError: 'list' object has no attribute 'get'Stack Trace
Proposed Remediation
Support both list and dict structures in
_parse_timeline_copilot_state, safely handling top-level arrays, NDJSON, and empty lists. Add unit tests covering list payloads.