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

Fix default theme and plugin list inconsistency #172

Merged
merged 5 commits into from
Nov 24, 2023
Merged

Conversation

weiiwang01
Copy link
Collaborator

@weiiwang01 weiiwang01 commented Nov 23, 2023

Overview

WordPress charm defines a _WORDPRESS_DEFAULT_THEMES and _WORDPRESS_DEFAULT_PLUGINS list containing all default installed themes and plugins in the workload image. These lists serve as the reference for theme and plugin management so it must alignment with themes and plugins within the OCI image.

Update the two list to resolve problems caused by the inconsistency.

Reference for obtaining the lists of default themes and plugins:

# build the WordPress image
rockcraft pack
skopeo --insecure-policy copy oci-archive:$(ls *.rock) docker-daemon:wordpress-image:latest

# start a mysql database for WordPress
docker run -d -e MYSQL_USER=wordpress -e MYSQL_PASSWORD=wordpress -e MYSQL_DATABASE=wordpress -e MYSQL_ROOT_PASSWORD=wordpress --name=mysql mysql:latest

# install WordPress and print all themes and plugins
docker run -it --rm --entrypoint /bin/bash --workdir /var/www/html wordpress-image:latest
wp config create --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --dbhost=<mysql-ip>
wp core install --url=example.com --title=test --admin_user=admin --admin_email=admin@example.com
wp theme list
wp plugin list

# clean up
docker rm -f mysql

Checklist

@weiiwang01 weiiwang01 added the trivial This is a trivial PR label Nov 23, 2023
@weiiwang01 weiiwang01 requested a review from a team as a code owner November 23, 2023 16:30
arturo-seijas
arturo-seijas previously approved these changes Nov 23, 2023
varshigupta12
varshigupta12 previously approved these changes Nov 23, 2023
Copy link
Contributor

Test coverage for cedf252

Name                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------
src/charm.py          530     41    172     31    89%   190-193, 357-358, 558, 589, 595, 640, 675-676, 727-734, 739, 841->846, 845, 847, 852-853, 913, 931, 938, 1028, 1037, 1049, 1070, 1079, 1098, 1102, 1131, 1184, 1316, 1338, 1345->1347, 1390->exit, 1402, 1418, 1455, 1464-1465
src/cos.py             15      0      0      0   100%
src/exceptions.py      17      1      2      1    89%   41
src/types_.py          16      0      0      0   100%
---------------------------------------------------------------
TOTAL                 578     42    174     32    90%

Static code analysis report

Run started:2023-11-24 06:02:49.519725

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 4278
  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
Contributor

@Thanhphan1147 Thanhphan1147 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@weiiwang01 weiiwang01 merged commit c766633 into main Nov 24, 2023
35 checks passed
@weiiwang01 weiiwang01 deleted the fix-theme-list branch November 24, 2023 11:14
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.

5 participants