canonical / paas-app-charmer

2 stars 2 forks source link

S3 Integration for paas-app-charmer #19

Closed javierdelapuente closed 3 months ago

javierdelapuente commented 3 months ago

Applicable spec:

Overview

This PR add the S3 integration to paas-app-charmer.

For that, it uses the s3-integrator charm. It will inject the following environment variables to the workload (only if present in the s3-integrator):

If the S3 integration is not correct (this happens when the credentials were not injected in the s3-integrator charm), the paas-app-charmer charm will get blocked.

Rationale

S3 is widely used, specially in HA applications.

Juju Events Changes

Module Changes

Library Changes

Checklist

github-actions[bot] commented 3 months ago

Test coverage for 0bb03ca845738bf3a4016c447f821c494b42ed19

Name                                            Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------------------------------
paas_app_charmer/__init__.py                        0      0      0      0   100%
paas_app_charmer/_gunicorn/__init__.py              0      0      0      0   100%
paas_app_charmer/_gunicorn/charm.py               147     23     20      4    83%   32-33, 146-147, 149-150, 171->exit, 183-187, 201-203, 260-261, 266, 271, 276, 286, 291, 296, 301, 306, 321
paas_app_charmer/_gunicorn/charm_state.py          79      1     14      1    98%   168
paas_app_charmer/_gunicorn/charm_utils.py          23      0      0      0   100%
paas_app_charmer/_gunicorn/observability.py        13      0      2      0   100%
paas_app_charmer/_gunicorn/secret_storage.py       13      0      0      0   100%
paas_app_charmer/_gunicorn/webserver.py            75      4     14      1    94%   156, 168-174
paas_app_charmer/_gunicorn/workload_config.py      19      0      0      0   100%
paas_app_charmer/_gunicorn/wsgi_app.py             78      0     36      0   100%
paas_app_charmer/database_migration.py             33      0      2      0   100%
paas_app_charmer/databases.py                      25      2     11      1    92%   89-90
paas_app_charmer/django/__init__.py                 1      0      0      0   100%
paas_app_charmer/django/charm.py                   46      7     10      1    79%   73-78, 100, 115-116
paas_app_charmer/exceptions.py                      4      0      0      0   100%
paas_app_charmer/flask/__init__.py                  1      0      0      0   100%
paas_app_charmer/flask/charm.py                    38      0      6      0   100%
paas_app_charmer/secret_storage.py                 39      3     16      5    85%   50, 54->53, 55->57, 85, 104
-------------------------------------------------------------------------------------------
TOTAL                                             634     40    131     13    92%

Static code analysis report

Run started:2024-06-04 14:56:43.304556

Test results:
    No issues identified.

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