canonical / wordpress-k8s-operator

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

Create a charm action to run wp core update db after a wordpress upgrade #235

Closed alithethird closed 3 months ago

alithethird commented 3 months ago

Added an action for updating database. NEED ADVICE: I did not check the boxes regarding documentation because I am not sure if I need to update the documentation and how to do that.

Overview

After updating the WordPress version we have to update the database and there was no action for it. This PR creates an action for that called 'update-database'.

Rationale

After updating the WordPress version we have to update the database and there was no action for it. User had to ssh into the container to do that.

Juju Events Changes

Module Changes

Library Changes

Checklist

amandahla commented 3 months ago

Wouldnt that be the case of adding this to the _on_upgrade_charm event instead of a manual action? When running with --dry-run wouldn't be possible to check if is needed or not?

github-actions[bot] commented 3 months ago

Test coverage for 5d2eee524f8c14c8de67fbdaea4e84f7b1fb5752

Name                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------
src/charm.py          556     35    190     34    91%   162, 204-207, 299->302, 414, 473->477, 626, 657, 663, 680-684, 714, 749-750, 808, 817, 921->934, 933, 935, 940-941, 1001, 1021, 1028, 1118, 1127, 1139, 1160, 1169, 1188, 1192, 1221, 1262, 1394, 1416, 1423->1425, 1468->exit, 1480, 1490, 1528
src/cos.py             20      0      0      0   100%
src/exceptions.py      16      1      2      1    89%   41
src/state.py           33      0      4      0   100%
src/types_.py          15      0      0      0   100%
---------------------------------------------------------------
TOTAL                 640     36    196     35    92%

Static code analysis report

Run started:2024-08-06 12:13:17.541693

Test results:
    No issues identified.

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