Uploaded image for project: 'Skara'
  1. Skara
  2. SKARA-1683

The force push notifier needs an overhaul

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.0
    • None
    • admin
    • None

      SKARA-1119 introduced the ability to warn users when force-pushing to an active PR. Some weird behavior was just observed in https://github.com/openjdk/jdk/pull/11202, where the bot complained about the force push 5 hours after it happened. The explanation for what happened is as follows:

      The force push happened before the bridgekeeper welcome message, so the notifier initialized its initial state after that force push. It wasn't until another push happened that the notifier could react to a "headChange". It would then check if any force push has happened at all, see that it has, and post the notification.

      Looking at this implementation, I'm baffled. This notification is implemented in the PullRequestBranchNotifier of all places. It really does not belong there. That notifier has a very clear and well defined scope, and notifying users is not in it. This also has the consequence of only notifying users about force push when the prbranch notifier is configured on a repo(!). To fix this properly, we need to move this functionality somewhere else. Either a separate listener, or another bot altogether. I'm not sure it should be in the notifier at all. It probably fits better in CheckWorkItem.

            zsong Zhao Song
            erikj Erik Joelsson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: