Record what a resource declared about its lifetime - #196
Conversation
A TTL cannot say whether an entry is meant to expire. `#[Cacheable]` defaults to `expiry: 'never'`, which resolves to a finite number - 31536000 in a default install, and whatever an application binds `Expiry` to otherwise - so an entry that lives until invalidation logs exactly like a deliberate 1-year TTL. The reader was left inferring intent from a number whose meaning is a deployment detail. `cache_policy` records the declaration instead, where it is read: exactly one of `expiry`, `expirySecond` or `expiryAt` is non-null, the one the precedence in getExpiryTime() picked, beside the TTL it resolved to. The schema does not enum the presets: a closed set would make the demo-coverage gate demand a demo per preset, and demonstrating `#[Cacheable]`'s vocabulary proves nothing about the cache log.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #196 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 478 483 +5
===========================================
Files 93 94 +1
Lines 1271 1281 +10
===========================================
+ Hits 1271 1281 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # docs/reading-the-log.ja.md # docs/reading-the-log.md
Closes #186.
#[Cacheable]defaults toexpiry: 'never', andExpiryturns that into a finite number - 31536000 in a default install, whatever an application binds otherwise. So an entry meant to live until invalidation logs the same lifetime as a deliberate 1-year TTL, and the reader is left inferring intent from a number whose meaning is a deployment detail.cache_policyrecords the declaration whereQueryRepositoryreads it. Exactly one ofexpiry/expirySecond/expiryAtis non-null - the one the precedence ingetExpiryTime()picked - beside theresolvedTtlit produced:Storage never learns about policies: the repository logs what it already knows, and
ResourceStorageInterfaceis untouched.Scope
#[Cacheable]only. Donut writes take their lifetime as aputDonut($ro, $ttl, $sMaxAge)argument, whichput_donutalready records - there is no preset to lose.Notes
The schema does not
enumthe presets. A closed set makes the demo-coverage gate demand a demo per value, and demonstrating#[Cacheable]'s vocabulary proves nothing about the cache log; the vocabulary is in the field description instead.Based on #191 (the test resolves the logger by its qualifier). Merge that first.