Skip to content

Add --no-audit to skip the security audit check for the PHP 8.2 PHPUnit#2372

Closed
mukeshpanchal27 wants to merge 2 commits intotrunkfrom
fix/php-82-audit
Closed

Add --no-audit to skip the security audit check for the PHP 8.2 PHPUnit#2372
mukeshpanchal27 wants to merge 2 commits intotrunkfrom
fix/php-82-audit

Conversation

@mukeshpanchal27
Copy link
Member

Summary

Fix issue https://github.com/WordPress/performance/actions/runs/21458842709/job/61828880918?pr=2365

Relevant technical choices

Use of AI Tools

@mukeshpanchal27 mukeshpanchal27 self-assigned this Jan 29, 2026
@mukeshpanchal27 mukeshpanchal27 added Infrastructure Issues for the overall performance plugin infrastructure 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 29, 2026
@mukeshpanchal27 mukeshpanchal27 marked this pull request as ready for review January 29, 2026 05:20
@github-actions
Copy link

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: mukeshpanchal27 <mukesh27@git.wordpress.org>

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

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.17%. Comparing base (509ad26) to head (e18f660).
⚠️ Report is 4 commits behind head on trunk.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #2372   +/-   ##
=======================================
  Coverage   69.17%   69.17%           
=======================================
  Files          90       90           
  Lines        7708     7708           
=======================================
  Hits         5332     5332           
  Misses       2376     2376           
Flag Coverage Δ
multisite 69.17% <ø> (ø)
single 35.39% <ø> (ø)

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to resolve a failing security audit check in the PHP 8.2 PHPUnit workflow by implementing two complementary approaches: adding an audit ignore configuration for a specific security advisory in composer.json, and adding the --no-audit flag to the problematic composer command in the GitHub Actions workflow.

Changes:

  • Added audit ignore configuration in composer.json to suppress security advisory PKSA-z3gr-8qht-p93v
  • Added --no-audit flag to the PHP 8.2 composer require command in the test workflow

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
composer.json Adds audit configuration to ignore security advisory PKSA-z3gr-8qht-p93v
.github/workflows/php-test-plugins.yml Adds --no-audit flag to composer require command for PHP 8.2 PHPUnit installation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 86 to +88
if [ "${{ matrix.php }}" == "8.2" ]; then
# Version 2.1.0 of doctrine/instantiator started requiring PHP 8.4: <https://github.com/doctrine/instantiator/pull/148>.
composer require phpunit/phpunit:${{ matrix.phpunit }} "doctrine/instantiator:<2.1" --with-all-dependencies --ignore-platform-reqs
composer require phpunit/phpunit:${{ matrix.phpunit }} "doctrine/instantiator:<2.1" --with-all-dependencies --ignore-platform-reqs --no-audit
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

While the --no-audit flag is added for the PHP 8.2 composer require command, there's a composer update command on line 83 (just above this block) that runs for all PHP versions including 8.2 and may trigger the same security audit issue. If the audit.ignore configuration in composer.json doesn't prevent the audit from failing, the workflow might still fail at the composer update step before reaching this install step.

Verify that the audit.ignore configuration in composer.json properly handles the composer update command, or consider conditionally adding --no-audit to that command as well for PHP 8.2.

Copilot uses AI. Check for mistakes.
composer.json Outdated
Comment on lines 47 to 51
},
"audit": {
"ignore": [
"PKSA-z3gr-8qht-p93v"
]
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The audit ignore configuration in composer.json combined with the --no-audit flag in the workflow creates an inconsistent approach to handling security audits. If the audit.ignore configuration is sufficient to suppress the advisory PKSA-z3gr-8qht-p93v globally, then the --no-audit flag in the workflow is unnecessary. Conversely, if --no-audit is needed, then this audit.ignore configuration may be redundant.

Consider using only one approach:

  1. If you want to suppress a specific advisory, use only the audit.ignore configuration in composer.json
  2. If you want to skip all audits for the PHP 8.2 case, use only the --no-audit flag in the workflow

The first approach is generally preferred as it's more targeted and doesn't skip all security audits.

Suggested change
},
"audit": {
"ignore": [
"PKSA-z3gr-8qht-p93v"
]

Copilot uses AI. Check for mistakes.
composer.json Outdated
},
"audit": {
"ignore": [
"PKSA-z3gr-8qht-p93v"
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The security advisory ID "PKSA-z3gr-8qht-p93v" is being ignored, but there is no accompanying comment or documentation explaining what this advisory is, why it's safe to ignore, or what the risk assessment was. This makes it difficult for future maintainers to understand whether this ignore should remain in place or be revisited when dependencies are updated.

Consider adding a comment above this configuration explaining:

  1. What package and vulnerability this advisory relates to
  2. Why it's acceptable to ignore this advisory
  3. Any related issue or PR links for context
Suggested change
"PKSA-z3gr-8qht-p93v"
{
"advisory-id": "PKSA-z3gr-8qht-p93v",
"reason": "Advisory applies only to a development-time dependency listed under require-dev and does not affect code shipped with this plugin. The team has accepted this limited risk and will revisit if the affected package is used at runtime.",
"link": "https://github.com/WordPress/performance/issues"
}

Copilot uses AI. Check for mistakes.
Removed audit ignore configuration from composer.json.
@mukeshpanchal27 mukeshpanchal27 marked this pull request as draft January 29, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Issues for the overall performance plugin infrastructure 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.

1 participant