⚡ Bolt: optimize fkColumnsForEdge node scans to O(1) string decodes - #748
⚡ Bolt: optimize fkColumnsForEdge node scans to O(1) string decodes#748seonghobae wants to merge 6 commits into
Conversation
Replaced `Array.find` and repeated `sourceColumnHandleId` hex re-encodings in `fkColumnsForEdge` with a centralized `parseColumnNameFromHandle` utility. Added test coverage and documented learning.
|
👋 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: 20 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 (4)
Comment |
Replaced `Array.find` and repeated `sourceColumnHandleId` hex re-encodings in `fkColumnsForEdge` with a centralized `parseColumnNameFromHandle` utility. Added test coverage and documented learning.
|
@opencode-agent Apply exactly one reviewed repair on current head |
|
@opencode-agent review Review exact current head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== checked-out HEAD =='
git rev-parse HEAD
git status --short
echo '== merge-base and protected-base diff summary =='
git merge-base HEAD main
git diff --stat main...HEAD
git diff --name-status main...HEAD
echo '== predecessor-to-head correction =='
git diff --stat db88e2ad92ddd3acb28fedf87c2fa00a8ec2333f..101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c
git diff -- db88e2ad92ddd3acb28fedf87c2fa00a8ec2333f..101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c -- frontend/src/erd/export.ts
echo '== export module outline =='
ast-grep outline frontend/src/erd/export.ts --items all --view expanded
echo '== implementation and parser references =='
rg -n -C 8 '\bfkColumnsForEdge\b|\bparseColumnNameFromHandle\b|\bsourceColumnHandleId\b|\btargetColumnHandleId\b' frontend/src
echo '== likely focused tests =='
fd -t f . frontend | rg '(export|handleUtils|erd).*\.(test|spec)\.[cm]?[jt]sx?$' || true
rg -n -C 5 '\bfkColumnsForEdge\b|\bparseColumnNameFromHandle\b' frontend -g '*.{test,spec}.{ts,tsx,js,jsx}' || true
echo '== PR metadata, exact-head checks, reviews, and mergeability =='
gh pr view 748 --repo ContextualWisdomLab/pg-erd-cloud --json number,headRefOid,baseRefName,mergeStateStatus,reviewDecision,statusCheckRollup,reviews,url
echo '== exact-head check-runs =='
gh api 'repos/ContextualWisdomLab/pg-erd-cloud/commits/101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c/check-runs?per_page=100' --jq '.check_runs[] | [.name,.status,.conclusion,.details_url] | `@tsv`'
echo '== exact-head commit statuses =='
gh api 'repos/ContextualWisdomLab/pg-erd-cloud/commits/101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c/status' --jq '.statuses[]? | [.context,.state,.target_url] | `@tsv`'Length of output: 45255 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== full PR diff against main =='
git diff --find-renames --unified=80 main...101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c -- \
frontend/src/erd/export.ts \
frontend/src/erd/handleUtils.ts \
frontend/src/erd/handleUtils.test.ts \
.jules/bolt.md
echo '== parser implementation =='
cat -n frontend/src/erd/handleUtils.ts
echo '== export regression test outline and matching blocks =='
ast-grep outline frontend/src/erd/__tests__/export.test.ts --items all --view expanded
rg -n -C 20 'large|column|handle|fallback|sourceColumns|targetColumns' \
frontend/src/erd/__tests__/export.test.ts
echo '== predecessor export integrity: function and file checksums =='
git show db88e2ad92ddd3acb28fedf87c2fa00a8ec2333f:frontend/src/erd/export.ts | sha256sum
git show 101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c:frontend/src/erd/export.ts | sed 's/sourceColumnHandleId, targetColumnHandleId, parseColumnNameFromHandle/parseColumnNameFromHandle/' | sha256sum
git diff --numstat db88e2ad92ddd3acb28fedf87c2fa00a8ec2333f..101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c -- frontend/src/erd/export.ts
echo '== CI workflow job names and completed logs: frontend workflow =='
gh api 'repos/ContextualWisdomLab/pg-erd-cloud/actions/runs/31014571964/jobs?per_page=100' \
--jq '.jobs[] | [.name,.status,.conclusion,.started_at,.completed_at] | `@tsv`'
gh run view 31014571964 --repo ContextualWisdomLab/pg-erd-cloud --log-failed || true
echo '== OpenCode evidence workflow logs =='
gh run view 31014569667 --repo ContextualWisdomLab/pg-erd-cloud --log-failed || true
echo '== review threads and all exact-head reviews =='
gh api graphql -F owner='ContextualWisdomLab' -F name='pg-erd-cloud' -F number=748 -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes { isResolved comments(first: 20) { nodes { author { login } body commit { oid } } } }
}
reviews(first: 100) {
nodes { author { login } state commit { oid } submittedAt body }
}
}
}
}' --jq '.data.repository.pullRequest'
echo '== refreshed exact-head blockers =='
gh pr view 748 --repo ContextualWisdomLab/pg-erd-cloud --json mergeStateStatus,reviewDecision,statusCheckRollupLength of output: 63570 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== frontend CI job steps =='
gh api 'repos/ContextualWisdomLab/pg-erd-cloud/actions/jobs/92335151395' \
--jq '.steps[] | [.number,.name,.status,.conclusion,.started_at,.completed_at] | `@tsv`'
echo '== frontend package scripts =='
fd -t f '^package\.json$' frontend -x sh -c 'echo "== $1 =="; jq ".scripts" "$1"' sh {}
echo '== workflow files that define the frontend CI job =='
fd -t f -e yml -e yaml .github | xargs -r rg -n -C 5 'frontend|typecheck|coverage|build|test'
echo '== large-column regression evidence in frontend tests =='
rg -n -i -C 4 'large.{0,40}column|column.{0,40}(100|500|1000|5000)|fkColumnsForEdge|sourceHandle.{0,300}targetHandle' \
frontend/src -g '*.{test,spec}.{ts,tsx,js,jsx}' || true
echo '== refreshed exact-head check, approvals, and merge state =='
gh pr view 748 --repo ContextualWisdomLab/pg-erd-cloud \
--json headRefOid,mergeStateStatus,reviewDecision,reviews,statusCheckRollup \
--jq '{headRefOid,mergeStateStatus,reviewDecision,reviews:[.reviews[] | {author:.author.login,state,commit:.commit.oid,submittedAt}],checks:[.statusCheckRollup[] | select(.__typename == "CheckRun") | {name,status,conclusion,workflowName}]}'Length of output: 10562
The complete
The exact-head frontend CI job passed Typecheck, Test, and Build. The exact-head coverage evidence, Semgrep, and Security Scan checks also passed. The resolved unused-import thread is the only review thread. I cannot approve this pull request yet.
You are interacting with an AI system. |
Applied the reviewed repair: narrowed the |
Narrowed the `handleUtils` import in `frontend/src/erd/export.ts` to `parseColumnNameFromHandle` only, removing the unused `sourceColumnHandleId` and `targetColumnHandleId` functions as requested by the independent current-head review. Tested via typecheck, vitest, and build success.
|
Closing as superseded by the cleaned #700. #700 now contains only the five intended ERD files, validates canonical handle grammar and Unicode bounds, covers both DDL and data-dictionary exports, and precomputes per-node column-name Sets. This branch still performs linear |
Understood. Acknowledging that this work is now obsolete and superseded by #700, stopping work on this task. |
Buyer-visible performance fix
fkColumnsForEdgenow decodes each edge handle once withparseColumnNameFromHandleand validates the decoded name with a linear, allocation-light column membership scan. It no longer re-encodes every column handle while searching.Scope and behavior
sourceColumnHandleIdandtargetColumnHandleIdimports after the implementation stopped using them;Exact-head correction
The import cleanup was applied and the complete original
frontend/src/erd/export.tsimplementation was restored immediately after a transient partial-file write. The net diff from predecessor headdb88e2ad92ddd3acb28fedf87c2fa00a8ec2333fto current head is exactly one import-line replacement: one addition and one deletion. No runtime statement was lost or changed by that correction.Exact-head merge contract
Current head:
101d2a7d81ae3f4d407306b5e3afa2cb423e9c3c.Frontend typecheck, complete tests, production coverage, build, repository CI, Security Scan, Semgrep, automated review, unresolved threads, and independent non-author approval must be revalidated on this exact head. Queued, pending, cancelled, skipped-required, absent, failed, or predecessor-head results are not merge evidence.