Conversation
|
My suggestion in #2592 was wrong. To cover it, make // schema/resource.go
type Resource struct {
// ...
columnIndexHint int
}
func (r *Resource) Set(columnName string, value any) error {
index := r.columnIndexHint
if index < 0 || index >= len(r.data) || r.Table.Columns[index].Name != columnName {
index = r.Table.Columns.Index(columnName)
if index == -1 {
panic(columnName + " column not found")
}
}
// existing r.data[index].Set(value) + panic on error
}
func (r *Resource) setColumnIndexHint(i int) { r.columnIndexHint = i }
|
SummarySkips the linear column-name lookup when setting a value in Review✅ SAFE TO MERGEBehaviour is unchanged: Testing: there's no unit test for Nice to have
Files reviewed (2)
Stack: Go · kinds reviewed: code · repo guidance: none found (no AGENTS.md/CLAUDE.md or skills in repo), fallback checklist used |
VERDICT✅ SAFE — NO DEFECTS FOUND 6 ✅ passed · 2 covered-by-CI · 1 NO-BASELINE (P2, new surface) · 0 ❌ · 0 🚫 Row values are the same on head and base, and Metadata: target in-process Go harness ( LEADSCLAIMS:
WORRIES:
IMPORTANT:
Dispositions: C1 confirmed (I3 nil-resolver bench) · C2 confirmed (I2) · C3 contradicted (I3) · W1 confirmed, credit erezrokah · W2 already-known (cq-ai-code-review), API-design question, not testable · W3 confirmed: no test in the diff; one is proposed below. CHECKS
My own benchmark had a flaw on its first run: the item had no matching keys, so FINDINGS🔴 BROKENNone. 🟠 RISKYNone. 🟡 NOTE
RULED OUT
NOT COVERED
PROPOSED
FOR THE REPODraft
DETAILSTHE PLAYBOOK QUESTION, ANSWEREDNone fitted. The question I asked instead was: does indexing by position ever write a different slot than the name lookup? No, for every valid table. I1 gave identical dumps head vs base, and I2 wrote only the named slot in all five index cases. The only difference is on duplicate-name tables, which validation rejects. EXISTING TESTS RUNNone run locally. TESTS WRITTEN FOR THIS RUNThrowaway files
GENERATED DIFFSNone. Nothing in this repo renders from CHECKS AGAINST THE TARGETAll checks ran against the in-process harness: head at the PR worktree (14e5f2e), base in a detached worktree of b766914 in the scratchpad, since removed. There are no logs beyond test output, and no process, port or shared resource was created. Injection scan: I decoded both issue comments (erezrokah, cloudquery-daniel's cq-ai-code-review) with Run totals: 9 checks (6 ✅, 2 covered-by-CI, 1 NO-BASELINE) · findings 0 🔴 · 0 🟠 · 3 🟡. |
cloudquerydaniel
left a comment
There was a problem hiding this comment.
Approved by Daedalus on 14e5f2e: code-review: ✅ SAFE TO MERGE · qa-probe: ✅ SAFE — NO DEFECTS FOUND. Triage: The change alters how every resolved column value, _cq_id and _cq_client_id is written during syncs, which affects the data that plugins store.
Summary
Simplified implementation of #2592 that handles the main call site. In the future we can look at implementing a more fully implemented cache