[e-navigator] Introduce Steep Typechecking#232
Merged
hayat01sh1da merged 37 commits intoMay 16, 2026
Conversation
…dition of namespace
Add an empty line after magic comments.
9e92a61 to
5376c6d
Compare
a7c4047 to
30ced9f
Compare
…tHub Actions workflows
30ced9f to
7c89dd7
Compare
…ep on GitHub Actions workflows" This reverts commit 7c89dd7.
…ypechecking Co-authored-by: Copilot <copilot@github.com>
Use expect(:id) instead.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Split into app/test targets so the test-DSL shim never relaxes application code; ignore the downloaded .gem_rbs_collection vendor dir. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Devise, ActionMailer::TestCase and the Devise test helpers have no RBS in the gem collection. Force-tracked because e-navigator/sig is otherwise git-ignored as generated output. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Why (Purpose)
Rails applications are dynamically typed, so regressions in controllers, models, mailers, jobs and forms are only caught at runtime or by tests.
Adding
rbs-inline(signatures derived from annotated source) together withSteep(the type checker) introduces static verification of method existence, arguments and return types across the codebase.A key motivation is that an apparently small error count is usually misleading.
When the Rails framework signatures are absent, Steep degrades whole class hierarchies to
untypedand silently suppresses everything that depends on them.The objective is therefore not "make the reported errors disappear" but stand up a complete, reproducible type-checking pipeline so the check is genuinely green — framework types resolved, application code annotated, and the real type defects that surface afterwards actually fixed.
2. What (Procedures)
Introducing the pipeline follows a fixed sequence:
steep,rbs-inlineandrbs_railsto the development/test bundle.rbs_collection.yaml+ lock) so framework and common-gem signatures are pulled from a shared, version-pinned source.rbs_railsrake task to emit model and route-helper signatures, and runrbs-inlineto emit signatures from annotated application and test code.Steepfilewith separate targets for application and test code, so permissive test-only signatures never weaken the strictly-checked application code.Context-specific note: when the app runs only in containers, every step above is executed inside the container; when model signatures are generated for apps with a database, the database service must be up and prepared first.
3. How (Operation and Maintenance)
3-1. Run the check
Through the project's normal execution environment(locally or inside the container), invoking
steep check.3-2. Regenerate signatures
As a build step — install the RBS collection, run
rbs-inlineover the source, and run therbs_railstask for models and routes. This is mandatory on a fresh checkout whenever generated signatures are treated as build output rather than committed.3-3. Track vs. regenerate
Steepfile, the collection manifest and lock, the rake task registration, and all hand-written shims (force-track them if they live under an otherwise-ignored signature directory).3-4. Maintenance triggers
rbs_railstask.rbs-inline.4. Pros & Cons
4-2. Pros
4-2. Cons