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

Refactor to remove wp eval code #216

Merged
merged 4 commits into from
May 10, 2024
Merged

Conversation

javierdelapuente
Copy link
Contributor

@javierdelapuente javierdelapuente commented May 8, 2024

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

@javierdelapuente javierdelapuente changed the title Refactor before the plugin integration Refactor to remove wp eval code May 9, 2024
@javierdelapuente javierdelapuente added the trivial This is a trivial PR label May 9, 2024
@javierdelapuente javierdelapuente marked this pull request as ready for review May 9, 2024 10:28
@javierdelapuente javierdelapuente requested a review from a team as a code owner May 9, 2024 10:28
Copy link
Contributor

github-actions bot commented May 9, 2024

Test coverage for acf0d24

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):

Copy link
Collaborator

@yanksyoon yanksyoon left a comment

Choose a reason for hiding this comment

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

LGTM!

src/charm.py Show resolved Hide resolved
Copy link
Contributor

@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

@javierdelapuente javierdelapuente merged commit 4d56849 into main May 10, 2024
34 checks passed
@javierdelapuente javierdelapuente deleted the ISD-1593-refactor-for-plugin branch May 10, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants