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 via the smtp-integrator charm #127

Merged
merged 49 commits into from
Jan 8, 2024

Conversation

javierdelapuente
Copy link
Collaborator

@javierdelapuente javierdelapuente commented Dec 14, 2023

Overview

Currently, to configure SMTP in synapse-operator you need to set configuration options. The change allows retrieving SMTP configuration from the SMTP integrator charm.

Rationale

Leverage the new SMTP integrator charm. As an added benefit, SMTP configuration can be shared by several applications and secrets can be used.

Juju Events Changes

Module Changes

  • New SMTP observer module
  • Changes in state. Added SMTPConfiguration
  • Changes in charm
  • Changes in pebble, added enable_smtp
  • Changes in workload to write the new configuration to Synapse configuration file

Library Changes

Library charms.smtp_integrator.v0.smtp is included to make use of the smtp-integrator charm.

Checklist

src-docs/charm_state.py.md Show resolved Hide resolved
src-docs/charm_state.py.md Show resolved Hide resolved
src-docs/charm_state.py.md Show resolved Hide resolved
src-docs/charm_state.py.md Show resolved Hide resolved
src/charm_state.py Show resolved Hide resolved
src/charm_state.py Show resolved Hide resolved
src/charm_state.py Show resolved Hide resolved
src/charm_state.py Show resolved Hide resolved
@javierdelapuente javierdelapuente changed the title Isd 1443 smtp via integrator charm Add smtp integration via the smtp-integrator charm Dec 15, 2023
@javierdelapuente javierdelapuente changed the title Add smtp integration via the smtp-integrator charm Add SMTP via the smtp-integrator charm Dec 15, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 103 files.

Valid Invalid Ignored Fixed
0 46 57 0
Click to see the invalid file list
  • actions.yaml
  • charmcraft.yaml
  • config.yaml
  • generate-src-docs.sh
  • metadata.yaml
  • mjolnir_snap/snapcraft.yaml
  • nginx_rock/rockcraft.yaml
  • pyproject.toml
  • src/actions/init.py
  • src/actions/register_user.py
  • src/actions/reset_instance.py
  • src/charm.py
  • src/charm_state.py
  • src/charm_types.py
  • src/database_client.py
  • src/database_observer.py
  • src/exceptions.py
  • src/mjolnir.py
  • src/observability.py
  • src/pebble.py
  • src/saml_observer.py
  • src/smtp_observer.py
  • src/synapse/init.py
  • src/synapse/api.py
  • src/synapse/workload.py
  • src/user.py
  • synapse_rock/attributemaps/login_ubuntu.py
  • synapse_rock/rockcraft.yaml
  • tests/init.py
  • tests/conftest.py
  • tests/integration/init.py
  • tests/integration/conftest.py
  • tests/integration/test_charm.py
  • tests/unit/init.py
  • tests/unit/conftest.py
  • tests/unit/test_anonymize_user_action.py
  • tests/unit/test_charm.py
  • tests/unit/test_database.py
  • tests/unit/test_mjolnir.py
  • tests/unit/test_promote_user_admin_action.py
  • tests/unit/test_register_user_action.py
  • tests/unit/test_reset_instance_action.py
  • tests/unit/test_smtp_observer.py
  • tests/unit/test_synapse_api.py
  • tests/unit/test_synapse_workload.py
  • tox.ini

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 103 files.

Valid Invalid Ignored Fixed
0 46 57 0
Click to see the invalid file list
  • actions.yaml
  • charmcraft.yaml
  • config.yaml
  • generate-src-docs.sh
  • metadata.yaml
  • mjolnir_snap/snapcraft.yaml
  • nginx_rock/rockcraft.yaml
  • pyproject.toml
  • src/actions/init.py
  • src/actions/register_user.py
  • src/actions/reset_instance.py
  • src/charm.py
  • src/charm_state.py
  • src/charm_types.py
  • src/database_client.py
  • src/database_observer.py
  • src/exceptions.py
  • src/mjolnir.py
  • src/observability.py
  • src/pebble.py
  • src/saml_observer.py
  • src/smtp_observer.py
  • src/synapse/init.py
  • src/synapse/api.py
  • src/synapse/workload.py
  • src/user.py
  • synapse_rock/attributemaps/login_ubuntu.py
  • synapse_rock/rockcraft.yaml
  • tests/init.py
  • tests/conftest.py
  • tests/integration/init.py
  • tests/integration/conftest.py
  • tests/integration/test_charm.py
  • tests/unit/init.py
  • tests/unit/conftest.py
  • tests/unit/test_anonymize_user_action.py
  • tests/unit/test_charm.py
  • tests/unit/test_database.py
  • tests/unit/test_mjolnir.py
  • tests/unit/test_promote_user_admin_action.py
  • tests/unit/test_register_user_action.py
  • tests/unit/test_reset_instance_action.py
  • tests/unit/test_smtp_observer.py
  • tests/unit/test_synapse_api.py
  • tests/unit/test_synapse_workload.py
  • tox.ini

