RFR: 2230: IssueNotifier should use array for fixVersions
Zhao Song
zsong at openjdk.org
Thu Apr 11 17:26:26 UTC 2024
On Thu, 11 Apr 2024 09:44:01 GMT, Erik Duveblad <ehelin at openjdk.org> wrote:
> Hi all,
>
> please review this small patch that makes `IssueNotifier` use an array when setting the `fixVersions` property of an issue. There is currently code in `JiraProject.encodeProperty` that enables production code to use a plain string fox `fixVersions`, but such code will then break when using a `TestIssueTrackerIssue` (that does not feature any special encoding of the fixVersion). To allow the production code to work with both unit tests and production JIRA instances the production code should use an array and not a string when setting `fixVersions`.
>
> From a production code point of view this change will not cause any change in behaviour as `JiraProject.encodeProperty` calls `stream()` on its argument, which for `JSONString` is a stream of the string itself and for a `JSONArray` with one item is a stream of the single item (so the resulting streams are identical). The reason the tests are working today is because no test code is directly reading the `fixVersions` property, all test code (and production code) immediately calls `.stream` on the `JSONValue` for the `"fixVersions"` key (which as described results in identical streams for a `JSONString` and `JSONArray` instance with exactly one value). All test code that is setting the `fixVersions` property are correctly using a `JSONArray` as the value.
>
> Thanks,
> Erik
Marked as reviewed by zsong (Reviewer).
-------------
PR Review: https://git.openjdk.org/skara/pull/1634#pullrequestreview-1994767513
More information about the skara-dev
mailing list