Repository navigation
fix(aggregator): validate credential lifecycle ISO dates - #5093
Conversation
|
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 18 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. |
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Tightens validation of credential lifecycle rows by enforcing ISO-8601 date strings for measuredAt (always) and expiresAt (when present), and adds tests to ensure invalid dates are rejected and dropped rows are counted.
Changes:
- Enforce
isIsoDate(...)validation formeasuredAtandexpiresAtinisCredentialLifecycleRow. - Add tests covering invalid date formats/impossible dates and sanitizer drop accounting.
| File | Description |
|---|---|
| pm-stack/aggregator/src/credential-lifecycle.ts | Strengthens lifecycle row validation by requiring ISO-valid timestamps. |
| pm-stack/aggregator/test/credential-lifecycle.test.ts | Adds coverage for invalid lifecycle rows being rejected and counted as dropped during sanitization. |
Review effort: Lite
| isIsoDate(row.measuredAt) && | ||
| (row.credentialId === undefined || typeof row.credentialId === "string") && | ||
| (row.expiresAt === undefined || (typeof row.expiresAt === "string" && Number.isFinite(Date.parse(row.expiresAt)))) && | ||
| (row.expiresAt === undefined || isIsoDate(row.expiresAt)) && |
| isIsoDate(row.measuredAt) && | ||
| (row.credentialId === undefined || typeof row.credentialId === "string") && | ||
| (row.expiresAt === undefined || (typeof row.expiresAt === "string" && Number.isFinite(Date.parse(row.expiresAt)))) && | ||
| (row.expiresAt === undefined || isIsoDate(row.expiresAt)) && |
…ntial-lifecycle-dates # Conflicts: # pm-stack/aggregator/src/credential-lifecycle.ts


Summary
measuredAtand presentexpiresAtvalues inisCredentialLifecycleRow.Fixes #4955
Verification
bun test— 1,391 passed.bunx tsc --noEmit— blocked by an existingHealthView.conflictstype mismatch intest/overview.test.ts.pm-aggregator-tests.ymlandpm-stack-tests.ymlcurrently trigger on pushes tomain, notpull_requestevents.