RFR: 1515: Mailing list parsing of PR links broken since openjdk.org transition

Erik Joelsson erikj at openjdk.org
Mon Aug 1 22:57:27 UTC 2022

The mlbridge bot uses PR links in emails to identify which PR an email thread belongs to. This is then used to correctly post emails from the archive as comments on PRs. The PR links in the emails are transformed to an openjdk style URL:

github.com/openjdk -> git.openjdk.org

The URL matching logic knows about this transformation and tries to reverse it before matching PR links. The problem is that before June 9, the rewritten URLs were git.openjdk.java.net. The current logic can't handle multiple different transformation patterns, so any emails found with the old URL can't be matched correctly to PRs.

In the github host config for the mlbridge bot, we currently have this config:

        "weburl": {
          "pattern": "^https://github.com/openjdk/(.*)$",
          "replacement": "https://git.openjdk.org/$1",

This patch adds the ability to add alternate replacement patterns. By using this, we can search for both the old openjdk.java.net URLs as well as the new openjdk.org one. It will look like this:

        "weburl": {
          "pattern": "^https://github.com/openjdk/(.*)$",
          "replacement": "https://git.openjdk.org/$1",
          "altreplacements": [


Commit messages:
 - SKARA-1515

Changes: https://git.openjdk.org/skara/pull/1346/files
 Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1346&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-1515
  Stats: 90 lines in 5 files changed: 57 ins; 3 del; 30 mod
  Patch: https://git.openjdk.org/skara/pull/1346.diff
  Fetch: git fetch https://git.openjdk.org/skara pull/1346/head:pull/1346

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

More information about the skara-dev mailing list