canonical / wordpress-k8s-operator

wordpress-k8s-operator - charm repository.
Apache License 2.0
13 stars 7 forks source link

Refactor to remove wp eval code #216

Closed javierdelapuente closed 6 months ago

javierdelapuente commented 6 months ago

Applicable spec:

Overview

Small refactor to remove wp eval that runs directly code against the wordpress installation to configure the wordpress-teams-integration plugin.

Instead, to configure options in the same way in all plugins, use wp option update command instead of eval. That will make it easier to have generic code, and stop using hardcoded php code to configure options in the plugin.

A change was also needed in the plugin (already merged): https://git.launchpad.net/~canonical-sysadmins/wordpress-teams-integration/+git/wordpress-teams-integration/commit/?id=a643325df2e40ad5a34346f93872c47cdaa09051

Rationale

Juju Events Changes

Module Changes

Library Changes

Checklist

github-actions[bot] commented 6 months ago

Test coverage for acf0d24e1488f80211368cfb45548de00c31e31b

Name                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------
src/charm.py          538     35    184     33    91%   162, 203-206, 370, 429->433, 582, 613, 619, 636-640, 670, 705-706, 764, 773, 877->890, 889, 891, 896-897, 957, 977, 984, 1074, 1083, 1095, 1116, 1125, 1144, 1148, 1177, 1218, 1350, 1372, 1379->1381, 1424->exit, 1436, 1446, 1484
src/cos.py             21      0      0      0   100%
src/exceptions.py      17      1      2      1    89%   41
src/state.py           34      0      4      0   100%
src/types_.py          16      0      0      0   100%
---------------------------------------------------------------
TOTAL                 626     36    190     34    91%

Static code analysis report

Run started:2024-05-09 12:35:06.124974

Test results:
    No issues identified.

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