feat: add routing trace seeding to seed-insights#27782
Merged
hariombalhara merged 3 commits intomainfrom Feb 9, 2026
Merged
Conversation
…script Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="scripts/seed-insights.ts">
<violation number="1" location="scripts/seed-insights.ts:861">
P3: The logged count is misleading - it reports `traceData.length` as the number of created routing traces, but silently caught errors (e.g., unique constraint violations on re-runs) are not tracked. Consider tracking skipped/failed creates and logging the actual success count vs skipped count for accurate feedback.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
Co-Authored-By: unknown <>
joeauyeung
approved these changes
Feb 9, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
RoutingTraceseed data toseed-insights.tsso that the routing trace dialog feature (assignment reason badge click → trace sheet) can be tested with realistic data.New
seedRoutingTraces()function called afterseedBookingAssignments(). Finds bookings that already have both assignment reasons and routing form responses, then createsRoutingTracerecords (up to 200) with realistic trace steps (route matched / attribute logic evaluated / fallback route used).How should this be tested?
yarn db-seedthenyarn seed-insights— verify routing traces are created for bookings with assignment reasonsteampro:teampro, navigate to Bookings → Upcoming, verify assignment reason badges appear and the routing trace sheet opens on badge clickyarn seed-insightsa second time — verify the log now reports0 created, N skipped due to conflictsinstead of misleadingly claiming all were createdItems for reviewer attention
traceDatais declared asconst traceData = []without an explicit type annotation..catch()handler onroutingTrace.create()catches all errors (not just unique constraint violations). For a seed script this is acceptable, but worth noting that non-constraint errors (e.g., connection issues) would be counted as "skipped due to conflicts."Updates since last revision
seed-routing-trace.ts— all routing trace seeding now lives inseed-insights.tsonly.skippedcounter to track failed creates in the.catch()handler, and updated the console log to report actual success count vs skipped count for accurate feedback on re-runs.Mandatory Tasks (DO NOT REMOVE)
Link to Devin run: https://app.devin.ai/sessions/472032d4013b4c41998caef2a515eb91
Link to Devin run (review fixes): https://app.devin.ai/sessions/be21a5b14f6245ef815f9c300e2292b8
Requested by: @hariombalhara