[CSM Portal] add case activities search passthrough route - #1063
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
2421581 to
3bede1f
Compare
Purpose
The CSM portal needs to show a case's full activity trail (comments, work notes, state transitions, and other recorded field changes) on the case view. The integration service is gaining a path-scoped
POST /cases/{id}/activities/searchendpoint for this, but the CSM backend (BFF) currently has no route that reaches it, so the webapp cannot fetch a case's activity trail.This PR adds that missing passthrough route to the CSM backend so the webapp can call it through the gateway.
Goals
POST /cases/{id}/activities/searchroute to the CSM backend that forwards to the integration service's path-scopedPOST /cases/{id}/activities/search.Approach
internal/entity: addedSearchCaseActivities(ctx, caseID, body)that calls the integration service'sPOST /cases/{id}/activities/searchwith the case ID path-escaped, mirroring the existingSearchCaseCommentsclient method.internal/handler(cases.go): added aSearchCaseActivitieshandler that authenticates the request, reads the case ID from the path, caps the body at the standard 1 MiB request limit, validates that any non-empty body is valid JSON, and forwards it unchanged. Unlike the case-comments search handler (which forwards to the global/comments/searchand injectsreferenceId/referenceType), this endpoint is path-scoped, so nothing is injected into the body. The new method is added to the localentityCaseClientinterface.cmd/server/main.go: registered the new route next to the case-comments search route.openapi.yaml: documented the path plusCaseActivitySearchPayload/CaseActivity/CaseActivitySearchResponseschemas. The body may carry{ pagination, includeFieldChanges? }.The integration service that exposes
POST /cases/{id}/activities/searchis delivered separately (see Related PRs); this backend change depends on it being deployed.User stories
As a CS engineer, I want to see the full activity trail of a case so I can understand its history at a glance.
Release note
Added a case activity trail search endpoint (
POST /cases/{id}/activities/search) to the CSM backend.Documentation
N/A - internal BFF passthrough route; no end-user product documentation impact. The endpoint is documented in the service's own
openapi.yaml.Training
N/A - no training-content impact.
Certification
N/A - no impact on certification exams.
Marketing
N/A - internal platform change with no marketing impact.
Automation tests
Security checks
go vetandgo test -racerun clean.Samples
N/A - no samples related to this change.
Related PRs
Migrations (if applicable)
N/A - no schema or data migrations.
Test environment
go.mod), macOS.make build,make test, andmake vetrun clean.Learning
Followed the existing
SearchCaseCommentshandler/client pattern already established in this backend; the only deliberate deviation is not injectingreferenceId/referenceType, since the new endpoint is path-scoped rather than routed through the global comments search.