JiraConnect::SyncDeploymentsWorker failing with error TypeError
What does this MR do and why?
This MR fixes a TypeError
in JiraConnect::SyncDeploymentsWorker
that was causing repeated failures and impacting the groupimport error budget.
Problem
The worker was failing with: TypeError: no implicit conversion of String into Integer
This occurred because the code assumed Jira API error responses would always be arrays, when calling .map
on a hash, Ruby interprets it as iterating over key-value pairs, causing the type error.
Solution
- Added type checking in error handling to support both response formats
-
Extracted error parsing logic into a dedicated
parse_jira_error_messages
method to: - Added test coverage for all error response scenarios
References
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Added unit tests covering array, hash, and edge case responses
- All existing tests continue to pass
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #553614 (closed)
Edited by Rez