RFR: 1608: Handle shenandoah tags in IssueNotifier
Erik Helin
ehelin at openjdk.org
Fri Nov 4 13:42:10 UTC 2022
On Mon, 31 Oct 2022 22:03:19 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
> This patch aims to add support for notifying JBS when tags are added in the shenandoah-jdk8u repository. This repository is special because it's a jdk8u 'project' repo that is never going to be merged upstream. Instead it's a downstream repo that produces its own releases. Because of this it has its own fixVersion configured in .jcheck/conf and its own tag format, to keep them apart from the main JDK jdk8u tags.
>
> The logic for matching fixVersions and tags is already a bit convoluted due to conventions that have been added over time. This repo will now add another matching rule. A typical fixVersion would be `shenandoah8u332` and a corresponding tag `shenandoah8u332-b01`. This is actually a pretty neat pattern to match for as the tag prefix is exactly the fixVersion, which is why I agreed to implement support for this. The complicating factors are that for mainline OpenJDK jdk8u we have fixVersion `openjdk8u332` and tag `jdk8u332-b01` (and for Oracle jdk8u the fixVersion is `8u332` but with the same tag format). This special handling of a 'jdk' prefix for a tag, and ignoring any prefix in the fixVersion is what complicates things.
>
> So currently we ignore any prefix before the main version number in both a tag and fixVersion when matching them. For shenandoah-jdk8u we want to exactly match this prefix. To handle this, I've added a new configuration option for the notifier:
>
> "issue": { // existing config element
> "tag": { // existing config element
> "matchprefix": true // new
> }
> }
>
> The default value for this option is `false` to reflect the current behavior. When set true, a fixVersion and tag version must match exactly. Note though that the special handling of the tag prefix 'jdk' will still be at play due to the way OpenJDKTag currently parses a JdkVersion from a tag, and I don't dare changing it. This means that if this option is set, then a fixVersion `8u332` will match tags `jdk8u332-b01` and `8u332-b01`, but a fixVersion `jdk8u332` would not match the tag `jdk8u332-b01`. We don't currently use the 'jdk' prefix in any fixVersions in JBS, so this should be fine. I just want to make it clear.
This looks good, I know this is a can (swimming pool?) of worms. A future enhancement might be to break apart `IssueNotifier` into multiple cases for different repos, e.g. `Shenandoah8uIssueNotifier`, `JDKIssueNotifier`, `UpdatesIssueNotifier` just to reduce the "branchyness" of the code. This code lead to some code duplication, but it might also maker it the logic for each special case much clearer.
Thanks,
Erik
-------------
Marked as reviewed by ehelin (Reviewer).
PR: https://git.openjdk.org/skara/pull/1406
More information about the skara-dev
mailing list