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

feat(Logging): Updates logging to allow for tracking processing time #522

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(Logging): Updates logging to allow for tracking processing time
- Supports #516
- Updates the logging to also allow for tracking processing time of actions.
- Refactors logging to allow for unit testing.
- Adds unit tests for logging.
- Updates Composer dependencies to the latest versions.
- Changes GitHub Actions unit testing to reduce failures.
- Updates Dev Container to be less noisy and remove false positive errors during startup.
  • Loading branch information
timnolte committed Mar 15, 2024
commit 57c08c40b469858a82e6479204ed4243a46e3b07
12 changes: 12 additions & 0 deletions .devcontainer/activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -eu

# Activate the plugin.
cd "/app"
echo "Activating plugin..."
if ! wp plugin is-active daggerhart-openid-connect-generic 2>/dev/null; then
wp plugin activate daggerhart-openid-connect-generic --quiet
fi

echo "Done!"
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"postCreateCommand": "chmod +x .devcontainer/setup.sh && .devcontainer/setup.sh",

// Use 'postStartCommand' to run commands after the container has started.
"postStartCommand": "cd /app && wp plugin activate daggerhart-openid-connect-generic",
"postStartCommand": "chmod +x .devcontainer/activate.sh && .devcontainer/activate.sh",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "wp_php",
Expand Down
12 changes: 8 additions & 4 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -eux
set -eu

# true is shell command and always return 0
# false always return 1
Expand All @@ -17,17 +17,21 @@ sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

# Install Composer dependencies.
cd "${PLUGIN_DIR}"
COMPOSER_ALLOW_XDEBUG=0 COMPOSER_MEMORY_LIMIT=-1 composer install
echo "Installing Composer dependencies..."
COMPOSER_NO_INTERACTION=1 COMPOSER_ALLOW_XDEBUG=0 COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --quiet

# Install NPM dependencies.
cd "${PLUGIN_DIR}"
if [ ! -d "node_modules" ]; then
echo "Installing NPM dependencies..."
npm ci
fi

# Setup the WordPress environment.
cd "/app"
echo "Setting up WordPress at $SITE_HOST"
wp core install --url="$SITE_HOST" --title="OpenID Connect Development" --admin_user="admin" --admin_email="admin@example.com" --admin_password="password" --skip-email
if ! wp core is-installed 2>/dev/null; then
echo "Setting up WordPress at $SITE_HOST"
wp core install --url="$SITE_HOST" --title="OpenID Connect Development" --admin_user="admin" --admin_email="admin@example.com" --admin_password="password" --skip-email --quiet
fi

echo "Done!"
4 changes: 3 additions & 1 deletion .github/workflows/pr-unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
workflow_dispatch:
# Triggers the workflow on pull request events
pull_request:
branches:
- develop

env:
ACTION_VERSION: 3
Expand Down Expand Up @@ -36,7 +38,7 @@ jobs:
run: docker compose down

- name: Generate Coverage Report
if: success()
if: success() && ${{ github.event_name == 'pull_request' }}
# https://github.com/marketplace/actions/coverage-report-as-comment-clover
uses: lucassabreu/comment-coverage-clover@main
with:
Expand Down
Loading
Loading