Repository navigation
fix(pm-stack): validate window_duration_secs fail-closed in meta-quota-export (#1566) - #1694
Conversation
…a-export (#1566) parseSubscriptionQuota validated every numeric field except window_duration_secs, so a missing/junk duration exported a window-NaNs window as a successful reading. A duration that is not finite and > 0 now throws ExportError(unparseable, 6) naming the wire field. Valid naming unchanged (18000 -> 5h, 3600 -> 1h, other positive -> window-<n>s). Drift tests cover missing/abc/0/negative; a naming test pins 1h and window-7200s.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fixes #1566 (queue task 1833; triage confirmation from task 1636).
parseSubscriptionQuotainpm-stack/meta-exporter/meta-quota-export.mjsvalidated every numeric field fail-closed exceptwindow_duration_secs— a missing/junk duration exported awindow-NaNswindow as a successful reading.ExportError('unparseable', 6)with a message naming the wire fieldwindow_duration_secs, matching the other fields' fail-closed shape.5h, 3600 →1h, other positive →window-<n>s.'abc'/0/ negative duration cases (each asserting the error names the field); a new naming test pins1handwindow-7200s.Verification (laptop):
node --test pm-stack/meta-exporter/meta-quota-export.test.mjs— 6/6 pass. (The directory formnode --test pm-stack/meta-exporter/fails identically on clean main under node v24 — pre-existing, unrelated.)Need help on this PR? Tag
@codesmith-botwith what you need.