GoogleCloudPlatform / GoogleCloudPlatform/nodejs-docs-samples
Refactor alerts.replaceChannels.js snippet to align with code sample snippet guidelines
- Lingua principale
- JavaScript
- Stelle
- 3k
- Fork
- 2k
- Merge medio
- 2g 19h
- PR unite (30g)
- 44
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con monitoring/snippets/alerts.replaceChannels.js e verifica i suoi quattro tag di regione rispetto alle tre azioni richieste. Suddividi l’esempio in tre snippet, commenta chiaramente gli input previsti e aggiungi la gestione degli input non validi; il lavoro è completato quando ogni azione è dimostrata in modo indipendente con una gestione ragionevole degli errori.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- google-cloud, javascript
- Ambito
- cloud, documentation
- Tipo di issue
- Refactoring
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100