RFR: 1683: The force push notifier needs an overhaul [v2]

Erik Joelsson erikj at openjdk.org
Wed Nov 23 18:52:46 UTC 2022

On Wed, 23 Nov 2022 00:21:44 GMT, Zhao Song <zsong 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.
> Zhao Song has updated the pull request incrementally with one additional commit since the last revision:
>   fix some bugs

forge/src/main/java/org/openjdk/skara/forge/PullRequest.java line 185:

> 183:     /**
> 184:      * Return the last time something was force pushed while not in draft state.
> 185:      * If there is no force-push in pull request or the restful api doesn't support force-push, return empty.

Try to keep javadoc comments to 80 char line width.

forge/src/main/java/org/openjdk/skara/forge/github/GitHubPullRequest.java line 811:

> 809:                 .map(obj -> ZonedDateTime.parse(obj.get("created_at").asString()));
> 810:         if (latestTime.isPresent()) {
> 811:             readyTime = latestTime.get();

You could express this as

latestTime.orElseGet(() -> createdAt())

and just put it last in the stream call chain.


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

More information about the skara-dev mailing list