Skip to content

Conversation

@westonruter
Copy link
Member

@westonruter westonruter commented Jan 3, 2026

Summary

Closes #2257

Provided by Gemini 3 in gemini-cli:

Port changes from WordPress/ai#139 to transition from the local wpackagist-plugin/plugin-check dependency to the official wordpress/plugin-check-action GitHub Action.

  • Add .github/workflows/plugin-check.yml.
  • Remove wpackagist-plugin/plugin-check from composer.json.
  • Remove related rules from tools/phpcs/phpcs.ruleset.xml.
  • Add PHPCS exclusion for object-cache.copy.php filename to allow drop-in naming.

Additionally, the plugins have been updated to address various issues that Plugin Check identified.

To do

Use of AI Tools

Given that I'm adapting a PR from the AI experiments plugin, it felt especially appropriate to use AI to prepare this PR. I used gemini-cli with these key prompts:

  • Take a look at the changes introduced in the WordPress AI Experiments plugin and implement the same changes here in the Performance Lab plugin: Use plugin-check GitHub workflow in favor of brittle plugin-check PHPCS checks ai#139
  • Changing "phpcompatibility/php-compatibility": "^9.3" to "phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha" seems out of scope. I think that should be undone. The same goes for replacing PHPCompatibility with PHPCompatibilityWP in phpcs.ruleset.xml
  • The .github/workflows/plugin-check.yml isn't working right. It needs to run do the Run plugin check for each of the subdirectories inside of build not on the entire root directory.
  • There's a problem with .github/workflows/plugin-check.yml where it seems to be re-building all plugins multiple times and maybe even running composer install and npm ci. Should these be moved to steps under prepare-matrix?

I've provided attribution to the original authors of that AI Experiments PR via Co-authored-by trailers in the commit message. I've also prop'ed Gemini.

Port changes from WordPress/ai#139 to transition from the local
wpackagist-plugin/plugin-check dependency to the official
wordpress/plugin-check-action GitHub Action.

- Add .github/workflows/plugin-check.yml.
- Remove wpackagist-plugin/plugin-check from composer.json.
- Remove related rules from tools/phpcs/phpcs.ruleset.xml.
- Add PHPCS exclusion for object-cache.copy.php filename to allow drop-in naming.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>
Co-authored-by: JasonTheAdams <jason_the_adams@git.wordpress.org>
Co-authored-by: justlevine <justlevine@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
@github-actions
Copy link

github-actions bot commented Jan 3, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter westonruter added no milestone PRs that do not have a defined milestone for release skip changelog PRs that should not be mentioned in changelogs [Type] Enhancement A suggestion for improvement of an existing feature labels Jan 3, 2026
@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

❌ Patch coverage is 30.00000% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.80%. Comparing base (ce1b405) to head (5b77157).
⚠️ Report is 2 commits behind head on trunk.

Files with missing lines Patch % Lines
plugins/view-transitions/uninstall.php 0.00% 13 Missing ⚠️
plugins/webp-uploads/uninstall.php 0.00% 13 Missing ⚠️
plugins/embed-optimizer/load.php 0.00% 2 Missing ⚠️
plugins/image-prioritizer/load.php 0.00% 2 Missing ⚠️
plugins/optimization-detective/load.php 0.00% 2 Missing ⚠️
...ce-lab/includes/site-health/avif-headers/hooks.php 0.00% 2 Missing ⚠️
...ce-lab/includes/site-health/avif-support/hooks.php 0.00% 2 Missing ⚠️
...ce-lab/includes/site-health/webp-support/hooks.php 0.00% 2 Missing ⚠️
plugins/optimization-detective/uninstall.php 80.00% 1 Missing ⚠️
plugins/performance-lab/includes/admin/load.php 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk    #2320      +/-   ##
==========================================
- Coverage   68.85%   68.80%   -0.05%     
==========================================
  Files          90       90              
  Lines        7612     7621       +9     
==========================================
+ Hits         5241     5244       +3     
- Misses       2371     2377       +6     
Flag Coverage Δ
multisite 68.80% <30.00%> (-0.05%) ⬇️
single 35.42% <1.66%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

westonruter and others added 3 commits January 2, 2026 16:13
This introduces a 'prepare-matrix' job to dynamically extract the list of plugins from 'plugins.json'. The 'plugin-check' job then uses this list to run checks in parallel via a matrix strategy, building and checking each plugin separately from its own directory in 'build/'.

This fixes an issue where the check was being run on the entire root directory instead of the specific plugin build artifacts.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@westonruter
Copy link
Member Author

It doesn't seem that the plugin-check action is set up to work in a monorepo of multiple plugins.

Specifically the last step of the action is:

    - name: Upload artifact
      uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
      if: ${{ always() }}
      with:
        name: plugin-check-results
        path: ${{ runner.temp }}/plugin-check-results.txt
        if-no-files-found: ignore

This is causing problems when plugin-check is running in parallel for multiple plugins. Most of the jobs fail here with:

Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

For the last job in the matrix, it succeeds with:

Beginning upload of artifact content to blob storage
Uploaded bytes 725
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact zip is a2c7f351e3461aa88eb08f62be32cc322274e3f8a8956c52e0be3c19ff9cdd89
Finalizing artifact upload
Artifact plugin-check-results.zip successfully finalized. Artifact ID 5011597738
Artifact plugin-check-results has been successfully uploaded! Final size is 725 bytes. Artifact ID is 5011597738
Artifact download URL: https://github.com/WordPress/performance/actions/runs/20669373255/artifacts/5011597738

It seems like the slug should be incorporated into the name? So like:

-         name: plugin-check-results
+         name: plugin-check-results${{ inputs.slug ? '-' + inputs.slug : '' }}

@westonruter westonruter marked this pull request as draft January 3, 2026 00:41
westonruter and others added 2 commits January 2, 2026 18:05
Move the dependency installation and build process to the preparatory job and share the results via artifacts. This avoids redundant `npm ci` and build steps for every plugin in the matrix, significantly reducing workflow execution time and resource usage.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked no milestone PRs that do not have a defined milestone for release skip changelog PRs that should not be mentioned in changelogs [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants