Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change reduces the number of API calls made by the ghprb plugin. .NET CI was hitting rate limits pretty regularly. There are a few major improvements:
* When using webhooks, we do not check comments (pull comment data) except when absolutely necessary. We recieve all the comment info through the hooks, so we only need to check for updated comments when we have a new pull request or when jenkins restarts.
* Never force a GH pull request update when a comment update comes through. If a comment update came through, we're using webhooks and will have gotten the updated PR event.
* initGhRepository isn't necessary when a GhprbRepository is created. It's not used in the pull request trigger init, and causes an API call. It can be called on demand as necessary. This also dramatically improves startup time in Jenkins instances that have a lot of PR triggered jobs
Additional fixes:
* Fixes a case where the pull request data wasn't saved on a GH hash update (which leads to most PRs restarting testing on any comment if Jenkins restarts)
* Fixes a potential race condition where multiple triggers would attempt to set up hooks at the same time.
Not all possible improvements are included. When a new PR or updated PR event is sent to Jenkins, we could pull the GHPullRequest info for affected projects once, instead of for each project which we do today.