Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/984: bulk update notification email addresses #1066

Open
wants to merge 71 commits into
base: develop
Choose a base branch
from

Conversation

phjulia
Copy link
Collaborator

@phjulia phjulia commented Aug 3, 2023

PR details

What changes did you make? (Give an overview)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • test scripts updated
  • Wiki updated (if applicable)

@phjulia
Copy link
Collaborator Author

phjulia commented Aug 3, 2023

TODO:

  • Test method
  • function for import file (no endpoint, need to retrieve, update notification email address and re-deploy)
  • check if there are any other types apart for automation and import file where notifications can be set
  • retrieve and update in retrieve + run document to update the .md with notifications. Remove retrieve in test method - it should no longer be necessary
  • some email pre-validation (MC will return "bad payload" if email is not valid)
  • some interactive questions, if someone provided a note but there is no email address, ask if they want to add an email address, otherwise skip the note

Copy link
Contributor

@JoernBerkefeld JoernBerkefeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know this is still in draft but I wanted to give you a few pointers early on :)

lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
lib/cli.js Outdated Show resolved Hide resolved
lib/index.js Outdated Show resolved Hide resolved
lib/index.js Outdated Show resolved Hide resolved
lib/metadataTypes/Automation.js Show resolved Hide resolved
lib/metadataTypes/Automation.js Outdated Show resolved Hide resolved
@phjulia phjulia linked an issue Aug 5, 2023 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Aug 13, 2023

Coverage Report

Commit:8e2670a
Base: develop@8e008d3

Type Base This PR
Total Statements Coverage  63.39%  63.69%  (+0.3%)
Total Branches Coverage  67.01%  68.23%  (+1.22%)
Total Functions Coverage  72.14%  72.25%  (+0.11%)
Total Lines Coverage  63.39%  63.69%  (+0.3%)
Details (changed files):
File Statements Branches Functions Lines
lib/cli.js  0%  0%  0%  0%
lib/index.js  69.5%  54.19%  68.57%  69.5%
lib/metadataTypes/Automation.js  81.12%  72.03%  95%  81.12%
lib/metadataTypes/ImportFile.js  82.26%  60%  100%  82.26%
lib/metadataTypes/MetadataType.js  77.32%  72.88%  70%  77.32%
lib/util/cli.js  36.22%  76.92%  23.07%  36.22%
lib/util/util.js  79.64%  75.59%  85.29%  79.64%

@phjulia
Copy link
Collaborator Author

phjulia commented Aug 13, 2023

TODO:

  • email validation in interactive questions and in updateNotifications itself
  • a test for importFile updateNotifications, a test for clearNotifications

@JoernBerkefeld
Copy link
Contributor

DataVerification activities also have a notification option... but u need to know their id to update them

@phjulia
Copy link
Collaborator Author

phjulia commented Aug 20, 2023

DataVerification activities also have a notification option... but u need to know their id to update them

@JoernBerkefeld mcdev does not have data verification as a type yet. I would need to retrieve, then update and deploy like with importFile activity
Maybe in another PR?

@JoernBerkefeld JoernBerkefeld modified the milestones: 5.3.0, 5.4.0 Aug 31, 2023
@phjulia
Copy link
Collaborator Author

phjulia commented Aug 31, 2023

updateNotifications

Command: mcdev updateNotifications [business unit] [metadata type] [metadata key] [--completionEmail] [--errorEmail] [--completionNote] [--errorNote] [--clear]

Alias: mcdev un

Updates notification email addresses. There are 4 possible options for automations: --completionEmail, --errorEmail,
--completionNote and --errorNote. One or more can be specified. If you want to receive email notifications about failed/successful automation runs to more than one email address – list email addresses separated with a comma. You can also remove notification email addresses and/or notes with a --clear option. There are 4 possible values for --clear option: all completionEmail, errorEmail, notes.

Currently, this command supports automation, importFile and verification types. For import file there are only --clear and --completionEmail options. You can provide any value for --clear option in case of importFile and verification types.

Examples (set notifications):

mcdev updateNotifications MyProject/DEV automation --completionEmail=test@test.com --completionNote='test note'
mcdev updateNotifications MyProject/DEV automation --errorEmail='test@test.com,test2@test.com' 
--completionNote='test note'
mcdev updateNotifications MyProject/DEV importFile --completionEmail=test@test.com
mcdev updateNotifications MyProject/DEV verification --completionEmail=test@test.com
mcdev updateNotifications MyProject/DEV verification --completionEmail=test@test.com --completionNote='test note'

Examples (remove notifications):

mcdev updateNotifications MyProject/DEV automation --clear=all
mcdev updateNotifications MyProject/DEV automation --clear=completionEmail
mcdev updateNotifications MyProject/DEV automation --clear=errorEmail
mcdev updateNotifications MyProject/DEV automation --clear=notes
mcdev updateNotifications MyProject/DEV importFile --clear=true

@phjulia phjulia changed the title Feature/984 feature bulk update notification email addresses Feature/984: bulk update notification email addresses Sep 3, 2023
@JoernBerkefeld JoernBerkefeld modified the milestones: 6.1.0, 6.2.0 May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] bulk update notification email addresses
2 participants