From 6f2e4ff61ce22914d6b39fbf9221818f72b20bee Mon Sep 17 00:00:00 2001 From: Andrii KOSTENETSKYI <99037292+KostenetskyiAndrii@users.noreply.github.com> Date: Wed, 22 Oct 2025 17:27:35 +0300 Subject: [PATCH 1/5] feat: SRE-1122 - Migration out of CircleCI (#327) --- .circleci/config.yml | 64 ------------------- .github/workflows/test-behat.yml | 105 +++++++++++++++++++++++++++++++ .gitignore | 2 + bin/behat-prepare.sh | 16 +++-- bin/validate-fixture-version.sh | 44 ------------- 5 files changed, 118 insertions(+), 113 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/test-behat.yml delete mode 100755 bin/validate-fixture-version.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 22de6b7b..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,64 +0,0 @@ -version: 2.1 -workflows: - version: 2.1 - main: - jobs: - - test-behat - nightly: - triggers: - - schedule: - cron: "0 0 * * *" - filters: - branches: - only: - - master - jobs: - - test-behat -jobs: - test-behat: - resource_class: small - working_directory: ~/pantheon-systems/wp-native-php-sessions - parallelism: 1 - docker: - - image: quay.io/pantheon-public/build-tools-ci:8.x-php8.2 - steps: - - checkout - - restore_cache: - keys: - - test-behat-dependencies-{{ checksum "composer.json" }} - - run: composer install -n --prefer-dist - - save_cache: - key: test-behat-dependencies-{{ checksum "composer.json" }} - paths: - - vendor - - run: echo $(openssl rand -hex 8) > /tmp/WORDPRESS_ADMIN_PASSWORD - - run: | - echo 'export TERMINUS_ENV=ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV - echo 'export TERMINUS_SITE=wp-native-php-sessions' >> $BASH_ENV - echo 'export SITE_ENV=wp-native-php-sessions.ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV - echo 'export WORDPRESS_ADMIN_USERNAME=pantheon' >> $BASH_ENV - echo 'export WORDPRESS_ADMIN_EMAIL=no-reply@getpantheon.com' >> $BASH_ENV - echo 'export WORDPRESS_ADMIN_PASSWORD=$(cat /tmp/WORDPRESS_ADMIN_PASSWORD)' >> $BASH_ENV - source $BASH_ENV - - run: echo "StrictHostKeyChecking no" >> "$HOME/.ssh/config" - - run: | - if [ -z "$GITHUB_TOKEN" ]; then - echo "GITHUB_TOKEN environment variables missing; assuming unauthenticated build" - exit 0 - fi - echo "Setting GitHub OAuth token with suppressed ouput" - { - composer config -g github-oauth.github.com $GITHUB_TOKEN - } &> /dev/null - - run: | - if [ -z "$TERMINUS_TOKEN" ]; then - echo "TERMINUS_TOKEN environment variables missing; assuming unauthenticated build" - exit 0 - fi - terminus auth:login --machine-token=$TERMINUS_TOKEN - - run: ./bin/validate-fixture-version.sh - - run: ./bin/behat-prepare.sh - - run: ./bin/behat-test.sh --strict - - run: - command: ./bin/behat-cleanup.sh - when: always diff --git a/.github/workflows/test-behat.yml b/.github/workflows/test-behat.yml new file mode 100644 index 00000000..476610ff --- /dev/null +++ b/.github/workflows/test-behat.yml @@ -0,0 +1,105 @@ +name: Behat CI + +on: + push: + branches: [ master, main ] + pull_request: + workflow_dispatch: + schedule: + # Nightly at 00:00 UTC (CircleCI had cron "0 0 * * *" with branch filter=master) + - cron: "0 0 * * *" + +permissions: + contents: read + actions: write + +jobs: + test-behat: + # Run nightly only on master (schedule can't filter branches directly) + if: github.event_name != 'schedule' || github.ref == 'refs/heads/master' + + runs-on: ubuntu-latest + + env: + RUN_NUM: ${{ github.run_number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }} + + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/vendor + key: test-lint-dependencies-{{ checksum "composer.json" }} + restore-keys: test-lint-dependencies-{{ checksum "composer.json" }} + + - name: Install dependencies + run: composer install -n --prefer-dist + + - name: Run PHP Lint + run: composer phpcs + + - name: Install Terminus + uses: pantheon-systems/terminus-github-actions@v1 + with: + pantheon-machine-token: ${{ secrets.TERMINUS_TOKEN }} + + - name: Validate Readme Spacing + uses: pantheon-systems/validate-readme-spacing@v1 + + - name: Install Subversion + run: | + sudo apt-get update + sudo apt-get install subversion + + - name: Generate admin password + run: echo $(openssl rand -hex 8) > /tmp/WORDPRESS_ADMIN_PASSWORD + + - name: Export env + run: | + { + echo "TERMINUS_ENV=ci-${RUN_NUM}" + echo "TERMINUS_SITE=wp-native-php-sessions" + echo "SITE_ENV=wp-native-php-sessions.ci-${RUN_NUM}" + echo "WORDPRESS_ADMIN_USERNAME=pantheon" + echo "WORDPRESS_ADMIN_EMAIL=no-reply@getpantheon.com" + echo "WORDPRESS_ADMIN_PASSWORD=$(cat /tmp/WORDPRESS_ADMIN_PASSWORD)" + } >> "$GITHUB_ENV" + + - name: Force SSH to ignore host keys + run: echo "GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" >> $GITHUB_ENV + + - name: Install SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SITE_OWNER_SSH_PRIVATE_KEY }} + + - name: Configure Composer GitHub OAuth (optional) + if: env.GITHUB_TOKEN != '' + run: | + echo "Setting Composer GitHub OAuth token (output suppressed)" + { composer config -g github-oauth.github.com "$GITHUB_TOKEN"; } &>/dev/null + + - name: Validate fixture version + uses: jazzsequence/action-validate-plugin-version@v1 + with: + branch: ${{ github.head_ref }} + dry-run: 'true' + + - name: Behat prepare + run: | + terminus auth:login --machine-token=$TERMINUS_TOKEN + terminus self:plugin:install terminus-build-tools-plugin + ./bin/behat-prepare.sh + + - name: Behat tests (strict) + run: ./bin/behat-test.sh --strict + + - name: Cleanup (always) + if: always() + run: ./bin/behat-cleanup.sh diff --git a/.gitignore b/.gitignore index 50011818..0cac7c24 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .DS_Store +.idea +.codacy Thumbs.db wp-cli.local.yml node_modules/ diff --git a/bin/behat-prepare.sh b/bin/behat-prepare.sh index f62325a0..def5a4a6 100755 --- a/bin/behat-prepare.sh +++ b/bin/behat-prepare.sh @@ -7,17 +7,23 @@ ### if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then - echo "TERMINUS_SITE and TERMINUS_ENV environment variables must be set" - exit 1 + echo "TERMINUS_SITE and TERMINUS_ENV environment variables must be set" + exit 1 fi if [ -z "$WORDPRESS_ADMIN_USERNAME" ] || [ -z "$WORDPRESS_ADMIN_PASSWORD" ]; then - echo "WORDPRESS_ADMIN_USERNAME and WORDPRESS_ADMIN_PASSWORD environment variables must be set" - exit 1 + echo "WORDPRESS_ADMIN_USERNAME and WORDPRESS_ADMIN_PASSWORD environment variables must be set" + exit 1 fi set -ex +### +# Install Composer dependencies, including Behat. This makes the +# ./vendor/bin/behat executable available for the test runner. +### +composer install --no-progress --prefer-dist + ### # Create a new environment for this particular test run. ### @@ -67,7 +73,7 @@ git commit -m "Include WP Native PHP Sessions and its configuration files" git push # Sometimes Pantheon takes a little time to refresh the filesystem -terminus build:workflow:wait "$TERMINUS_SITE"."$TERMINUS_ENV" +terminus workflow:wait "$TERMINUS_SITE"."$TERMINUS_ENV" ### # Set up WordPress, theme, and plugins for the test run diff --git a/bin/validate-fixture-version.sh b/bin/validate-fixture-version.sh deleted file mode 100755 index cbe1877b..00000000 --- a/bin/validate-fixture-version.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -euo pipefail -IFS=$'\n\t' - -main(){ - export TERMINUS_HIDE_GIT_MODE_WARNING=1 - local DIRNAME - DIRNAME=$(dirname "$0") - - if [ -z "${TERMINUS_SITE}" ]; then - echo "TERMINUS_SITE environment variable must be set" - exit 1 - fi - - if ! terminus whoami > /dev/null; then - if [ -z "${TERMINUS_TOKEN}" ]; then - echo "TERMINUS_TOKEN environment variable must be set or terminus already logged in." - exit 1 - fi - terminus auth:login --machine-token="${TERMINUS_TOKEN}" - fi - - # Use find to locate the file with a case-insensitive search - README_FILE_PATH=$(find "${DIRNAME}"/.. -iname "readme.txt" -print -quit) - if [[ -z "$README_FILE_PATH" ]]; then - echo "readme.txt not found." - exit 1 - fi - - local TESTED_UP_TO - TESTED_UP_TO=$(grep -i "Tested up to:" "${README_FILE_PATH}" | tr -d '\r\n' | awk -F ': ' '{ print $2 }') - echo "Tested Up To: ${TESTED_UP_TO}" - local FIXTURE_VERSION - FIXTURE_VERSION=$(terminus wp "${TERMINUS_SITE}.dev" -- core version) - echo "Fixture Version: ${FIXTURE_VERSION}" - - if ! php -r "exit(version_compare('${TESTED_UP_TO}', '${FIXTURE_VERSION}'));"; then - echo "${FIXTURE_VERSION} is less than ${TESTED_UP_TO}" - echo "Please update ${TERMINUS_SITE} to at least WordPress ${TESTED_UP_TO}" - exit 1 - fi -} - -main From 3e6b7f1a622921db114bbf38e708a427753dd658 Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Fri, 7 Nov 2025 12:58:01 -0800 Subject: [PATCH 2/5] Prepare 1.4.5-dev --- README.md | 4 +++- pantheon-sessions.php | 4 ++-- readme.txt | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 147fc906..bdf9b011 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **Tags:** comments, sessions **Requires at least:** 5.3 **Tested up to:** 6.8.1 -**Stable tag:** 1.4.4 +**Stable tag:** 1.4.5-dev **Requires PHP:** 7.4 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -100,6 +100,8 @@ Adds a WP-CLI command to add an index to the sessions table if one does not exis ## Changelog ## +### 1.4.5-dev ### + ### 1.4.4 (September 17, 2025) ### * Compatibility: Supports PHP 8.4 * Increases minimum supported PHP version to 7.4 diff --git a/pantheon-sessions.php b/pantheon-sessions.php index c1e1f1f1..d74fd987 100644 --- a/pantheon-sessions.php +++ b/pantheon-sessions.php @@ -1,7 +1,7 @@ Date: Thu, 20 Nov 2025 14:32:28 -0700 Subject: [PATCH 3/5] Bump jazzsequence/action-validate-plugin-version from 1 to 2 (#331) Bumps [jazzsequence/action-validate-plugin-version](https://github.com/jazzsequence/action-validate-plugin-version) from 1 to 2. - [Release notes](https://github.com/jazzsequence/action-validate-plugin-version/releases) - [Commits](https://github.com/jazzsequence/action-validate-plugin-version/compare/v1...v2) --- updated-dependencies: - dependency-name: jazzsequence/action-validate-plugin-version dependency-version: '2' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test-behat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-behat.yml b/.github/workflows/test-behat.yml index 476610ff..c96d05a5 100644 --- a/.github/workflows/test-behat.yml +++ b/.github/workflows/test-behat.yml @@ -86,7 +86,7 @@ jobs: { composer config -g github-oauth.github.com "$GITHUB_TOKEN"; } &>/dev/null - name: Validate fixture version - uses: jazzsequence/action-validate-plugin-version@v1 + uses: jazzsequence/action-validate-plugin-version@v2 with: branch: ${{ github.head_ref }} dry-run: 'true' From a4e1d253672c6537274b0a8fbda2a506cf16b82f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 14:33:08 -0700 Subject: [PATCH 4/5] Bump webfactory/ssh-agent from 0.7.0 to 0.9.1 (#330) Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.7.0 to 0.9.1. - [Release notes](https://github.com/webfactory/ssh-agent/releases) - [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md) - [Commits](https://github.com/webfactory/ssh-agent/compare/v0.7.0...v0.9.1) --- updated-dependencies: - dependency-name: webfactory/ssh-agent dependency-version: 0.9.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test-behat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-behat.yml b/.github/workflows/test-behat.yml index c96d05a5..3080e200 100644 --- a/.github/workflows/test-behat.yml +++ b/.github/workflows/test-behat.yml @@ -75,7 +75,7 @@ jobs: run: echo "GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" >> $GITHUB_ENV - name: Install SSH key - uses: webfactory/ssh-agent@v0.7.0 + uses: webfactory/ssh-agent@v0.9.1 with: ssh-private-key: ${{ secrets.SITE_OWNER_SSH_PRIVATE_KEY }} From b2729a09ec26c59856592159a8201f023fbc60a3 Mon Sep 17 00:00:00 2001 From: Pantheon Automation Date: Thu, 20 Nov 2025 21:33:17 +0000 Subject: [PATCH 5/5] Release 1.4.5 --- README.md | 4 ++-- pantheon-sessions.php | 4 ++-- readme.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bdf9b011..0f69b685 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **Tags:** comments, sessions **Requires at least:** 5.3 **Tested up to:** 6.8.1 -**Stable tag:** 1.4.5-dev +**Stable tag:** 1.4.5 **Requires PHP:** 7.4 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -100,7 +100,7 @@ Adds a WP-CLI command to add an index to the sessions table if one does not exis ## Changelog ## -### 1.4.5-dev ### +### 1.4.5 (20 November 2025) ### ### 1.4.4 (September 17, 2025) ### * Compatibility: Supports PHP 8.4 diff --git a/pantheon-sessions.php b/pantheon-sessions.php index d74fd987..03676b1f 100644 --- a/pantheon-sessions.php +++ b/pantheon-sessions.php @@ -1,7 +1,7 @@