@javierdelapuente javierdelapuente marked this pull request as ready for review January 2, 2024 09:38
@javierdelapuente javierdelapuente requested a review from a team as a code owner January 2, 2024 09:38
yanksyoon
yanksyoon previously approved these changes Jan 2, 2024
Copy link
Contributor

@yanksyoon yanksyoon left a comment

Choose a reason for hiding this comment

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

LGTM! Minor questions to understand synapse better :D
(I think it might help if the LICENSE header changes were in a separate PR :D)

src/charm.py Show resolved Hide resolved
src/charm_state.py Show resolved Hide resolved
src/charm_types.py Show resolved Hide resolved
src/pebble.py Show resolved Hide resolved
src/smtp_observer.py Show resolved Hide resolved
src/smtp_observer.py Show resolved Hide resolved
src/smtp_observer.py Show resolved Hide resolved
src/synapse/workload.py Show resolved Hide resolved
@javierdelapuente
Copy link
Collaborator Author

LGTM! Minor questions to understand synapse better :D (I think it might help if the LICENSE header changes were in a separate PR :D)

Totally right, sorry for the LICENSE changes, I updated them to pass the tests

amandahla
amandahla previously approved these changes Jan 4, 2024
Copy link
Collaborator

@amandahla amandahla left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

.github/workflows/integration_test.yaml Outdated Show resolved Hide resolved
config.yaml Show resolved Hide resolved
docs/tutorial/getting-started.md Outdated Show resolved Hide resolved
docs/tutorial/getting-started.md Outdated Show resolved Hide resolved
docs/tutorial/getting-started.md Outdated Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/smtp_observer.py Outdated Show resolved Hide resolved
tests/integration/test_charm.py Outdated Show resolved Hide resolved
tests/unit/test_smtp_observer.py Outdated Show resolved Hide resolved
tests/unit/test_smtp_observer.py Outdated Show resolved Hide resolved
merkata
merkata previously approved these changes Jan 8, 2024
Copy link
Contributor

@merkata merkata left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Copy link
Contributor

github-actions bot commented Jan 8, 2024

Test coverage for 5a7e105

Name                            Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------
src/actions/__init__.py             3      0      0      0   100%
src/actions/register_user.py       22      0      2      0   100%
src/actions/reset_instance.py      21      0      2      0   100%
src/charm.py                      220      8     50      4    96%   163-164, 225-226, 245-246, 287, 301
src/charm_state.py                 63      1     10      1    97%   127
src/charm_types.py                 21      0      2      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                     76      6     20      1    91%   60-64, 73
src/observability.py                9      0      0      0   100%
src/pebble.py                      96     12     16      6    84%   91-92, 94-95, 103, 105, 107, 111, 132-133, 148-149
src/saml_observer.py               45      1      8      0    98%   64
src/smtp_observer.py               70      3     14      1    95%   70-74, 96->101
src/synapse/__init__.py             3      0      0      0   100%
src/synapse/api.py                161      2     22      2    98%   207, 376
src/synapse/workload.py           261      8     42      6    95%   386->exit, 415-416, 468-469, 505-506, 522, 571->574, 618, 626->628, 628->630
src/user.py                        24      0      4      0   100%
---------------------------------------------------------------------------
TOTAL                            1206     46    208     24    95%

Static code analysis report

Run started:2024-01-08 12:15:38.679608

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 6352
  Total lines skipped (#nosec): 4
  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):

Copy link
Collaborator

@amandahla amandahla left a comment

Choose a reason for hiding this comment

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

LGTM

@javierdelapuente javierdelapuente merged commit b845c2f into main Jan 8, 2024
20 checks passed
@javierdelapuente javierdelapuente deleted the ISD-1443-smtp-via-integrator-charm branch January 8, 2024 16:47
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.

7 participants