New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1843: mlbridge bot bridges emails generated by itself #1485
Conversation
👋 Welcome back gli! A progress list of the required criteria for merging this PR into |
Webrevs
|
In order to test this bug, I sent two emails [1][2] , but the bot didn't post them as comment. I think it may be another issue which is not related to this one. The current patch is still feasible. [1] https://mail.openjdk.org/pipermail/skara-dev/2023-March/007597.html |
Mailing list message from Guoxiong Li on skara-dev: test mlbridge again |
This comment is posted successfully now. Is it done automatically? Or the bot is restarted, then this comment is posted? |
var bridgeIdStr = "^[^.]+\\.[^.]+@(?:" + pr.repository().url().getHost() + "|" + pr.repository().authenticatedUrl().getHost() + ")$"; | ||
var bridgeIdPattern = Pattern.compile(bridgeIdStr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the correct fix is to just get the host from authenticatedUrl
. Perhaps there should be a different method for this kind of usecase that better describes what we need here (the raw actual host, without the pattern rewrite), but at least for now, I think changing this to authenticatedUrl
is a good enough fix. Thanks for figuring this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder, If so, we should also change return EmailAddress.from(encodedCommon + "." + UUID.randomUUID() + "@" + pr.repository().url().getHost())
in ReviewArchive::getUniqueMessageId
to return EmailAddress.from(encodedCommon + "." + UUID.randomUUID() + "@" + pr.repository().authenticatedUrl().getHost())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, right, we are currently generating Message-ID
s with the rewritten url. That's bad. We should make sure they are all reverted to github.com.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only filter the authenticatedUrl
, what about the polluted data? The SKARA project now has many emails which have the message id with git.openjdk.org
. If we don’t filter them, they would be posted as comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it's only the Skara project, so I was ok with living with it. But sure, we can keep the double filter if we add the following comment.
var bridgeIdStr = "^[^.]+\\.[^.]+@(?:" + pr.repository().url().getHost() + "|" + pr.repository().authenticatedUrl().getHost() + ")$"; | |
var bridgeIdPattern = Pattern.compile(bridgeIdStr); | |
// Filter on both original, and any pattern replaced, host for now as we have polluted | |
// data in the Skara project mail archives. We should revert this to just authenticatedUrl | |
// eventually. | |
var bridgeIdStr = "^[^.]+\\.[^.]+@(?:" + pr.repository().url().getHost() + "|" + pr.repository().authenticatedUrl().getHost() + ")$"; | |
var bridgeIdPattern = Pattern.compile(bridgeIdStr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it's only the Skara project, so I was ok with living with it.
After thinking more, I am OK with it too. It can also verify and confirm my thought about the hosts in this patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option for us is that we use double filter right now and after 14 days, we revert it back to only filter authenticatedUrl()
. In this way, the polluted Skara emails wouldn't be bridged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to only influence several PRs, so I don't want to complicate the flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to only influence several PRs, so I don't want to complicate the flow.
Sure! I am also ok with it.
It is done automatically. It's a known issue. See SKARA-1644 |
I will check other places where we changed |
Thanks. But the time is too long and unacceptable. Hope SKARA-1644 can be fixed. |
@lgxbslgx This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. 🔍 One or more changes in this pull request modifies files in areas of the source code that often require two reviewers. Please consider if this is the case for this pull request, and if so, await a second reviewer to approve this pull request before you integrate it. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Mailing list message from Guoxiong Li on skara-dev: Hi all, This patch filters both `github.com` (by `authenticatedUrl()`) and `git.openjdk.com` (by `url()`) in `MailingListArchiveReaderBot::inspect` to avoid the bot posting the unnecessary comments to the PRs. Please see SKARA-1843 [1] for more information. But I can't write a test case for it now, because the current URLs of the repositories in test code are fake and their host are empty, which means both `pr.repository().url().getHost()` and `pr.repository().authenticatedUrl().getHost()` always return `null`. Thanks for the review. Best Regards, [1] https://bugs.openjdk.org/browse/SKARA-1843 ------------- Commit messages: Changes: https://git.openjdk.org/skara/pull/1485/files PR: https://git.openjdk.org/skara/pull/1485 |
Mailing list message from Guoxiong Li on skara-dev: On Thu, 16 Mar 2023 05:20:54 GMT, Guoxiong Li <gli at openjdk.org> wrote:
In order to test this bug, I sent two emails [1][2] , but the bot didn't post them as comment. I think it may be another issue which is not related to this one. The current patch is still feasible. [1] https://mail.openjdk.org/pipermail/skara-dev/2023-March/007597.html ------------- PR Comment: https://git.openjdk.org/skara/pull/1485#issuecomment-1471696100 |
Mailing list message from Guoxiong Li on skara-dev: On Thu, 16 Mar 2023 05:20:54 GMT, Guoxiong Li <gli at openjdk.org> wrote:
This comment is posted successfully now. Is it done automatically? Or the bot is restarted, then this comment is posted? ------------- PR Comment: https://git.openjdk.org/skara/pull/1485#issuecomment-1471990106 |
Mailing list message from Erik Joelsson on skara-dev: On Thu, 16 Mar 2023 05:20:54 GMT, Guoxiong Li <gli at openjdk.org> wrote:
bots/mlbridge/src/main/java/org/openjdk/skara/bots/mlbridge/MailingListArchiveReaderBot.java line 118:
I think the correct fix is to just get the host from `authenticatedUrl`. Perhaps there should be a different method for this kind of usecase that better describes what we need here (the raw actual host, without the pattern rewrite), but at least for now, I think changing this to `authenticatedUrl` is a good enough fix. Thanks for figuring this out. ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1138882630 |
Mailing list message from Zhao Song on skara-dev: On Thu, 16 Mar 2023 13:46:33 GMT, Guoxiong Li <gli at openjdk.org> wrote:
It is done automatically. It's a known issue. See [SKARA-1644](https://bugs.openjdk.org/projects/SKARA/issues/SKARA-1644) ------------- PR Comment: https://git.openjdk.org/skara/pull/1485#issuecomment-1472212637 |
Mailing list message from Zhao Song on skara-dev: On Thu, 16 Mar 2023 05:20:54 GMT, Guoxiong Li <gli at openjdk.org> wrote:
I will check other places where we changed `authenticatedUrl().getHost()` to `url().getHost()` in SKARA-1813. ------------- PR Comment: https://git.openjdk.org/skara/pull/1485#issuecomment-1472222138 |
Mailing list message from Zhao Song on skara-dev: On Thu, 16 Mar 2023 15:27:31 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
Just a reminder, If so, we should also change `return EmailAddress.from(encodedCommon + "." + UUID.randomUUID() + "@" + pr.repository().url().getHost())` in `ReviewArchive::getUniqueMessageId ` to `return EmailAddress.from(encodedCommon + "." + UUID.randomUUID() + "@" + pr.repository().authenticatedUrl().getHost())` ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1138918907 |
Mailing list message from Erik Joelsson on skara-dev: On Thu, 16 Mar 2023 15:48:33 GMT, Zhao Song <zsong at openjdk.org> wrote:
Yes, right, we are currently generating `Message-ID`s with the rewritten url. That's bad. We should make sure they are all reverted to github.com. ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1139213720 |
Mailing list message from Guoxiong Li on skara-dev: On Thu, 16 Mar 2023 18:34:15 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
If we only filter the `authenticatedUrl`, what about the polluted data? The SKARA project now has many emails which have the message id with `git.openjdk.org`. If we don?t filter them, they would be posted as comments. ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1139411065 |
Mailing list message from Guoxiong Li on skara-dev: On Thu, 16 Mar 2023 15:36:09 GMT, Zhao Song <zsong at openjdk.org> wrote:
Thanks. But the time is too long and unacceptable. Hope SKARA-1644 can be fixed. ------------- PR Comment: https://git.openjdk.org/skara/pull/1485#issuecomment-1472836645 |
Mailing list message from Guoxiong Li on skara-dev:
Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Change 'url' to 'authenticatedUrl' ------------- Changes: Webrevs: Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod PR: https://git.openjdk.org/skara/pull/1485 |
Mailing list message from Erik Joelsson on skara-dev: On Thu, 16 Mar 2023 22:16:44 GMT, Guoxiong Li <gli at openjdk.org> wrote:
Yes, but it's only the Skara project, so I was ok with living with it. But sure, we can keep the double filter if we add the following comment. // Filter on both original, and any pattern replaced, host for now as we have polluted ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1140199035 |
Mailing list message from Guoxiong Li on skara-dev:
Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Use the simple pattern. ------------- Changes: Webrevs: Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod PR: https://git.openjdk.org/skara/pull/1485 |
Mailing list message from Guoxiong Li on skara-dev: On Fri, 17 Mar 2023 12:53:12 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
After thinking more, I am OK with it too. It can also verify and confirm my thought about the hosts in this patch. ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1140228349 |
Mailing list message from Erik Joelsson on skara-dev: On Fri, 17 Mar 2023 13:25:36 GMT, Guoxiong Li <gli at openjdk.org> wrote:
Marked as reviewed by erikj (Lead). ------------- PR Review: https://git.openjdk.org/skara/pull/1485#pullrequestreview-1345974226 |
Mailing list message from Zhao Song on skara-dev: On Fri, 17 Mar 2023 13:19:47 GMT, Guoxiong Li <gli at openjdk.org> wrote:
Another option for us is that we use double filter right now and after 14 days, we revert it back to only filter `authenticatedUrl()`. In this way, the polluted Skara emails wouldn't be bridged. ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1140254977 |
Mailing list message from Guoxiong Li on skara-dev: On Fri, 17 Mar 2023 13:42:27 GMT, Zhao Song <zsong at openjdk.org> wrote:
Seems to only influence several PRs, so I don't want to complicate the flow. ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1140271614 |
Mailing list message from Zhao Song on skara-dev: On Fri, 17 Mar 2023 13:56:44 GMT, Guoxiong Li <gli at openjdk.org> wrote:
Sure! I am also ok with it. ------------- PR Review Comment: https://git.openjdk.org/skara/pull/1485#discussion_r1140272665 |
Mailing list message from Guoxiong Li on skara-dev: On Thu, 16 Mar 2023 05:20:54 GMT, Guoxiong Li <gli at openjdk.org> wrote:
This pull request has now been integrated. Changeset: 0853677 1843: mlbridge bot bridges emails generated by itself Reviewed-by: erikj ------------- PR: https://git.openjdk.org/skara/pull/1485 |
Hi all,
This patch filters both
github.com
(byauthenticatedUrl()
) andgit.openjdk.com
(byurl()
) inMailingListArchiveReaderBot::inspect
to avoid the bot posting the unnecessary comments to the PRs. Please see SKARA-1843 [1] for more information.But I can't write a test case for it now, because the current URLs of the repositories in test code are fake and their host are empty, which means both
pr.repository().url().getHost()
andpr.repository().authenticatedUrl().getHost()
always returnnull
.Thanks for the review.
Best Regards,
-- Guoxiong
[1] https://bugs.openjdk.org/browse/SKARA-1843
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/skara.git pull/1485/head:pull/1485
$ git checkout pull/1485
Update a local copy of the PR:
$ git checkout pull/1485
$ git pull https://git.openjdk.org/skara.git pull/1485/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1485
View PR using the GUI difftool:
$ git pr show -t 1485
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/skara/pull/1485.diff