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

WIP Add moderation service #714

Draft
wants to merge 5 commits into
base: 2/main
Choose a base branch
from
Draft

WIP Add moderation service #714

wants to merge 5 commits into from

Conversation

amandahla
Copy link
Collaborator

Overview

This PR adds Draupnir as a moderation service to Synapse. To ensure compatibility with the migration from the previous charm, it introduces two configurations: moderation_access_token and moderation_room_alias. These configurations can be provided to set up Draupnir (the moderation application).

Additionally, this PR:

Removes src-docs.
Fixes the name of the Loki rule.

Rationale

Mjolnir (the previous moderation application) is not compatible with MAS (Matrix Authentication Service)

Juju Events Changes

Module Changes

Library Changes

Checklist

  • The charm style guide was applied
  • The contributing guide was applied
  • The changes are compliant with ISD054 - Manging Charm Complexity
  • The documentation is generated using src-docs
  • The documentation for charmhub is updated.
  • The PR is tagged with appropriate label (urgent, trivial, complex)
  • The changelog is updated with changes that affect the users of the charm.

@amandahla amandahla mentioned this pull request Mar 10, 2025
7 tasks
Copy link
Contributor

Test results for commit 68d3171

Test coverage for 68d3171

Name                                    Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------
src/auth/__init__.py                        0      0      0      0   100%
src/auth/mas.py                            79      6      2      1    91%   86-88, 105-107, 140->142
src/backup.py                             175      5     20      2    96%   353-354, 423-424, 481->483, 484
src/backup_observer.py                    134     16     12      0    89%   132-135, 140-143, 179-182, 211-214
src/charm.py                              272     18     64     10    92%   141->143, 146, 266, 270-271, 277-278, 299-300, 324, 331, 406-410, 413-414, 442-444, 464
src/charm_types.py                         30      0      0      0   100%
src/database_client.py                     57      1      8      4    92%   35, 47->exit, 69->exit, 88->98
src/database_observer.py                   49      4      2      0    92%   61-64
src/exceptions.py                           3      0      0      0   100%
src/matrix_auth_observer.py                59      5      6      0    92%   133-137
src/media_observer.py                      45      4      2      1    89%   60-62, 81
src/observability.py                       13      0      0      0   100%
src/pebble.py                             212     38     46     12    81%   157->exit, 168-172, 216-217, 237-238, 256-259, 320->325, 330-331, 343-344, 346-347, 378, 380, 382, 384, 386, 393-396, 422, 573-589, 598-605
src/redis_observer.py                      39      3      4      0    93%   63-66
src/s3_parameters.py                       22      0      4      0   100%
src/smtp_observer.py                       61      1     14      2    96%   89, 108->113
src/state/__init__.py                       0      0      0      0   100%
src/state/charm_state.py                  129      9     32      7    90%   168, 172, 193, 218, 224, 230, 234-235, 318
src/state/mas.py                           78      8      6      3    87%   152, 158-159, 183-185, 200, 220
src/state/validation.py                    36      3      2      0    92%   110-112
src/synapse/__init__.py                     3      0      0      0   100%
src/synapse/api.py                        129      6     18      4    93%   111-112, 161, 172, 174, 314
src/synapse/workload.py                   127     11     24      0    90%   366-369, 379-385
src/synapse/workload_configuration.py     149     26     34     12    79%   90->exit, 94-95, 143-144, 173, 193-194, 226-227, 260, 269-270, 285, 290-291, 312-313, 332->337, 338, 356->358, 368-369, 397, 405->407, 407->409, 414-415, 435->442, 445, 465-466
src/user.py                                23      0      2      0   100%
-----------------------------------------------------------------------------------
TOTAL                                    1924    164    302     58    90%
Coverage failure: total of 90 is less than fail-under=91

Static code analysis report

Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Run started:2025-03-10 13:31:04.965784

Test results:
  No issues identified.

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

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.

1 participant