abd4e83baa
- Capture started_at timestamp using datetime.now(UTC) before service call - Add timing.started field to JSON envelope with ISO 8601 format - Update step definitions to verify timing.started is present and valid - Remove @tdd_expected_fail tag from plan_prompt_command.feature scenario Fixes #9353
93 lines
2.9 KiB
Python
93 lines
2.9 KiB
Python
import json
|
|
|
|
files = {
|
|
'issues_p1': '/home/devuser/.local/share/opencode/tool-output/tool_d8cf770e0001e7gBy1O9M6AZIU',
|
|
'issues_p2': '/home/devuser/.local/share/opencode/tool-output/tool_d8cf8552a001pV14tVIOnteVo9',
|
|
'issues_p3': '/home/devuser/.local/share/opencode/tool-output/tool_d8cf8a724001WSOXo2Cw40uiIZ',
|
|
'prs_p1': '/home/devuser/.local/share/opencode/tool-output/tool_d8cf77abd001Sw5ue7R31BxnYu',
|
|
'prs_p2': '/home/devuser/.local/share/opencode/tool-output/tool_d8cf85ee6001sKgUFqxwrxjAU3',
|
|
'prs_p3': '/home/devuser/.local/share/opencode/tool-output/tool_d8cf8b032001y1zV8slKf9mYn1',
|
|
}
|
|
|
|
all_issues = []
|
|
all_prs = []
|
|
|
|
for name, path in files.items():
|
|
with open(path) as f:
|
|
data = json.loads(f.read())['Result']
|
|
if 'issues' in name:
|
|
all_issues.extend(data)
|
|
print(f'{name}: {len(data)} items')
|
|
else:
|
|
all_prs.extend(data)
|
|
print(f'{name}: {len(data)} items')
|
|
|
|
print(f'\nTotal issues across all pages: {len(all_issues)}')
|
|
print(f'Total PRs across all pages: {len(all_prs)}')
|
|
|
|
# Issues analysis
|
|
print('\n' + '='*60)
|
|
print('ISSUES ANALYSIS')
|
|
print('='*60)
|
|
|
|
ms_counts = {}
|
|
label_counts = {}
|
|
blocked_issues = []
|
|
priority_counts = {}
|
|
|
|
for issue in all_issues:
|
|
ms = issue.get('milestone')
|
|
ms_title = ms['title'] if ms else 'No milestone'
|
|
ms_counts[ms_title] = ms_counts.get(ms_title, 0) + 1
|
|
|
|
labels = [l['name'] for l in issue.get('labels', [])]
|
|
for label in labels:
|
|
label_counts[label] = label_counts.get(label, 0) + 1
|
|
if 'blocked' in label.lower():
|
|
blocked_issues.append(f'#{issue["number"]}: {issue["title"][:70]}')
|
|
|
|
print('\n=== Open Issues by Milestone ===')
|
|
for ms, count in sorted(ms_counts.items()):
|
|
print(f' {ms}: {count}')
|
|
|
|
print('\n=== Open Issues by Label ===')
|
|
for label, count in sorted(label_counts.items(), key=lambda x: -x[1]):
|
|
print(f' {label}: {count}')
|
|
|
|
print('\n=== Blocked Issues ===')
|
|
for b in blocked_issues:
|
|
print(f' {b}')
|
|
print(f'Total blocked: {len(blocked_issues)}')
|
|
|
|
# PRs analysis
|
|
print('\n' + '='*60)
|
|
print('PRs ANALYSIS')
|
|
print('='*60)
|
|
|
|
pr_ms_counts = {}
|
|
pr_label_counts = {}
|
|
pr_blocked = []
|
|
|
|
for pr in all_prs:
|
|
ms = pr.get('milestone')
|
|
ms_title = ms['title'] if ms else 'No milestone'
|
|
pr_ms_counts[ms_title] = pr_ms_counts.get(ms_title, 0) + 1
|
|
labels = [l['name'] for l in pr.get('labels', [])]
|
|
for label in labels:
|
|
pr_label_counts[label] = pr_label_counts.get(label, 0) + 1
|
|
if 'blocked' in label.lower():
|
|
pr_blocked.append(f'PR#{pr["number"]}: {pr["title"][:70]}')
|
|
|
|
print('\n=== Open PRs by Milestone ===')
|
|
for ms, count in sorted(pr_ms_counts.items()):
|
|
print(f' {ms}: {count}')
|
|
|
|
print('\n=== Open PRs by Label ===')
|
|
for label, count in sorted(pr_label_counts.items(), key=lambda x: -x[1]):
|
|
print(f' {label}: {count}')
|
|
|
|
print('\n=== Blocked PRs ===')
|
|
for b in pr_blocked:
|
|
print(f' {b}')
|
|
print(f'Total blocked PRs: {len(pr_blocked)}')
|