fix(branch-suggestion): output critical JSON issue on JIRA error and add missing tests#120
fix(branch-suggestion): output critical JSON issue on JIRA error and add missing tests#120probelabs[bot] wants to merge 18 commits intomainfrom
Conversation
…add missing tests
|
This PR overhauls error handling in the Files Changed Analysis
Architecture & Impact Assessment
Workflow Error Handling FlowsequenceDiagram
participant Workflow as analyze-and-suggest
participant Script as get-fixedversion.js
participant JIRA as JIRA API
Workflow->>Script: Execute script
Script->>JIRA: API Call to get ticket
alt JIRA API/Config Error
JIRA-->>Script: Failure (e.g., 401 Unauthorized)
Script-->>Workflow: Exit Code 1
Workflow-->>Workflow: Output critical JSON issue & exit 0
else No Fix Versions Found
JIRA-->>Script: Success (ticket data w/o versions)
Script-->>Workflow: Exit Code 3
Workflow-->>Workflow: Output info JSON issue & exit 0
else Success
JIRA-->>Script: Success (ticket with versions)
Script-->>Workflow: Exit Code 0
Workflow-->>Workflow: Continue to generate suggestions
end
Scope Discovery & Context Expansion
Metadata
Powered by Visor from Probelabs Last updated: 2026-05-01T21:16:42.924Z | Triggered by: pr_updated | Commit: 33ac612 💡 TIP: You can chat with Visor using |
✅ Security Check PassedNo security issues found – changes LGTM. ✅ Architecture Check PassedNo architecture issues found – changes LGTM. ✅ Security Check PassedNo security issues found – changes LGTM. \n\n✅ Architecture Check PassedNo architecture issues found – changes LGTM. \n\nPerformance Issues (1)
✅ Quality Check PassedNo quality issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-05-01T21:16:02.497Z | Triggered by: pr_updated | Commit: 33ac612 💡 TIP: You can chat with Visor using |
c93b897 to
7bd153a
Compare
…orkflow" This reverts commit 7bd153a.
98f9d84 to
33ac612
Compare
Problem / Task
Resolves TT-17120
When the JIRA_TOKEN is misconfigured or invalid, the branch suggestion workflow fails but Visor exits with code 0 because the severity is only 'error'. This causes the GitHub Action to succeed even though the PR comment is not posted.
Additionally, the error handling conflated two distinct failure modes: a JIRA API/configuration error and a ticket having no 'fix versions'. Treating both as a
criticalfailure is architecturally unsound. An API error is a genuine critical failure, but a ticket without a fix version might be a valid, non-blocking state.The workflow was also timing out because the timeout values were set to 90 and 30, which Visor interprets as milliseconds.
Changes
branch_suggestion.ymlto output a JSON issue withseverity: "critical"when the JIRA API fails.3inget-fixedversion.js.branch_suggestion.ymlto handle exit code3by outputting a JSON issue withseverity: "info".post-pr-commentstep to gracefully skip instead of failing when the markdown file is missing (sinceanalyze-and-suggestmight exit early with info severity).tags: ["remote"]to theanalyze-and-suggestcheck inbranch_suggestion.ymlso it runs when Visor is executed with--tags remote.branch_suggestion.ymlfrom 90 to 90000 and 30 to 30000 to fix the timeout issue.Testing
npm testinbranch-suggestiondirectory and all tests passed.