Project

General

Profile

Actions

action #133328

closed

Notification settings API | GitLab: I wonder if we can loop over all and disable/enable size:M

Added by okurz over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Start date:
2023-07-25
Due date:
2023-08-29
% Done:

0%

Estimated time:

Description

Motivation

Often we have broken gitlab CI pipelines which cause a shitload of notification emails which make people go into alert fatigue pretty quickly. jbaier recently disabled email notifications for selected projects as long as there were known issues to be fixed infra-wise. Maybe we can find a single-command that we can execute in such cases to disable all "relevant" project's notifications and then enable again.

Acceptance criteria

  • AC1: progress.opensuse.org/projects/qa/wiki/tools#Alert-handling mentions a feasible way how to disable/enable gitlab CI notifications for osd-admins@suse.de email notifications

Suggestions

  • See how it already works over the GUI, e.g. on https://gitlab.suse.de/openqa/salt-states-openqa/edit, go to "Visibility, project features, permissions" and at the bottom of the section there is a checkbox "Disable email notifications". That's the one
  • Lookup https://docs.gitlab.com/ee/api/notification_settings.html or related APIs as we know it's possible to do over the GUI and come up with a fancy bash-for-loop curl based API call or something with the input of a list of common projects and controlling any notifications to osd-admins@suse.de (not the individual users)
  • Maybe it's possible to query "all projects which have osd-admins@suse.de in email-notifications" otherwise hard-code a list
  • Add to progress.opensuse.org/projects/qa/wiki/tools#Alert-handling

Further details

  • This is not about personal notification subscriptions to git projects but about gitlab CI email notifications to osd-admins@suse.de only
  • It's ok if the email notifications are disabled for all subscribed email addresses, not only osd-admins@suse.de
Actions #1

Updated by okurz over 1 year ago

  • Priority changed from Normal to High
Actions #2

Updated by okurz over 1 year ago

  • Subject changed from Notification settings API | GitLab: I wonder if we can loop over all and disable/enable to Notification settings API | GitLab: I wonder if we can loop over all and disable/enable size:M
  • Description updated (diff)
  • Status changed from New to Workable
Actions #4

Updated by osukup over 1 year ago

  • Assignee set to osukup
Actions #5

Updated by osukup over 1 year ago

  • Status changed from Workable to In Progress
Actions #6

Updated by openqa_review over 1 year ago

  • Due date set to 2023-08-29

Setting due date based on mean cycle time of SUSE QE Tools

Actions #7

Updated by osukup over 1 year ago

All email notification are handled by Pipeline status emails integration ...

bot-ng -> repo level
salt-states-openqa -> repo level
salt-pillars-openqa -> repo level
openqa-review -> repo level

Actions #8

Updated by osukup over 1 year ago

API command to create notifications for CI pipeline:

curl -X PUT --data 'recipients=osd-admins@suse.de&notify_only_broken_pipelines=true' --header "Authorization: Bearer OAUTH2_USER_TOKEN" 'https://gitlab.suse.de/api/v4/projects/6096/integrations/pipelines-email'

API command to remove notifications from CI pipeline

curl -X DELETE --header "Authorization: Bearer OAUTH2_USER_TOKEN" 'https://gitlab.suse.de/api/v4/projects/6096/integrations/pipelines-email'

Projects:
6096 - bot-ng
4877 - auto-review
5544 - monitor-o3
3731 - osd-deployment
743 - salt-states-openqa
746 - salt-pillars-openqa
4652 - graphana webhook actions
3530 - openQABot

Actions #9

Updated by osukup over 1 year ago

  • Status changed from In Progress to Feedback

docu updated with example for full disable/enable email notifications

Actions #10

Updated by livdywan over 1 year ago

  • Status changed from Feedback to Resolved

So it's documented in the Tools wiki, and includes what token is needed.

Actions

Also available in: Atom PDF