Integrated: 2230: IssueNotifier should use array for fixVersions
Erik Duveblad
ehelin at openjdk.org
Thu Apr 11 18:02:43 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
This pull request has now been integrated.
Changeset: 863ac20d
Author: Erik Duveblad <ehelin at openjdk.org>
URL: https://git.openjdk.org/skara/commit/863ac20d360031af136695738bd24e27d97a1e3c
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
2230: IssueNotifier should use array for fixVersions
Reviewed-by: erikj, zsong
-------------
PR: https://git.openjdk.org/skara/pull/1634
More information about the skara-dev
mailing list