chore(fixture): enrich fixtures/minimal to exercise every codemap surface#55
chore(fixture): enrich fixtures/minimal to exercise every codemap surface#55SutuSebastian merged 4 commits intomainfrom
Conversation
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThe PR expands the minimal fixture to comprehensively exercise codemap surfaces by adding shop components, library modules with call cycles, utility functions, Codemap recipes, CODEOWNERS metadata, and updating documentation and tooling configuration. ChangesMinimal Fixture Comprehensive Expansion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Review rate limit: 0/1 reviews remaining, refill in 35 minutes and 25 seconds.Comment |
Replaces the lint-staged wrapper that filtered fixture paths (which broke other CI tasks). The proper fix is at the lint script: oxlint exits 1 when every staged file matches an `ignorePatterns` entry (e.g. all-fixture commits) — `--no-error-on-unmatched-pattern` makes it a no-op instead, mirroring what `format:check` already does for `oxfmt`. Also refreshes golden query fixtures to match the enriched fixtures/minimal corpus.
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@fixtures/minimal/.codemap/recipes/shop-symbols.sql`:
- Around line 4-8: The SQL recipe queries the symbols table but does not
restrict results to exported symbols; update the WHERE clause in the query that
selects from the symbols table (the SELECT name, file_path, line_start,
signature ... FROM symbols ... WHERE file_path LIKE 'src/components/shop/%' AND
kind = 'function') to include the exported filter by adding a predicate on the
is_exported column (is_exported = 1) so the result set matches the recipe
description of "every exported function under src/components/shop/". Ensure the
additional predicate is combined with the existing conditions (AND) and keep the
ORDER BY file_path, line_start intact.
In `@fixtures/minimal/README.md`:
- Around line 34-36: The `## Use` block shows the command
`CODEMAP_ROOT="$(pwd)/fixtures/minimal" bun src/index.ts query --recipe
shop-symbols --json` without warning that `--recipe shop-symbols` is rejected at
runtime; add a short inline note immediately below that command explaining that
the `shop-symbols` recipe is currently unsupported/unknown (per the table/PR
notes) and will fail if used, so readers don’t run the command expecting it to
succeed. Reference the exact command string (`CODEMAP_ROOT=... bun src/index.ts
query --recipe shop-symbols --json`) in the note so it’s unambiguous.
- Line 13: Update the README table row so the documented cycle path matches the
actual code and the corrected comment in cache.ts: replace the incorrect 4-step
cycle `cache.get → store.read → cache.invalidate → store.write → cache.get` with
the real cycle `cache.invalidate → store.write → cache.invalidate`; ensure the
caller→callee chain (`run → createClient → setupTransport → openSocket →
handshake`) remains unchanged and that the README entry aligns with the cache.ts
header comment describing the cycle involving cache.invalidate and store.write.
In `@fixtures/minimal/src/components/shop/ProductCard.tsx`:
- Around line 11-19: Add a JSDoc block for the exported ProductCard function
(export function ProductCard(props: ProductCardProps)) documenting the function
purpose, the props parameter (shape via ProductCardProps), and the return value
(JSX.Element or React element), including any behavior such as conditional
rendering based on usePermissions(). Place the JSDoc immediately above the
ProductCard declaration and include tags like `@param` and `@returns` so the public
API is documented per guidelines.
In `@fixtures/minimal/src/components/shop/ShopButton.tsx`:
- Around line 7-14: The exported React component ShopButton lacks JSDoc; add a
JSDoc block above the exported function ShopButton that documents its purpose
(renders a "Buy" button), notes it uses usePermissions to control the disabled
state (disabled when perms.canEdit is false), lists that it accepts no props (or
describe any props if added later), and states the return type (JSX.Element).
Reference the ShopButton function and the usePermissions usage in the comment so
the public API is properly documented.
In `@fixtures/minimal/src/lib/cache.ts`:
- Around line 17-20: invalidate causes unbounded mutual recursion by calling
write(key, "") which in turn calls invalidate; remove the back-call from
invalidate so it only performs _data.delete(key) and does not call write; keep
the existing import relationship and the store.write → cache.invalidate
direction intact (so leave store.write unchanged) and ensure the function name
invalidate is the only change.
- Around line 1-3: Update the header comment to reflect the actual call graph:
change the documented path from "cache.get → store.read → cache.invalidate →
store.write → cache.get" to the real 2-node cycle "cache.invalidate ↔
store.write" and note the unidirectional "cache.get → store.read" edge; edit the
comment in fixtures/minimal/src/lib/cache.ts (where cache.get and
cache.invalidate are defined) and the matching line in README.md (line 13) so
they correctly describe that store.read only returns the backing value and
store.write and cache.invalidate form the two-node cycle.
In `@lint-staged.config.js`:
- Around line 28-44: The current lint-staged config leaves "bun run
format:check" as a plain string so lint-staged appends all filenames (including
fixtures) to it; change the export so the glob handler uses the existing
lintStaged function only, and update lintStaged to return both commands
(format:check and the lint command) for non-empty lintable arrays — locate the
lintStaged function and the export default object and replace the string entry
"*.{js,jsx,ts,tsx,mjs,mts,cjs,cts}": ["bun run format:check", lintStaged] with a
single reference to lintStaged (ensuring lintStaged returns an array like ["bun
run format:check", `bun run lint ...`] or ["true"] when nothing to run).
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9e4d31fe-0fce-480c-9b5a-578c01cfcd9b
📒 Files selected for processing (16)
fixtures/minimal/.codemap/recipes/shop-symbols.mdfixtures/minimal/.codemap/recipes/shop-symbols.sqlfixtures/minimal/CODEOWNERSfixtures/minimal/README.mdfixtures/minimal/src/api/client.tsfixtures/minimal/src/components/shop/ProductCard.tsxfixtures/minimal/src/components/shop/ShopButton.default.tsfixtures/minimal/src/components/shop/ShopButton.tsxfixtures/minimal/src/components/shop/index.tsfixtures/minimal/src/consumer.tsfixtures/minimal/src/lib/cache.tsfixtures/minimal/src/lib/store.tsfixtures/minimal/src/notes.mdfixtures/minimal/src/utils/date.tsfixtures/minimal/src/utils/format.tslint-staged.config.js
- shop-symbols.sql: add `is_exported = 1` so the recipe matches the
`.md` description ("every exported function under src/components/shop/").
- cache.ts header + README cycle row: replace the bogus 4-step path
(which referenced edges that don't exist in the code) with the
actual 2-node static call cycle `cache.invalidate ↔ store.write`,
plus the non-cyclic `cache.get → store.read` edge.
- cache.ts invalidate(): guard the `write(key, "")` re-entry behind
an unreachable string check. The AST still records the
`invalidate → write` call edge needed by the cycle fixture, but
runtime execution no longer triggers infinite mutual recursion.
- README "Use" section: inline note that `--recipe shop-symbols` is
currently rejected (matches the table caveat above), so a reader
copying the command knows to expect the known limitation.
- Re-snapshot files-hashes.json against the post-format README.md so CI's golden-query regression matches the on-disk corpus. - Trim the cache.ts header from a 7-line block to a 2-line cycle description + one-line guard explainer (concise-comments rule).
Summary
Enriches the fixture from a minimal smoke target into a full per-surface demo. Foundation for the upcoming coverage ingestion plan (next agent-loop unlock — needs realistic data to exercise against).
Before → After
@internal)@internal/@beta/@alpha/@private)@deprecatedusePermissions— fan-in)cache.ts ↔ store.ts)shop-symbols)--group-by ownerworks)See
fixtures/minimal/README.mdfor the per-surface coverage table.Smoke
```text
$ CODEMAP_ROOT=$(pwd)/fixtures/minimal bun src/index.ts query --recipe deprecated-symbols --format annotations
::notice file=src/api/client.ts,line=39::legacyClient (function)
::notice file=src/utils/date.ts,line=5::now (function)
::notice file=src/utils/format.ts,line=5::epochMs (function)
$ bun src/index.ts impact run --json --summary | jq '.summary'
{ "nodes": 13, "max_depth_reached": 3, "by_kind": {"symbol": 13}, "terminated_by": "depth" }
$ bun src/index.ts impact get --depth 5 --direction down --json | jq '.summary'
{ "nodes": 5, "max_depth_reached": 2, "terminated_by": "exhausted" } # cycle stops walk
```
Known limitations (filed for follow-up)
Both surfaced by the fixture, unrelated to it. Worth separate issues.
Drive-by
Test plan
Summary by CodeRabbit
New Features
Documentation
Chores