action #133328
closedNotification settings API | GitLab: I wonder if we can loop over all and disable/enable size:M
0%
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
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
Updated by osukup over 1 year ago
I think the correct API is https://docs.gitlab.com/ee/api/integrations.html#pipeline-emails
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
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
Updated by osukup over 1 year ago
API command to create notifications for CI pipeline:
curl -X PUT --data 'recipients=osd-admins@suse.de¬ify_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
Updated by osukup over 1 year ago
- Status changed from In Progress to Feedback
docu updated with example for full disable/enable email notifications
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.