screwdriver-cd / screwdriver

An open source build platform designed for continuous delivery.
http://screwdriver.cd
Other
1.01k stars 168 forks source link

Desktop notifications #2369

Open wahapo opened 3 years ago

wahapo commented 3 years ago

What happened: It would be nice to have a desktop notification when all event builds are complete.

What you expected to happen: This can be implemented by using https://pushjs.org/ , for example.

How to reproduce it:

yakanechi commented 6 months ago

Since there was a need for this functionality, we are proposing two types of modifications. we are suggesting two options, but in practice, we recommend the first.

  1. Push notification from the browser when the status of the pipeline screen is changed to success, error, and fixed.

    • Advantages
      • Very easy to implement.
      • Users can enable notifications by Simply adding a notification on/off button to the user's settings page.
    • Disadvantages
      • The user must keep the pipeline screen that they want to receive notifications from open in the browser. However, this is not such a big issue since it can be opened in a separate tab.
      • Notification timing is not completely real-time as it depends on the frequency of UI updates.
  2. Push notification from API using ServiceWorker

    • Advantages
      • Convenient for users as notifications are sent even when the pipeline screen or other screens are not displayed.
    • Disadvantages
      • DB needs to be modified to manage destination endpoints and public keys, which can lead to large-scale changes.
      • Also, when the build is complete, the DB must be searched to determine who to notify., which may put a burden on the DB.

Push notifications are intended to be used in casual pipelines, such as testing and behavior checks, where it is not necessary to add configuration to yaml. Since notifications are already implemented in Slack, etc., I have decided that it is not a feature that would put too much load on the DB or anything like that.

tanoda commented 6 months ago

These days, some browsers may unload the inactive (background) page. So, the first option's disadvantages might not have a workaround.

(edit: maybe not severe, but no workaround. and this applies to all two disadvantages)

yakanechi commented 6 months ago

After checking, it may be possible to work around it in Chrome with settings such as Calculate window occlusion on Windows. However, it is undesirable to force users to accept a browser-wide performance degradation. Also, other browsers do not have the same workaround. Proposal 1 seems to be deprecated because it is incompatible with current browsers.

yakanechi commented 6 months ago

@tanoda The team decided to recommend idea 1. Idea 2 would duplicate the role of other functions such as Slack and email, and it is not enough of a feature to make changes to the DB as a need for Push notifications. Idea 1 was determined to avoid the problem through user operation, although there is a burden on the user in the case of multiple displays, such as placing the sub-display on the edge of the display.

tanoda commented 6 months ago

Alright, no problem at all. I was just letting you know that the workaround is not very good these days. It's good that you decided on it with updated pros/cons.