GoogleCloudPlatform / GoogleCloudPlatform/nodejs-docs-samples

Refactor alerts.replaceChannels.js snippet to align with code sample snippet guidelines

Offen
#3,114 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: monitoring lang: nodejs priority: p2 samples type: cleanup
Vorherrschende Sprache
JavaScript
Sterne
3k
Forks
2k
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
44

Beschreibung

The current version of [alerts.replaceChannels.js] contains four different region tags that demonstrate 3 (or, arguably 4) different actions. The sample flow does three different actions:

* runs through hardcoded list of notification channel names
* calls API to enable each channel using its name
* on (_any_) creates a new email notification channel with that name
* modifies hardcoded alert policy to send notifications to the hardcoded list of channels

The code should be split into 3 snippets (a snippet per file) to demonstrate the following three actions:

1. Update notification channel. The snippet can be conditioned that the channel should exist.
1. Create a new notification channel.
1. Update an alert policy with a notification channel.

All snippets should provide a reasonable error handling. Inputs should be clearly commented to explain expectations. Error handling should, at least, handle errors when inputs are invalid.

[alerts.replaceChannels.js]: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/monitoring/snippets/alerts.replaceChannels.js

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit monitoring/snippets/alerts.replaceChannels.js und überprüfe dessen vier Region-Tags im Hinblick auf die drei angeforderten Aktionen. Teile das Beispiel in drei Snippets auf, kommentiere die erwarteten Eingaben eindeutig und ergänze die Behandlung ungültiger Eingaben; abgeschlossen bedeutet, dass jede Aktion unabhängig voneinander mit angemessener Fehlerbehandlung demonstriert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
google-cloud, javascript
Bereich
cloud, documentation
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.