Skip to content

Commit 38d2f25

Browse files
kkaarreellclaude
andcommitted
Filter out suite-level items from RP summarize queries
The RP item API was returning parent items (test suites) alongside leaf test cases, inflating counts like "To investigate" with entries not visible in the WebUI. Adding filter.eq.hasChildren=false restricts results to leaf items only. Also add debug logging for raw RP statistics and individual test items to aid future troubleshooting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fd488a9 commit 38d2f25

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

newa/cli/summarize_helpers.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def get_launch_test_items_data(
5656
'page.size': '1024',
5757
'page.number': str(page_number),
5858
'filter.eq.issueType': TEST_ITEM_TYPE_MAPPING[item_type],
59+
'filter.eq.hasChildren': 'false',
5960
})
6061

6162
if not test_items or not test_items.get('content'):
@@ -80,6 +81,13 @@ def get_launch_test_items_data(
8081

8182
count = len(all_content)
8283

84+
if logger:
85+
for i in all_content:
86+
logger.debug(
87+
f'{item_type}: test item: {i.get("name", "Unknown")}'
88+
f' (id={i.get("id", "?")},'
89+
f' issueType={i.get("issue", {}).get("issueType", "?")})')
90+
8391
if item_type == 'To Investigate':
8492
return {'count': count, 'issues': {}, 'failures': []}
8593

@@ -242,11 +250,18 @@ def collect_launch_details(
242250
output.append(f'Error: Could not retrieve launch details for launch ID {launch_id}')
243251
return output, set()
244252

253+
# Log raw RP statistics for debugging
254+
if logger:
255+
rp_stats = launch_details.get('statistics', {})
256+
logger.debug(f'RP raw statistics: {rp_stats}')
257+
245258
# Read test items data for all item types
246259
all_data = {}
247260
all_jira_issues = set()
248261
for item_type in TEST_ITEM_TYPE_MAPPING:
249262
all_data[item_type] = get_launch_test_items_data(rp, launch_id, item_type, logger)
263+
if logger:
264+
logger.debug(f'{item_type}: {all_data[item_type]["count"]} items fetched')
250265
# Collect Jira issue keys (excluding JIRA_NONE_ID)
251266
for issue_key in all_data[item_type]['issues']:
252267
if issue_key != JIRA_NONE_ID:

0 commit comments

Comments
 (0)