Skip to content

chore: retrieve metrics from verification metric trpc endpoint#871

Merged
adityachoudhari26 merged 1 commit intomainfrom
verification-metric-measurements
Mar 26, 2026
Merged

chore: retrieve metrics from verification metric trpc endpoint#871
adityachoudhari26 merged 1 commit intomainfrom
verification-metric-measurements

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

@adityachoudhari26 adityachoudhari26 commented Mar 26, 2026

Summary by CodeRabbit

  • New Features
    • Added loading indicators while metric measurements are being retrieved.
    • Metrics now display relative time information (e.g., "5 minutes ago") indicating when they were last measured.
    • Enhanced measurement data fetching from backend to provide real-time metric status updates across verification displays.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The changes refactor measurement data fetching for verification metrics to be externalized and loading-aware. A new useMetricMeasurements hook fetches metric measurements via tRPC. The VerificationMetricStatus type gains an id field across components, and verification display components now render loading spinners during data fetch operations.

Changes

Cohort / File(s) Summary
Measurement Hook
apps/web/app/routes/ws/deployments/_components/release-targets/useMetricMeasurements.ts
New hook that wraps trpc.verifications.measurements.useQuery(), returning measurements array and loading state.
Verification Status Component
apps/web/app/routes/ws/deployments/_components/release-targets/VerificationMetricStatus.tsx
Added id: string to VerificationMetricStatusType. Updated getVerificationStatus() signature to accept measurements as parameter. Integrated useMetricMeasurements() hook with loading spinner. Enhanced label with relative "time ago" timestamp.
Verification Display Components
apps/web/app/routes/ws/deployments/_components/release-targets/Verifications.tsx, argocd/ArgoCD.tsx, datadog/Datadog.tsx, prometheus/Prometheus.tsx
Added id: string to VerificationMetricStatus type. Replaced empty local measurement arrays with useMetricMeasurements(metric.id) hook. Integrated loading checks to render centered spinner when isLoading is true; render provider-specific details only after measurements load.
tRPC Backend
packages/trpc/src/root.ts, packages/trpc/src/routes/verifications.ts
Registered new verificationsRouter in app router. Created measurements protected procedure that queries jobVerificationMetricMeasurement by metric ID, returning id, status, data, and measuredAt fields sorted descending by timestamp.

Possibly related PRs

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes


🐰 A hop through measurement fields we go,
New id strings sprout where metrics flow,
Spinners spin while data takes flight,
tRPC brings queries to dizzying height!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing a TRPC endpoint to retrieve metric measurements for verification metrics, which is the core purpose of this PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch verification-metric-measurements

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@adityachoudhari26 adityachoudhari26 merged commit 2ec7c6c into main Mar 26, 2026
7 of 8 checks passed
@adityachoudhari26 adityachoudhari26 deleted the verification-metric-measurements branch March 26, 2026 23:34
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