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 Synapse backup s3-integration #139

Merged

Conversation

javierdelapuente
Copy link
Collaborator

@javierdelapuente javierdelapuente commented Jan 17, 2024

Applicable spec: ISD095

Overview

This PR creates a new integration with S3 with the goal of being able to create, list, restore
and delete backups. Those tasks will be done in future PRs. In this one the goal is
to create the integration with a simple test to check that the bucket exists when s3-integration
is integrated with Synapse. All this functionality will be refined in the next PRs.

Rationale

Backups will me stored in S3, so the integration is needed.

Juju Events Changes

on_credentials_changed and on_credentials_gone from the charms.data_platform_libs.v0.s3 library.

Module Changes

New module backup that will handle backup functionality and will use S3 credentials.

Library Changes

Added charms.data_platform_libs.v0.s3 library.

Checklist

@javierdelapuente javierdelapuente marked this pull request as ready for review January 18, 2024 10:42
@javierdelapuente javierdelapuente requested a review from a team as a code owner January 18, 2024 10:42
src/backup.py Outdated Show resolved Hide resolved
src/backup.py Outdated Show resolved Hide resolved
Copy link
Contributor

@cbartz cbartz left a comment

Choose a reason for hiding this comment

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

Looks good overall, left some comments.

metadata.yaml Outdated Show resolved Hide resolved
docs/reference/integrations.md Outdated Show resolved Hide resolved
src/backup.py Outdated Show resolved Hide resolved
src/backup.py Show resolved Hide resolved
tests/unit/test_backup.py Outdated Show resolved Hide resolved
src/backup.py Outdated Show resolved Hide resolved
src/backup.py Show resolved Hide resolved
tests/integration/test_charm.py Outdated Show resolved Hide resolved
tests/integration/test_charm.py Outdated Show resolved Hide resolved
tests/integration/test_charm.py Outdated Show resolved Hide resolved
tests/unit/test_backup.py Show resolved Hide resolved
tests/unit/test_backup.py Outdated Show resolved Hide resolved
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

Copy link
Contributor

Test coverage for ccd2406

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/backup.py                      37      0      2      0   100%
src/backup_observer.py             29      0      2      0   100%
src/charm.py                      222      8     50      4    96%   165-166, 227-228, 247-248, 289, 303
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           48      4      4      0    92%   69-71, 87
src/exceptions.py                   4      1      0      0    75%   22
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                            1268     47    210     24    95%

Static code analysis report

Run started:2024-01-22 13:48:49.532394

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 6802
  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):

@javierdelapuente javierdelapuente merged commit 50e6d74 into main Jan 22, 2024
21 checks passed
@javierdelapuente javierdelapuente deleted the ISD-1492-Synapse-Create-S3-configuration-for-backup branch January 22, 2024 16:02
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