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

Render mas config from template #616

Open
wants to merge 61 commits into
base: 2/main
Choose a base branch
from

Conversation

Thanhphan1147
Copy link
Collaborator

@Thanhphan1147 Thanhphan1147 commented Dec 3, 2024

This PR adds the template for the mas configuration file. Required values used to generate the configuration file is fetched from juju secrets and charm config values at the beginning of the hooks.

Checklist

@Thanhphan1147 Thanhphan1147 force-pushed the render_mas_config_from_template branch from 77eede4 to 4e4ff6d Compare December 6, 2024 23:31
@Thanhphan1147 Thanhphan1147 marked this pull request as ready for review December 9, 2024 19:05
@Thanhphan1147 Thanhphan1147 requested a review from a team as a code owner December 9, 2024 19:05
src/auth/mas.py Outdated Show resolved Hide resolved
src/database_observer.py Outdated Show resolved Hide resolved
src/state/mas.py Outdated Show resolved Hide resolved
tests/unit/conftest.py Outdated Show resolved Hide resolved
charmcraft.yaml Outdated Show resolved Hide resolved
tests/unit/test_mas.py Outdated Show resolved Hide resolved
Copy link
Contributor

Test coverage for ad63e70

Name                                    Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------
src/actions/__init__.py                     1      0      0      0   100%
src/actions/register_user.py               21      0      2      0   100%
src/admin_access_token.py                   9      0      0      0   100%
src/auth/__init__.py                        0      0      0      0   100%
src/auth/mas.py                            12      0      0      0   100%
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                              305     20     70     11    92%   140->142, 145, 258, 262-263, 269-270, 291-292, 321, 328, 408-412, 415-416, 444-446, 466, 502-503
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                68      8     12      3    86%   63, 66, 145, 159-163
src/media_observer.py                      45      4      2      1    89%   60-62, 81
src/mjolnir.py                            102      3     30      3    95%   85, 94->110, 115-119
src/observability.py                       14      0      0      0   100%
src/pebble.py                             210     29     46     12    84%   58->63, 177->exit, 188-192, 226-227, 247-248, 266-269, 324->329, 334-335, 347-348, 350-351, 384, 386, 388, 390, 392, 420, 474-479
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      4     14      2    92%   82-86, 89, 108->113
src/state/__init__.py                       0      0      0      0   100%
src/state/charm_state.py                  128      9     32      7    90%   166, 170, 191, 216, 222, 228, 232-233, 316
src/state/mas.py                           72      7      4      2    88%   145, 151-152, 176-178, 193
src/state/validation.py                    36      3      2      0    92%   105-107
src/synapse/__init__.py                     4      0      0      0   100%
src/synapse/admin.py                       19      2      2      0    90%   40-41
src/synapse/api.py                        175      3     20      3    97%   176, 229, 402
src/synapse/workload.py                   138      6     24      0    94%   401-402, 412-415
src/synapse/workload_configuration.py     148     26     34     12    79%   88->exit, 92-93, 141-142, 171, 191-192, 224-225, 258, 267-268, 283, 288-289, 310-311, 330->335, 336, 354->356, 366-367, 395, 403->405, 405->407, 412-413, 433->440, 443, 463-464
src/user.py                                23      0      2      0   100%
-----------------------------------------------------------------------------------
TOTAL                                    2100    153    346     62    91%

Static code analysis report

Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Run started:2024-12-10 15:35:16.355149

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 11166
  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
Contributor

@gregory-schiano gregory-schiano left a comment

Choose a reason for hiding this comment

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

Approved, there's just a small typo to fix

raise MASContextNotSetError("Waiting for leader to set MAS context.")

# The leader unit skips raising the above exception to generate the initial values
# for the MAS context and put them in juju secret which can be picked up by pees units
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo: peer instead of pees

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.

3 participants