RFR: 2230: IssueNotifier should use array for fixVersions

Erik Duveblad ehelin at openjdk.org
Thu Apr 11 09:47:05 UTC 2024


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

-------------

Commit messages:
 - 2230

Changes: https://git.openjdk.org/skara/pull/1634/files
  Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1634&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-2230
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/skara/pull/1634.diff
  Fetch: git fetch https://git.openjdk.org/skara.git pull/1634/head:pull/1634

PR: https://git.openjdk.org/skara/pull/1634


More information about the skara-dev mailing list