Support bamboo api polymorphism
What does this MR do?
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21970 we changed the way we read results from Bamboo REST API following observation that Bamboo returns an array of results, rather than a single result as previously assumed. This was consistent with the Bamboo API reference indicating an array of results is returned.
However, new observations indicate that Bamboo's REST API does not actually return a consistent data structure: it may return a
single result or an array of results. It remains unclear whether an array is returned if and only if size >= 2
.
This MR merges the behavior of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21970 and previous behavior to support both data structures that Bamboo might return: with and without array.
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/51950
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer