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
1565: Only poll for updated MRs from GitLab #1369
Conversation
👋 Welcome back erikj! A progress list of the required criteria for merging this PR into |
Webrevs
|
Please disregard this for now. I discovered a testing issue with any bot using the poller that I need to address properly first. |
|
Removing draft. This is now ready for review, but depends on SKARA-1589. |
The dependent pull request has now been integrated, and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout SKARA-1565-pr-poll
git fetch https://git.openjdk.org/skara master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push |
@erikj79 this pull request can not be integrated into git checkout SKARA-1565-pr-poll
git fetch https://git.openjdk.org/skara master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
This message was sent to the mail list. Is it a intent? Or should the bot |
Yes, it should. The openjdk-notifier[bot] is on the exclude list for all other repos, but not for the configuration used for the Skara repo itself. I've added it now. |
I'm reducing the scope of this change to just add the new poller, without actually putting it to use yet. There are two followup issues filed already for converting specific bots. |
} else { | ||
reviewsMap = Map.of(); | ||
} | ||
return reviewsMap; |
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 an aesthetic remark. It looks a bit odd that this method has a local variable instead of returning directly, when it is almost the very same as the method above.
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.
Oh, I see what you mean now. Will fix.
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 this looks good. You have commented the PollRequestPoller very well, and it is easy to follow (or at least as easy as it can get). Still, this is tricky logic and I can't say with 100% certainty that you are not missing any edge case etc. I think we can go with it, and if there are some issues we will hopefully spot that later.
@erikj79 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit ca8d09a. |
This is another rather big patch, but again, with some explanation, it shouldn't be too scary. The most important part is the new
PullRequestPoller
class. This class implements a polling mechanism for PullRequests that tries to only return new or updated pull requests to a bot and guaranteeing that none are missed. The goal is to minimize unnecessary evaluations that currently take place, especially when polling Gitlab. I have added quite a few tests to verify (almost) all the functionality of the poller. For a more detailed explanation of all the challenges this poller faces, see the bug description.In order to reduce impact, I'm not actually making any bot use the new poller yet. I'm filing followup issues to convert them one by one, at least to start. The retry and quarantine features in the poller should cover the current needs for the bots I have inspected.
Most of the rest of the changes are just adding
equals
andhashCode
to a bunch of classes that we now need to compare (to know if a PR has been updated or not). This includes theGitHubPullrequest
,GitLabMergeRequest
and all the JSON types. For test code this also includes theTestPullRequest
andTestIssue
and their related data classes.To test this properly, I needed to refactor some test classes. This work was moved to a separate change in SKARA-1589.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/skara pull/1369/head:pull/1369
$ git checkout pull/1369
Update a local copy of the PR:
$ git checkout pull/1369
$ git pull https://git.openjdk.org/skara pull/1369/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1369
View PR using the GUI difftool:
$ git pr show -t 1369
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/skara/pull/1369.diff