Fix hardcoded '???' placeholder for missing Jira issues in summarize#383
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideStandardizes summarize workflow handling of missing Jira issues by replacing the hardcoded '???' placeholder with the shared JIRA_NONE_ID sentinel and wiring that value into the AI summary system prompt. Sequence diagram for AI summary prompt using JIRA_NONE_ID sentinelsequenceDiagram
participant SummarizeCLI
participant AiService
participant Constants as CLIConstants
SummarizeCLI->>AiService: query_ai_model(user_message, system_prompt=None)
AiService->>AiService: [system_prompt is None]
AiService->>CLIConstants: import JIRA_NONE_ID
AiService->>AiService: SYSTEM_PROMPT.format(jira_none_id=JIRA_NONE_ID)
AiService-->>SummarizeCLI: AI response text
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
summarize_cmd.py,JIRA_NONE_IDis used infetch_jira_issues_bulkbut never imported; add the appropriate import fromnewa.cli.constantsto avoid a NameError. - The AI summary template in
ai_service.pynow hardcodes "_NO_ISSUE" instead of referencingJIRA_NONE_ID; consider using the constant or interpolating it so the text stays consistent if the sentinel value changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `summarize_cmd.py`, `JIRA_NONE_ID` is used in `fetch_jira_issues_bulk` but never imported; add the appropriate import from `newa.cli.constants` to avoid a NameError.
- The AI summary template in `ai_service.py` now hardcodes "_NO_ISSUE" instead of referencing `JIRA_NONE_ID`; consider using the constant or interpolating it so the text stays consistent if the sentinel value changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
The summarize code used '???' as a sentinel for failures without a Jira
issue, but the rest of the codebase already uses the JIRA_NONE_ID
constant ('_NO_ISSUE'). Replace all '???' occurrences with JIRA_NONE_ID
to keep the summarize output consistent and prevent '???' from leaking
into AI-generated summary reports.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f35db26 to
ab3c269
Compare
Collaborator
Author
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
summarize_cmd.py,JIRA_NONE_IDis now referenced infetch_jira_issues_bulkbut the diff doesn't show an import for it in that module; ensure it's imported fromnewa.cli.constantsto avoid aNameError. - The change to format
SYSTEM_PROMPTwith.format(jira_none_id=JIRA_NONE_ID)only applies whensystem_promptisNone; if callers passSYSTEM_PROMPTdirectly they’ll still see the{jira_none_id}placeholder—consider centralizing the formatting at definition time or documenting that callers should pass a pre-formatted prompt.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `summarize_cmd.py`, `JIRA_NONE_ID` is now referenced in `fetch_jira_issues_bulk` but the diff doesn't show an import for it in that module; ensure it's imported from `newa.cli.constants` to avoid a `NameError`.
- The change to format `SYSTEM_PROMPT` with `.format(jira_none_id=JIRA_NONE_ID)` only applies when `system_prompt` is `None`; if callers pass `SYSTEM_PROMPT` directly they’ll still see the `{jira_none_id}` placeholder—consider centralizing the formatting at definition time or documenting that callers should pass a pre-formatted prompt.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Failures without a linked Jira issue were showing "_NO_ISSUE" as a prefix in both the raw report and the AI-generated summary. Filter it out in format_launch_test_items and update the AI prompt to list such failures directly without any ID prefix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The summarize code used '???' as a sentinel for failures without a Jira issue, but the rest of the codebase already uses the JIRA_NONE_ID constant ('_NO_ISSUE'). Replace all '???' occurrences with JIRA_NONE_ID to keep the summarize output consistent and prevent '???' from leaking into AI-generated summary reports.
Summary by Sourcery
Standardize handling of missing Jira IDs in summarize and AI reporting workflows by using the shared JIRA_NONE_ID constant instead of hardcoded placeholders.
Bug Fixes:
Enhancements: