Skip to content

Commit

Permalink
fix: Bug in Session_Transaction_Manager::pop_transaction_id() fixed (#…
Browse files Browse the repository at this point in the history
…852)

* fix: bug in Session_Transaction_Manager::pop_transaction_id fixed

* chore: Linter and PHPStan compliance met

* devops: tests updated

* devops: WPBrowser upgraded to v4.x.x

* devops: Some unit testing configurations updated

* devops: WPBrowser updated and tests passing

* chore: PHPStan and linter compliance met

* devops: WP_CORE_DIR fixed

* devops: More docker config changes

* devops: CartMutationsTest updated

* devops: CI env vars fixed

* devops: More CI fixes

* devops: More CI fixes

* devops: More CI fixes

* devop: Docker env removed

* devops: Codeception configs updated

* devops: configurations tweaked heavily
  • Loading branch information
kidunot89 authored May 21, 2024
1 parent f686e74 commit 2543f33
Show file tree
Hide file tree
Showing 26 changed files with 610 additions and 403 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ENV PATH "$PATH:~/.composer/vendor/bin"
# Install wp-browser globally
RUN composer global require --optimize-autoloader \
wp-cli/wp-cli-bundle:* \
lucatume/wp-browser:3.2.3 \
"lucatume/wp-browser:>3.1 <3.5" \
phpunit/phpunit:^9.6 \
codeception/module-asserts:* \
codeception/module-cli:* \
Expand All @@ -48,10 +48,11 @@ RUN composer global require --optimize-autoloader \
codeception/module-rest:* \
codeception/module-webdriver:* \
codeception/util-universalframework:* \
guzzlehttp/guzzle \
league/factory-muffin \
league/factory-muffin-faker \
stripe/stripe-php \
wp-graphql/wp-graphql-testcase
wp-graphql/wp-graphql-testcase:^3.2

# Remove exec statement from base entrypoint script.
RUN sed -i '$d' /usr/local/bin/docker-entrypoint.sh
Expand All @@ -74,8 +75,8 @@ ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql-woocommerce"
RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf
RUN a2enmod rewrite


WORKDIR /var/www/html

# Set codecept wrapper
COPY bin/codecept /usr/local/bin/codecept
RUN chmod 755 /usr/local/bin/codecept
Expand Down
6 changes: 4 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Security Policy

## Supported Versions

Current only the most stable release has security update support.
Meaning security patches are always patched the latest stable release.
Meaning security patches are always patched the latest stable release.

## Reporting a Vulnerability
Do not report potential security vulnerabilities here. Email them privately to our security team at support@axistaylor.com

Do not report potential security vulnerabilities here. Report your finding using the contact form found [here](https://woographql.com/support#contact) or email them privately to our security team at <support@axistaylor.com>
4 changes: 2 additions & 2 deletions bin/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ install_local_test_library() {
# Install testing library dependencies.
composer install
composer require --dev -W \
lucatume/wp-browser:3.2.3 \
"lucatume/wp-browser:>3.1 <3.5" \
phpunit/phpunit:^9.6 \
codeception/lib-asserts:* \
codeception/module-asserts:* \
codeception/module-rest:* \
codeception/util-universalframework:* \
wp-graphql/wp-graphql-testcase \
wp-graphql/wp-graphql-testcase:^3.2 \
stripe/stripe-php \
fakerphp/faker

Expand Down
31 changes: 13 additions & 18 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,30 @@ if [ "$USING_XDEBUG" == "1" ]; then
fi

# Run WordPress docker entrypoint.
# shellcheck disable=SC1091
. docker-entrypoint.sh 'apache2'

set +u

# Ensure mysql is loaded
wait-for-it -s -t 300 ${DB_HOST}:${DB_PORT} -- echo "Application database is operationally..."
wait-for-it -s -t 300 "${DB_HOST}:${DB_PORT}" -- echo "Application database is operationally..."

# Setup tester scripts.
if [ ! -f $WP_ROOT_FOLDER/setup-database.sh ]; then
ln -s $PROJECT_DIR/bin/setup-database.sh $WP_ROOT_FOLDER/setup-database.sh
chmod +x $WP_ROOT_FOLDER/setup-database.sh
if [ ! -f "$WP_ROOT_FOLDER/setup-database.sh" ]; then
ln -s "$PROJECT_DIR/bin/setup-database.sh" "$WP_ROOT_FOLDER/setup-database.sh"
chmod +x "$WP_ROOT_FOLDER/setup-database.sh"
fi

# Update our domain to just be the docker container's IP address
export WORDPRESS_DOMAIN=${WORDPRESS_DOMAIN-$( hostname -i )}
export WORDPRESS_URL="http://$WORDPRESS_DOMAIN"
if [ -f $PROJECT_DIR/.env.docker ]; then
rm $PROJECT_DIR/.env.docker
fi
echo "WORDPRESS_DOMAIN=$WORDPRESS_DOMAIN" >> $PROJECT_DIR/.env.docker
echo "WORDPRESS_URL=$WORDPRESS_URL" >> $PROJECT_DIR/.env.docker
echo "WORDPRESS_DOMAIN=$WORDPRESS_DOMAIN" > "$PROJECT_DIR/.env.docker"
echo "WORDPRESS_URL=$WORDPRESS_URL" >> "$PROJECT_DIR/.env.docker"

# Config WordPress
if [ -f "${WP_ROOT_FOLDER}/wp-config.php" ]; then
echo "Deleting old wp-config.php"
rm ${WP_ROOT_FOLDER}/wp-config.php
rm -f "${WP_ROOT_FOLDER}/wp-config.php"
fi

echo "Creating wp-config.php..."
Expand Down Expand Up @@ -83,31 +81,28 @@ if wp config has GRAPHQL_DEBUG --allow-root; then
wp config delete GRAPHQL_DEBUG --allow-root
fi
if [[ -n "$GRAPHQL_DEBUG" ]]; then
wp config set GRAPHQL_DEBUG $GRAPHQL_DEBUG --allow-root
wp config set GRAPHQL_DEBUG "$GRAPHQL_DEBUG" --allow-root
fi

if [[ -n "$IMPORT_WC_PRODUCTS" ]]; then
echo "Installing & Activating WordPress Importer..."
wp plugin install wordpress-importer --activate --allow-root
echo "Importing store products..."
wp import \
${PLUGINS_DIR}/woocommerce/sample-data/sample_products.xml \
"${PLUGINS_DIR}/woocommerce/sample-data/sample_products.xml" \
--authors=skip --allow-root
fi

echo "Setting pretty permalinks..."
wp rewrite structure '/%year%/%monthnum%/%postname%/' --allow-root

echo "Prepare for app database dump..."
if [ ! -d "${PROJECT_DIR}/local/db" ]; then
mkdir ${PROJECT_DIR}/local/db
fi
if [ -f "${PROJECT_DIR}/local/db/app_db.sql" ]; then
rm ${PROJECT_DIR}/local/db/app_db.sql
if [ -f "${PROJECT_DIR}/tests/_data/app_db.sql" ]; then
rm -f "${PROJECT_DIR}/tests/_data/app_db.sql"
fi

echo "Dumping app database..."
wp db export "${PROJECT_DIR}/local/db/app_db.sql" \
wp db export "${PROJECT_DIR}/tests/_data/app_db.sql" \
--dbuser="root" \
--dbpass="${ROOT_PASSWORD}" \
--skip-plugins \
Expand Down
13 changes: 7 additions & 6 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ paths:
envs: tests/_envs
params:
- env
- .env
- .env.docker
actor_suffix: Tester
settings:
Expand Down Expand Up @@ -35,12 +34,15 @@ extensions:
- Codeception\Command\GenerateWPXMLRPC
modules:
config:
\Tests\WPGraphQL\Codeception\Module\WPGraphQL:
endpoint: '%WORDPRESS_URL%/graphql'
WPDb:
dsn: 'mysql:host=%DB_HOST%;dbname=%DB_NAME%'
user: '%DB_USER%'
password: '%DB_PASSWORD%'
populator: 'mysql -u $user -p$password -h $host $dbname < $dump'
dump: 'local/db/app_db.sql'
populate: false
populate: true
cleanup: false
waitlock: 10
url: '%WORDPRESS_URL%'
Expand All @@ -64,10 +66,7 @@ modules:
uploads: '/wp-content/uploads'
WPLoader:
wpRootFolder: '%WP_CORE_DIR%'
dbName: '%DB_NAME%'
dbHost: '%DB_HOST%'
dbUser: '%DB_USER%'
dbPassword: '%DB_PASSWORD%'
dbUrl: 'mysql://%DB_USER%:%DB_PASSWORD%@%DB_HOST%:%DB_PORT%/%DB_NAME%'
tablePrefix: '%WP_TABLE_PREFIX%'
domain: '%WORDPRESS_DOMAIN%'
adminEmail: '%ADMIN_EMAIL%'
Expand All @@ -85,3 +84,5 @@ modules:
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
configFile: 'tests/_data/config.php'


Loading

0 comments on commit 2543f33

Please sign in to comment.