Skip to content

feat(review): Promote --dialect auto when before/after resolve the same dialect#143

Merged
mhiro2 merged 2 commits intomainfrom
feat/auto-dialect-promotion
May 3, 2026
Merged

feat(review): Promote --dialect auto when before/after resolve the same dialect#143
mhiro2 merged 2 commits intomainfrom
feat/auto-dialect-promotion

Conversation

@mhiro2
Copy link
Copy Markdown
Owner

@mhiro2 mhiro2 commented May 3, 2026

Summary

  • Improve relune review --dialect auto behavior so that when the SQL parser resolves both before and after to the same concrete dialect (postgres / mysql / sqlite), auto is promoted to that dialect — letting lock-risk caution rules run automatically when the resolution is postgres or mysql.
  • When the two sides resolve to different concrete dialects, keep EffectiveDialect at Auto and emit a new REVIEW002 warning so the mismatch is no longer a silent skip.
  • Surface the resolved dialect via ReviewResult.requested_dialect / effective_dialect, in the CLI text/markdown report, in the WASM response, and in the playground risk-review note.

Changes

  • 4443c4d : feat(review): promote --dialect auto when both sides resolve the same dialect
    • Add resolve_effective_dialect in crates/relune-app/src/usecases/review.rs to promote auto to a concrete dialect when both sides agree, and emit a REVIEW002 warning when they disagree.
    • Plumb a resolved_dialect field through SchemaInputContext so the SQL parser result and DB URL scheme propagate as the per-input dialect signal, while schema-JSON inputs stay None (and therefore Auto).
    • Expose requested_dialect / effective_dialect on ReviewResult, the WASM response, and the playground UI, and add a resolved-dialect annotation line to the CLI text/markdown formatters. Rename the lock-risk-auto-skipped fixture to a sqlite-pinned variant and add tests covering auto→postgres/mysql/sqlite promotion, the mismatch warning, mixed SQL + schema-JSON inputs, and the WASM / CLI surface.
  • 7f24f7f : docs: describe auto-dialect promotion in review docs
    • Update README, ARCHITECTURE, docs/cli-reference, docs/configuration, docs/github-actions, action/README, and skills/relune/SKILL to describe the new auto behavior and the REVIEW002 warning.

mhiro2 added 2 commits May 4, 2026 08:13
… dialect

Under --dialect auto, the review use case now uses the parser-resolved
dialect when both before and after parse to the same one, so SQL-only
inputs that look unambiguously like Postgres or MySQL pick up the
lock-risk caution rules without an explicit --dialect. When the two
sides resolve to different dialects, EffectiveDialect stays Auto and a
new REVIEW002 warning surfaces the mismatch instead of silently
skipping. Schema-JSON inputs carry no parser dialect signal and stay
Auto.

The resolved dialect is exposed via ReviewResult.requested_dialect /
effective_dialect, surfaced inline in the CLI text/markdown reports,
returned in the WASM response, and rendered in the playground risk
review note. Also rename the lock-risk auto-skipped fixture to a
sqlite-skipped variant since auto no longer reliably exercises the
skip path; the skip diagnostic is unchanged on sqlite and still
covered by both unit and integration tests.
Update README, ARCHITECTURE, the docs/ reference set, the GitHub
Action README, and the relune skill so they match the new --dialect
auto behavior: SQL-only inputs that resolve to the same concrete
dialect now run lock-risk automatically, schema-JSON inputs still
need an explicit --dialect, and a REVIEW002 warning calls out the
mismatch case.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Code Metrics Report

main (434dd7f) #143 (13481cd) +/-
Coverage 94.4% 94.4% +0.0%
Test Execution Time 1m37s 1m36s -1s
Details
  |                     | main (434dd7f) | #143 (13481cd) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          94.4% |          94.4% | +0.0% |
  |   Files             |             99 |             99 |     0 |
  |   Lines             |          36069 |          36217 |  +148 |
+ |   Covered           |          34065 |          34207 |  +142 |
+ | Test Execution Time |          1m37s |          1m36s |   -1s |

Code coverage of files in pull request scope (92.4% → 92.5%)

Files Coverage +/- Status
crates/relune-app/src/result.rs 96.0% 0.0% modified
crates/relune-app/src/schema_input.rs 86.3% +0.2% modified
crates/relune-app/src/usecases/review.rs 94.7% +0.3% modified
crates/relune-cli/src/cli.rs 88.0% 0.0% modified
crates/relune-core/src/diagnostic.rs 89.5% +0.3% modified
crates/relune-core/src/review/rules.rs 95.7% +0.0% affected
crates/relune-wasm/src/lib.rs 4.6% -0.1% modified
crates/relune-wasm/src/request.rs 98.5% 0.0% modified

Reported by octocov

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Schema review

Tip

✅ No risk findings — schema changes look safe to merge.

@mhiro2 mhiro2 added the enhancement New feature or request label May 3, 2026
@mhiro2 mhiro2 self-assigned this May 3, 2026
@mhiro2 mhiro2 merged commit c9d35f6 into main May 3, 2026
6 checks passed
@mhiro2 mhiro2 deleted the feat/auto-dialect-promotion branch May 3, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant