Skip to content

feat(review): Wire ReviewRequest.dialect and lock-risk skip diagnostic#124

Merged
mhiro2 merged 3 commits intomainfrom
feat/review-request-dialect
May 1, 2026
Merged

feat(review): Wire ReviewRequest.dialect and lock-risk skip diagnostic#124
mhiro2 merged 3 commits intomainfrom
feat/review-request-dialect

Conversation

@mhiro2
Copy link
Copy Markdown
Owner

@mhiro2 mhiro2 commented May 1, 2026

Summary

  • Add ReviewRequest.dialect (with builder) and thread the resulting EffectiveDialect through the review usecase, replacing the hard-coded Auto.
  • Introduce REVIEW001 (review_lock_risk_skipped) and a lock_risk_skip_diagnostic helper that emits an info-level diagnostic only when an explicitly opted-in lock-risk rule cannot evaluate under the effective dialect; the default profile (no --rules) stays silent.
  • Extend the golden fixture runner with optional meta.toml, recursive directory walk, and optional expected_diagnostics.json so per-rule lock-risk fixtures can live under fixtures/review/<group>/<rule-dialect>/....

Changes

  • 8e6e127 : feat(review): add REVIEW001 lock-risk skip diagnostic helper
    • Register DiagnosticCode::review_lock_risk_skipped() (REVIEW001) and a public lock_risk_skip_diagnostic in relune-core that branches on Auto / Sqlite / Postgres|Mysql scope mismatches with distinct messages.
    • Keep DialectScope pub(crate) by inspecting it inside the review module.
  • 5e45ff7 : feat(review): wire ReviewRequest.dialect into review pipeline
    • Add dialect: SqlDialect (defaulting via serde) and with_dialect builder on ReviewRequest, then thread the resulting EffectiveDialect into run_rules instead of the hard-coded Auto.
    • Emit the REVIEW001 skip diagnostic only when callers explicitly listed a lock-risk rule; CLI/wasm pass SqlDialect::default() until the upcoming dialect-plumbing tasks expose the user-supplied value.
  • fa1e50d : test(review): extend fixture runner with meta.toml and recursive walk
    • Walk fixtures/review/ recursively and treat any directory containing before.sql + after.sql as a leaf fixture so per-rule sets can live under nested groups.
    • Honor an optional meta.toml (dialect/rules/except_rules/except_tables) and an optional expected_diagnostics.json, with UPDATE_FIXTURES=1 regenerating both expected files.

Introduce DiagnosticCode::review_lock_risk_skipped (REVIEW001) and a
public lock_risk_skip_diagnostic helper in relune-core. The helper
returns an info-level Diagnostic when explicitly opted-in lock-risk
rules cannot evaluate under the effective dialect, with distinct
messages for Auto, Sqlite, and Postgres/Mysql scope mismatches. The
helper preserves the pub(crate) visibility of DialectScope by keeping
scope inspection inside the review module.
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Schema review

Tip

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

mhiro2 added 2 commits May 1, 2026 22:37
Add a ReviewRequest.dialect field with a with_dialect builder, thread
the resulting EffectiveDialect into run_rules instead of hard-coding
Auto, and emit the REVIEW001 skip diagnostic when an explicitly
requested lock-risk rule cannot run under the effective dialect.
Default profiles (no explicit rules) remain silent to keep CI noise
in check. Add CLI/wasm shims that pass SqlDialect::default() until
the upcoming dialect plumbing tasks expose the user-supplied value.
The golden fixture runner now descends into subdirectories so per-rule
fixtures can live under fixtures/review/<group>/<rule-dialect>/...,
with each leaf detected by the presence of before.sql + after.sql.
An optional per-fixture meta.toml configures dialect/rules/except
filters, and an optional expected_diagnostics.json locks down the
diagnostics payload (with UPDATE_FIXTURES=1 honored for both
expected files). Fixtures without expected_diagnostics.json must
keep producing no diagnostics, matching the existing flat fixtures.
@mhiro2 mhiro2 force-pushed the feat/review-request-dialect branch from fa1e50d to bfc7c7a Compare May 1, 2026 13:39
@mhiro2 mhiro2 self-assigned this May 1, 2026
@mhiro2 mhiro2 added the enhancement New feature or request label May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Code Metrics Report

main (9e06a63) #124 (02d98f7) +/-
Coverage 94.5% 94.5% +0.0%
Test Execution Time 1m34s 1m34s 0s
Details
  |                     | main (9e06a63) | #124 (02d98f7) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          94.5% |          94.5% | +0.0% |
  |   Files             |             81 |             81 |     0 |
  |   Lines             |          37510 |          37678 |  +168 |
+ |   Covered           |          35464 |          35629 |  +165 |
  | Test Execution Time |          1m34s |          1m34s |    0s |

Code coverage of files in pull request scope (93.6% → 93.9%)

Files Coverage +/- Status
crates/relune-app/src/request.rs 81.5% +0.2% modified
crates/relune-app/src/usecases/review.rs 94.3% +0.5% modified
crates/relune-cli/src/commands/review.rs 91.3% +0.0% modified
crates/relune-core/src/diagnostic.rs 86.4% +0.4% modified
crates/relune-core/src/model.rs 96.5% +0.1% affected
crates/relune-core/src/review.rs 94.3% +0.7% modified
crates/relune-wasm/src/request.rs 98.2% +0.0% modified

Reported by octocov

@mhiro2 mhiro2 merged commit 4bd67a8 into main May 1, 2026
6 checks passed
@mhiro2 mhiro2 deleted the feat/review-request-dialect branch May 1, 2026 13:42
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