Skip to content

fix(site): don't append a passing nginx test's output to the proxy cache error - #531

Open
mrrobot47 wants to merge 3 commits into
EasyEngine:developfrom
mrrobot47:fix/proxy-cache-stale-test-output
Open

mrrobot47 wants to merge 3 commits into
EasyEngine:developfrom
mrrobot47:fix/proxy-cache-stale-test-output

Conversation

@mrrobot47

@mrrobot47 mrrobot47 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Since the proxy reload refuses a config its own nginx -t rejects, update_proxy_cache() also reaches the "Could not enable proxy cache ..." error and the disable path's "nginx config test failed after disabling proxy cache" warning when the earlier nginx -t passed. Both then appended that passing test's "syntax is ok ... test is successful" output, while the real failure was only in the reload's warning printed just above.

The test output is now appended only when that test failed. Otherwise the enable error and the disable warning point at the refused reload's warning above.

Tested with PHPUnit on PHP 7.4 and 8.5: after a refused reload, the enable error and the disable warning no longer carry the passing test's output and point at the reload warning, and a failing test's output is still appended.

Summary by CodeRabbit

  • Bug Fixes
    • Proxy cache error and warning messages now distinguish between nginx configuration test failures and reload failures.
    • When a reload fails after a successful configuration test, messages include the reload warning. When the configuration test fails, messages include its error details. This provides more relevant information when proxy cache changes cannot be applied.

…che error

Since the reload refuses a config its own nginx -t rejects, update_proxy_cache() also reaches the enable-failed error and the disable warning when the earlier test passed. Both then appended that passing test's "syntax is ok ... test is successful" output, while the real failure was only in the reload's warning just above. The output is now appended only when that test failed, and the disable path says the proxy was not reloaded.
… a refused reload

The removal already reloaded the proxy once, so "The proxy was not reloaded" could be false; the refused reload's own test output is in the warning just above.
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Proxy cache error reporting

Layer / File(s) Summary
Select proxy cache failure details
src/helper/class-ee-site.php
For failed enable and disable attempts, the message uses the reload warning if the config test passed. If the test failed, it includes test stderr.

Change: Bug fix

Merge Risk: Minimal · up to 5a0bc

This changes only the wording of proxy-cache failure messages. When the nginx config test passes and the reload is refused, the message points to the reload warning; when the test fails, it includes the test's stderr. No functional risk was found, so it is ready to merge.

Security architecture risk: Minimal · up to 5a0bc

The change avoids attaching successful configuration-test output to failure messages. Existing proxy configuration, reload, and recovery behavior remains unchanged.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

PHPStan (2.3.3)

Composer install failed: dependency resolution error. Check composer.json and composer.lock for version constraints.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf500867-ca24-4625-ac7c-822864ab66bf
Commits

Reviewing files that changed from the base of the PR and between 36eb861 and 5a0bc98.

Files selected for processing: 1

  • src/helper/class-ee-site.php

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant