[reports-service] Parse email config from CLI args
Summary:
Introduced possibility to pass email config either via CLI args, or from a file (with path configurable from CLI).
The Postmark API token can also be passed as an env variable.
Config being None means that e-mails are disabled.
Depends on D8978
Test Plan:
Unit tests, also printed the config object and confirmed that:
- Config is None if no args passed and no email-config.json present
- Config is Some if no args passed and valid email-config.json present
- Config is None if no args passed and invalid email-config.json present
- Config from email-config.json is overriden by inline json passed as --email-config arg
- Error is raised if --email-config arg contains invalid JSON (malfolmed or missing fields)
- Error is raised if both --email-config and --email-config-file are present at the same time
- Error is raised if --email-config-file contains invalid path (e.g. file not exists)
- Error is raised if --email-config-file contains path to incorrect JSON
- Postmark token is read from the config file
- If POSTMARK_TOKEN env is present, it overrides the file value
- If the token isn't present in the config file or env, an warn is displayed and config is None
Reviewers: michal, patryk, varun, jon
Reviewed By: michal
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D8980