Repository navigation
Do not store a donut template whose render threw - #237
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Propagate rendering failures src/DonutRequest.php, src/ResourceDonut.php, tests/Fake/*, tests/Fake/fake-app/src/Resource/{App,Page/Html}/*, tests/Fake/fake-app/var/templates/{App,Page/Html}/*, tests/GracefulLoggingTest.php, tests/ResourceDonutTest.php |
DonutRequest and ResourceDonut::create() call toString() directly, allowing rendering exceptions to propagate. Tests cover page and hole failures, warning handling, and successful rendering. |
Refresh failure and fallback src/ResourceDonut.php, src/AbstractDonutCacheInterceptor.php, src/Exception/CacheStoreFailure.php, tests/Fake/fake-app/src/Resource/App/FlakyHole.php, tests/Fake/fake-app/src/Resource/Page/Html/DonutCacheWithFlakyHole.php, tests/Fake/fake-app/var/templates/App/FlakyHole.html.twig, tests/Fake/fake-app/var/templates/Page/Html/DonutCacheWithFlakyHole.html.twig, tests/GracefulLoggingTest.php, tests/ResourceDonutTest.php, CHANGELOG.md |
ResourceDonut::refresh() wraps hole failures in CacheStoreFailure. The interceptor handles fallback renders through the shared response path. Tests cover transient fallback, persistent failure, and cache-write behavior. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers: jingu
Merge Risk: 
Minimal · up to dcef1
-
The rendering changes have no identified merge-blocking issue after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 52.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 13 files. (5 skipped: 5 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
@koriym Evidence for this PR (head Mutation proofs (break → red → restore)
GateCoverage( |
|
@coderabbitai review |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #237 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 649 651 +2
===========================================
Files 111 111
Lines 1745 1750 +5
===========================================
+ Hits 1745 1750 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…fy CacheStoreFailure
|
@koriym Follow-up (head
Gate (re-run after these changes)(Previous mutation proofs from the earlier commit still hold - none of this round's edits |
# Conflicts: # CHANGELOG.md
…g-matching error handler
|
@koriym Evidence for the redesign (head Mutation proofs (break → red → restore)
Verified by execution, not assumption
GateBeMart e2e smoke (
|
|
@coderabbitai review |
|
…ent legacy-placeholder case
|
@koriym Applied the three LOW fixes from review (head
Gate: |
|
@coderabbitai full review The PR was redesigned (07939b8, 4143dad): it now renders with the non-swallowing |
|
… re-stores the template
|
@koriym Added one cheap, mutation-proved assertion (head Gate: cs 62/62, sa clean, phpunit 512/512, coverage 100%. |
|
@coderabbitai review |
✅ Action performed
|
…he existing hole-exclusion predicate and never replaces a genuine store failure
Redesign (both reviewers rejected the warning-regex + error-handler approach)
ResourceDonut::create()renders with$ro->toString()instead of(string) $ro-toString()has no catch (unlike magic__toString()), so a render Throwable justpropagates, same as
HttpResponder::getOutput()already renders with. No handler, noregex, nothing to reconstruct or evade.
DonutRequest::__toString()'s hole render gets thesame treatment (
$executed->toString()). Nothing stores because nothing past the rendercall runs.
refresh()'s existingCacheStoreFailureconversion (both reviewers: keep) isunchanged.
Second bug, found by executing the required tests
AbstractDonutCacheInterceptor's degraded-read fallback returnedproceed()'s raw,un-rendered result - a persistently-broken hole on refresh silently served an empty 200.
Fixed by sharing the render+store path a normal MISS already uses.
Verification
Named/anonymous hole exceptions, page-template exceptions, warning→exception-converter
parity vs. a no-attribute page, transient/persistent HIT-refresh - each on actual output,
mutation-proved. cs/sa/phpmd clean, 100% coverage, BeMart e2e diffed clean (only
already-documented #236/ETag deltas).