RFR: 1683: The force push notifier needs an overhaul

Zhao Song zsong at openjdk.org
Tue Nov 22 23:59:09 UTC 2022


On Tue, 22 Nov 2022 23:29:16 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> A user reported a bug related with the force-push notification. Erik investigated it and found the implementation of this notification should not be in the `PullRequestBranchNotifier`. Also, users preferred to not get force-push notification if the force-push happens when the pr is in draft state.
>> 
>> In this patch, the implementation of checking force-push and notifying user are moved to `CheckWorkItem`. Also, force-pushing or rebasing a draft pr will not warn user any more.
>
> forge/src/main/java/org/openjdk/skara/forge/github/GitHubPullRequest.java line 802:
> 
>> 800:     private ZonedDateTime lastMarkedAsReadyTime() {
>> 801:         ZonedDateTime readyTime = createdAt();
>> 802:         Optional<ZonedDateTime> latestTime = request.get("issues/" + json.get("number").toString() + "/timeline")
> 
> This fetches the timeline a second time. Can you try to reuse the timeline result from lastForcePushTime()?
> 
> Could you also update the javadoc on `lastForcePushTime` that it's returning the last time something was force pushed while not in draft state.

Good idea! I will try to reuse it. I will update the java doc too.

-------------

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


More information about the skara-dev mailing list