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

Add SMTP configuration #56

Merged
merged 18 commits into from
Oct 4, 2023
Merged

Conversation

amandahla
Copy link
Collaborator

@amandahla amandahla commented Sep 28, 2023

Overview

Synapse can send e-mail notifications to users regarding new messages, events, etc. To make it possible, an SMTP server must be configured.

Also, this PR addresses the following issues commented on #43:

  • Convert CharmState to dataclass
  • Change from_charm to use CharmBase as parameter
  • Pass Datasource and SAMLConfiguration as parameters
  • Sort config.yaml file alphabetically
  • Make database and saml variables privates
  • Change functions order in workload.py accordingly to its usage

Plus:

  • Add use-existing parameter to integration test so is easier to run integration tests locally without waiting for deploy every time.
  • Add cos mark so it can be skipped.

Rationale

Send e-mail notifications.

Juju Events Changes

N/A

Module Changes

N/A

Library Changes

N/A

Checklist

@amandahla amandahla requested a review from a team as a code owner September 28, 2023 19:46
@amandahla amandahla marked this pull request as draft September 28, 2023 19:46
tests/integration/test_charm.py Outdated Show resolved Hide resolved
tests/integration/test_charm.py Outdated Show resolved Hide resolved
@amandahla amandahla marked this pull request as ready for review September 29, 2023 21:02
@amandahla amandahla changed the title WIP - Add SMTP configuration Add SMTP configuration Sep 29, 2023
arturo-seijas
arturo-seijas previously approved these changes Oct 3, 2023
Copy link
Collaborator

@arturo-seijas arturo-seijas left a comment

Choose a reason for hiding this comment

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

LGTM

src/charm_state.py Show resolved Hide resolved
config.yaml Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Test coverage for 49cf7ad

Name                            Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------
src/actions/__init__.py             3      0      0      0   100%
src/actions/register_user.py       21      0      2      0   100%
src/actions/reset_instance.py      21      3      2      1    83%   54-58
src/charm.py                      107      4     14      1    96%   112-113, 165-166
src/charm_state.py                 52      1     12      1    97%   121
src/charm_types.py                 11      0      0      0   100%
src/database_client.py             53      1     10      3    94%   35, 47->exit, 69->exit
src/database_observer.py           54      4      6      0    93%   70-72, 88
src/exceptions.py                   4      0      0      0   100%
src/mjolnir.py                    103      2     26      4    95%   68, 80->exit, 116, 181->186
src/observability.py                9      0      0      0   100%
src/pebble.py                      75      9      4      2    86%   90-91, 93, 107-112
src/saml_observer.py               45      1      8      0    98%   64
src/synapse/__init__.py             3      0      0      0   100%
src/synapse/api.py                161      5     20      2    96%   144, 315, 399-401
src/synapse/workload.py           187      6     26      6    94%   343-344, 360, 390->393, 409->412, 458, 460, 465
src/user.py                        24      0      4      0   100%
---------------------------------------------------------------------------
TOTAL                             933     36    134     20    95%

Static code analysis report

Run started:2023-10-04 13:27:57.379690

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 4527
  Total lines skipped (#nosec): 7
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@amandahla amandahla merged commit fce8bfb into main Oct 4, 2023
20 checks passed
@amandahla amandahla deleted the ISD-796-synapse-add-smtp-configuration branch October 4, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants