Skip to content

fix(cli): baseline path join + per-statement EXPLAIN - #26

Merged
c2j merged 1 commit into
mainfrom
fix/baseline-path-and-per-stmt-explain
Jul 15, 2026
Merged

c2j merged 1 commit into
mainfrom
fix/baseline-path-and-per-stmt-explain

Conversation

@c2j

@c2j c2j commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes two bugs found during UserGuide × testcases verification:

  1. fix(cli): join git_repo when resolving baseline-discovered file paths #24 — Baseline-discovered files are repo-relative; when git_repo is not . (e.g. c2j/ogagila), reads failed with No such file. Paths are now joined with git_repo. file_diff runs under repo_path so --diff-aware stays consistent.

  2. fix(cli): run EXPLAIN per SQL statement, not whole multi-statement file #25 — Multi-statement SQL files ran a single EXPLAIN on the whole file; one failure aborted all plan analysis. Statements are split via ogsql-parser and each explainable DML is EXPLAINed independently (per-statement failures only warn).

Also: clippy manual_contains in cr-core filter (CI hygiene).

Test plan

  • cargo test -p cr-cli (includes new unit tests for path join + statement split)
  • cargo test -p cr-git
  • cargo clippy -p cr-cli -p cr-git -p cr-core -- -D warnings --no-deps
  • Manual (with testcases + pagila):
    cd testcases
    coderc audit --project ogagila --baseline main --no-db
    # should read c2j/ogagila/... files without No such file
    coderc audit --project ogagila --files path/to/multi.sql
    # multi-select file should produce SCAN/JOIN findings when DB up

Closes #24
Closes #25

- Join git_repo when mapping baseline-discovered relative paths so
  audit works when CWD is the config directory (#24)
- Run file_diff under repo_path for consistent --diff-aware behavior
- Split multi-statement SQL via ogsql-parser and EXPLAIN each DML
  statement independently; failures no longer abort the whole file (#25)
- clippy: use slice::contains in cr-core filter

Closes #24
Closes #25
@github-actions

Copy link
Copy Markdown

CodeRoughcollie 多项目审核报告

总览

项目 🔴 Critical 🟡 Warning 🔵 Info 健康度
self 0 0 0 100 (优秀)

项目: self

执行摘要

指标
健康度评分 🟢 100/100(优秀)
问题总数 0(🔴 Critical: 0 / 🟡 Warning: 0 / 🔵 Info: 0)
审核分支 origin/main
门禁结论 通过 — 未发现问题

审核通过,未发现问题。

@c2j
c2j merged commit a6e494e into main Jul 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): run EXPLAIN per SQL statement, not whole multi-statement file fix(cli): join git_repo when resolving baseline-discovered file paths

1 participant