Skip to content

perf: do not include verification metrics in the returned release target response#870

Merged
adityachoudhari26 merged 2 commits intomainfrom
extract-measurement-metrics
Mar 26, 2026
Merged

perf: do not include verification metrics in the returned release target response#870
adityachoudhari26 merged 2 commits intomainfrom
extract-measurement-metrics

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

@adityachoudhari26 adityachoudhari26 commented Mar 26, 2026

currently we are including metrics in the returned response. this includes a lot of data (about 1.2 mb per data entry) which is causing the api pods to crash because they cannot send responses of that size.

remove it so that it unblocks rendering the frontend, then in a separate PR we will make a separate frontend hook that just calls a dedicated endpoint for retrieving the associated measurements for a verification metric.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Removed measurement history display from verification metrics
    • Eliminated time-based information (e.g., "measured X minutes ago") from verification status indicators
    • Simplified verification metric details across deployment release targets

@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

Removes measurement data and intervalSeconds fields from verification metrics across UI and API layers. Backend no longer returns measurement rows from the database. UI components initialize empty measurement arrays instead of using metric data, effectively hiding measurement progress and rendering placeholders.

Changes

Cohort / File(s) Summary
Frontend Metric Type Definitions
apps/web/app/routes/ws/deployments/_components/release-targets/VerificationMetricStatus.tsx, apps/web/app/routes/ws/deployments/_components/release-targets/Verifications.tsx, apps/web/app/routes/ws/deployments/_components/types.ts
Removed intervalSeconds and measurements fields from VerificationMetricStatusType and VerificationMetric. Removed createdAt from JobVerification. UI now uses empty local measurement arrays instead of data-driven values.
Frontend Provider-Specific Components
apps/web/app/routes/ws/deployments/_components/release-targets/argocd/ArgoCD.tsx, apps/web/app/routes/ws/deployments/_components/release-targets/datadog/Datadog.tsx, apps/web/app/routes/ws/deployments/_components/release-targets/prometheus/Prometheus.tsx
Updated metric display components to initialize empty measurements arrays and remove reliance on metric.measurements. Removes relative timestamp rendering and measurement trend visualization.
Database Query Layer
apps/workspace-engine/pkg/db/queries/release_targets.sql, apps/workspace-engine/pkg/db/release_targets.sql.go
ListVerificationMetricsByJobIDs query no longer joins job_verification_metric_measurement table. Removed measurement-related fields (measurement_id, measurement_data, measurement_measured_at, measurement_status) from result struct and ORDER BY clause.
OpenAPI Schema Definitions
apps/workspace-engine/oapi/openapi.json, apps/workspace-engine/oapi/spec/schemas/release_targets.jsonnet
Changed ReleaseTargetItem.latestJob.verifications from referencing JobVerification schema to inline object with id, jobId, and metrics array; metrics now explicitly define fields but exclude measurements.
Generated Backend Types
apps/workspace-engine/pkg/oapi/oapi.gen.go, packages/workspace-engine-sdk/src/schema.ts
Updated ReleaseTargetItem.LatestJob.Verifications to use inline struct types with expanded metric properties instead of referencing JobVerification/VerificationMetricStatus types.
API Response Builder
apps/workspace-engine/svc/http/server/openapi/release_targets/getters.go
Refactored buildVerificationsMap to remove measurement aggregation logic and per-metric bucketing. Metrics now populated directly from database rows without collecting measurements.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • jsbroks

🐰 Measurements fade away like morning dew,
Empty arrays sprouting fresh and new,
No more trends and no more time,
Metrics stripped down, oh so sublime!

🚥 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 objective: removing verification metrics from the release target API response for performance.

✏️ 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 extract-measurement-metrics

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 8412618 into main Mar 26, 2026
10 of 11 checks passed
@adityachoudhari26 adityachoudhari26 deleted the extract-measurement-metrics branch March 26, 2026 23:00
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