⚡ Bolt: Optimize export foreign key lookups by using parsed handles - #786
⚡ Bolt: Optimize export foreign key lookups by using parsed handles#786seonghobae wants to merge 9 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 42 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough핸들 ID에서 컬럼명을 직접 복원하는 ChangesFK 핸들 디코딩
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.jules/bolt.md:
- Around line 80-82: 엣지별 노드 컬럼 확인이 현재 .some 순회로 선형 탐색을 수행하므로 설명의 O(1) 주장과 구현이
일치하지 않습니다. FK 엣지 조회 로직에서 컬럼명을 담은 Set 인덱스를 먼저 구성하고, 각 조회가 해당 Set을 사용하도록 변경하십시오.
인덱스를 추가하지 않는 경우에는 선형 존재 확인이 유지된다는 내용으로 복잡도 설명을 갱신하십시오.
In `@frontend/src/erd/export.ts`:
- Around line 75-84: The edge-processing logic in frontend/src/erd/export.ts
lines 75-84 must replace per-edge columns.some checks with node-level Set
indexes built before the edge loop, then validate parsed source and target
columns using Set.has for O(1) lookup. Update .jules/bolt.md lines 80-82 to
document O(1) column lookup only after this Set-based indexing is implemented.
- Around line 75-88: Update the source and target handle checks in
fkColumnsForEdge to accept empty column names by testing parsedSource and
parsedTarget against null rather than truthiness, and use !== undefined for the
final resolved-column existence checks. Add focused fkColumnsForEdge tests
covering c-empty handles and preserving fallback behavior when handles cannot be
resolved.
In `@frontend/src/erd/handleUtils.ts`:
- Around line 33-40: Update the decoding logic around the visible split/map flow
in handleUtils so every token is validated as a complete hexadecimal code point
before calling parseInt; reject any token containing non-hex characters by
returning null, while preserving valid decoding and existing error handling. Add
a focused test covering encoded input such as src-c-0069junk-0064 and assert
that decoding returns null.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 039ce735-14df-4d2f-9c62-0da4c045d3f0
⛔ Files ignored due to path filters (1)
frontend/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
.jules/bolt.mdfrontend/src/erd/export.tsfrontend/src/erd/handleUtils.test.tsfrontend/src/erd/handleUtils.ts
💡 What: Precomputes a node-level
Setof column names, decodes each ERD edge handle once withparseColumnNameFromHandle, and validates the decoded name withSet.hasinstead of scanning and re-encoding every column.🎯 Why: FK export previously performed an O(C) column scan for each edge after decoding the handle, retaining avoidable CPU and allocation cost on large diagrams.
📊 Complexity: Column indexes are built once in O(N * C). Each edge performs bounded O(H) handle decoding plus O(1) average-case
Set.hasmembership checks, eliminating the previous O(C) per-edge existence scan. String decoding itself is not claimed to be O(1).🛡️ Correctness hardening:
src-c-0069junk-0064are rejected rather than partially parsed;c-emptyencoding is preserved without falling through to placeholder FK columns;Array.somescan is no longer used.✅ Verification on head
abc57fd38bb7a66abac826942311900a2c847f50:23816da4eaad968914d762f203b7446afad7c942deterministically failed all three new focused regressions for the intended pre-fix behavior;PR created automatically by Jules for task 14142744112914767576 started by @seonghobae
Summary by CodeRabbit