fix(oracle): build the product library (not tests/benchmarks) so Infer# succeeds - #24
Conversation
…nfer# Third Dapper iteration: with .slnx + nbgv fixed, the build reached the projects but failed on the *test/benchmark* projects of the solution — Dapper.Tests pulls Microsoft.Data.SqlClient.SNI (native copy denied to /bin) and the net472 benchmark hits CS1705 (System.Runtime version skew). The core library itself (Dapper/Dapper.csproj) built fine — and that is exactly what an Infer# leak scan wants; its tests/benchmarks are off-target and often unbuildable bare. So when no `build` input is given, prefer the product library over the solution: a unique `<repo>.csproj` (repo basename) outside the test/benchmark/sample trees; else a lone root solution; else a lone solution anywhere; else the dir. Dapper's layout has no `src/` — the library is `Dapper/Dapper.csproj` at the root (verified against Dapper.slnx), which `find -name "$name.csproj"` selects uniquely. The `build` input still overrides. Verified: a Dapper-shaped fixture resolves to `Dapper/Dapper.csproj` (tests, benchmarks, Dapper.SqlBuilder excluded); name-mismatch falls back to the lone .slnx; explicit build respected. oracle.yml valid YAML; build-step bash parses; no comparator change (--selftest still 12/12). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe Infer# "Build the target" step in the Oracle workflow gains a new first-preference branch: when ChangesInfer# build-target selection refinement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.github/workflows/oracle.yml:
- Around line 123-125: The find command using -not -path filters is
case-sensitive, so paths with capitalized directory names like Tests/,
Benchmarks/, Samples/, or Examples/ will not be excluded. Replace the -path
options with -ipath in all four exclusion filters (for test, tests, benchmark,
sample, and example directories) to make the pattern matching case-insensitive,
ensuring that project directories with any capitalization variant are properly
excluded from the selection.
In `@docs/notes/oracle.md`:
- Around line 39-44: The documentation in the oracle.md file is incomplete and
does not reflect all implemented selection rules for build artifacts. Update the
paragraph describing the Infer# workflow (starting around line 39) to include
two missing behaviors: first, clarify that sample and example directory trees
are excluded from the build selection process, and second, add the
root-solution-first fallback tier to the fallback hierarchy, explaining that it
attempts to use a solution file at the repository root before falling back to
repo-wide solutions. This will ensure the documentation accurately reflects the
complete implementation.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 49a6eaf8-54f3-4c6f-85c8-6ebe1d7eca2c
📒 Files selected for processing (2)
.github/workflows/oracle.ymldocs/notes/oracle.md
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…deRabbit #24) - oracle.yml (Major): the `-not -path` exclusions are case-sensitive, so a `<repo>.csproj` under a capitalized `Tests/`/`Benchmarks/`/`Samples/` could slip into the product-library pick. Switch to `-ipath` (kept the broad `benchmark*`/`sample*`/`example*` globs rather than a singular/plural split) and add `-type f`. Verified: a `Tests/DapperX/Dapper.csproj` decoy is now excluded, so Dapper still resolves to `Dapper/Dapper.csproj`. - docs/notes/oracle.md (Minor): the prose had drifted from the implementation — now states the sample/example exclusion and the full fallback order (root solution -> any solution -> dir). oracle.yml valid YAML; fixture check passes; no comparator change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
Uh oh!
There was an error while loading. Please reload this page.
The first real three-way run (DapperLib/Dapper) exposed two issues: 1. Infer# reported 0 leaks in the comparison, but it actually found 3 — modern Infer# (Pulse engine, v1.2+) emits `PULSE_RESOURCE_LEAK`, not the older `RESOURCE_LEAK`, so the comparator's INFER_LEAK set missed them and they were mis-filed under "out of scope" context. Now match the Infer leak family by substring (`*RESOURCE_LEAK*` / `*MEMORY_LEAK*`), robust to version drift. 2. Scope asymmetry: Infer# builds only the product project (the #24 heuristic), while own-check and CodeQL scan the whole source tree — so their leak counts were inflated by test/benchmark code the others never saw (agree was depressed accordingly). Add `--exclude-tests` (comparator) + an `include_tests` workflow input (default off => product-only). The exclusion is applied uniformly to all tools in the comparator rather than per-tool, because CodeQL's `paths-ignore` is unreliable for compiled C# with `build-mode: none`. Report header notes the scope. docs/notes/oracle.md updated (scope note + the input). selftest now 15/15 (adds PULSE classification + the exclude-tests predicate); ruff clean; run_tests.py exit 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
Build the product library, not the whole solution
Third Dapper iteration. With
.slnxmatching (#23) and the shallow-clone deepen (#23) in, the build finally reached the projects — the coreDapper/Dapper.csprojandDapper.SqlBuildercompiled fine. It then failed on the test/benchmark projects of the solution:MSB3021—Dapper.TestspullsMicrosoft.Data.SqlClient.SNI, whose native-copy step is denied (/bin).CS1705— thenet472benchmark (Dapper.Tests.Performance) hits aSystem.Runtimeversion skew.Neither is the library. An Infer# leak scan wants the product code, not its test suite — and the tests/benchmarks are often unbuildable in a bare CI (no SQL Server, multi-TFM, native deps).
The fix
When no
buildinput is given, prefer the product library over the solution:<repo>.csproj(repo basename) outsidetest/ tests/ benchmark* sample* example*→*.sln/*.slnx→continue-on-error→ partial report).Dapper's layout has no
src/(I verified againstDapper.slnx): the library isDapper/Dapper.csprojat the repo root, whichfind -name "$name.csproj"selects uniquely (tests, benchmarks, andDapper.SqlBuilderare excluded by name/path). Thebuildinput still overrides for anything unusual.Verified
A Dapper-shaped fixture resolves to
Dapper/Dapper.csproj; a name-mismatch repo falls back to the lone.slnx; an explicitbuildis respected.oracle.ymlvalid YAML · build-step bash parses · no comparator change (--selfteststill 12/12).After merge
Re-dispatch
oracle (cross-tool),repo = DapperLib/Dapper, nobuildinput —Dapper/Dapper.csprojis auto-selected, so Infer# should finally produce SARIF and we get the real three-way own / CodeQL(security-and-quality) / Infer# report.🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
Chores
<repo>.csproj(outside test/benchmark paths) before falling back to solutions or the target directory.Documentation
buildinput overrides selection, including clarification of shallow-clone deepening behavior.