Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6a5358f
Install typechecking ecosystem via Gemfile and Bundler
hayat01sh1da Apr 11, 2026
96f1e21
Commit Steepfile to define target of typechecking
hayat01sh1da Apr 11, 2026
3b9b637
Introduce rbs-inline to existing Ruby files
hayat01sh1da Apr 11, 2026
43674b7
Generate corresponding signature files
hayat01sh1da Apr 11, 2026
5790021
Add workflows to GHA configuration for typechecking
hayat01sh1da Apr 11, 2026
14d83d6
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 14, 2026
5d92f74
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 22, 2026
41de455
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 22, 2026
182eb00
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 22, 2026
2f972e8
Move typechecking Gems to development group on Gemfile
hayat01sh1da Apr 23, 2026
f0cb92e
Reflect new Ruby version on Gemfile.lock
hayat01sh1da Apr 23, 2026
f89f0e5
Resolve RBS::EnvironmentLoader::UnknownLibraryError
hayat01sh1da Apr 23, 2026
b33ef9a
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 23, 2026
a638172
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 25, 2026
5f043e4
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 26, 2026
1ec421b
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 28, 2026
0806385
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da Apr 28, 2026
0864500
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da May 2, 2026
4e6153c
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da May 2, 2026
1991a08
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da May 4, 2026
9743f29
Merge branch 'master' into hayat01sh1da/restful-api/introduce-steep-t…
hayat01sh1da May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.

name: RESTful API
name: Ruby on Rails - RESTful API

on:
push:
Expand All @@ -21,9 +21,9 @@ on:
- ruby-on-rails/restful-api/Rakefile
- ruby-on-rails/restful-api/.rubocop.yml
- ruby-on-rails/restful-api/.rubocop_todo.yml
# - ruby-on-rails/restful-api/Steepfile
- ruby-on-rails/restful-api/Steepfile
- ruby-on-rails/restful-api/**/*.rb
# - ruby-on-rails/restful-api/**/*.rbs
- ruby-on-rails/restful-api/**/*.rbs
- ruby-on-rails/restful-api/**/*.rake
- ruby-on-rails/restful-api/**/*.yml
pull_request:
Expand All @@ -37,9 +37,9 @@ on:
- ruby-on-rails/restful-api/Rakefile
- ruby-on-rails/restful-api/.rubocop.yml
- ruby-on-rails/restful-api/.rubocop_todo.yml
# - ruby-on-rails/restful-api/Steepfile
- ruby-on-rails/restful-api/Steepfile
- ruby-on-rails/restful-api/**/*.rb
# - ruby-on-rails/restful-api/**/*.rbs
- ruby-on-rails/restful-api/**/*.rbs
- ruby-on-rails/restful-api/**/*.rake
- ruby-on-rails/restful-api/**/*.yml

Expand All @@ -53,7 +53,7 @@ jobs:
outputs:
ruby-changes: ${{ steps.change-detection.outputs.ruby }}
rubocop-changes: ${{ steps.change-detection.outputs.rubocop}}
# steep-changes: ${{ steps.change-detection.outputs.steep}}
steep-changes: ${{ steps.change-detection.outputs.steep}}
steps:
- uses: actions/checkout@v6
- name: Change Detection
Expand Down Expand Up @@ -148,19 +148,19 @@ jobs:
- name: RuboCop
working-directory: ./ruby-on-rails/restful-api
run: bundle exec rubocop
# steep:
# timeout-minutes: 10
# runs-on: ubuntu-latest
# needs: change-detection
# if: needs.change-detection.outputs.steep-changes == 'true'
# steps:
# - uses: actions/checkout@v6
# - uses: ./.github/actions/setup-ruby-on-rails
# with:
# working-directory: ./ruby-on-rails/restful-api
# job-name: steep
# - name: Steep
# working-directory: ./ruby-on-rails/restful-api
# run: |
# bundle exec rbs-inline --output sig/generated/ .
# bundle exec steep check
steep:
timeout-minutes: 10
runs-on: ubuntu-latest
needs: change-detection
if: needs.change-detection.outputs.steep-changes == 'true'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-ruby-on-rails
with:
working-directory: ./ruby-on-rails/restful-api
job-name: steep
- name: Steep
working-directory: ./ruby-on-rails/restful-api
run: |
bundle exec rbs-inline --output sig/generated/ .
bundle exec steep check
8 changes: 3 additions & 5 deletions ruby-on-rails/restful-api/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ gem 'will_paginate', '~> 4.0.1'
# environmental variables
gem 'dotenv-rails', '~> 3.2.0'

gem 'nokogiri', '~> 1.19.3'

gem 'net-smtp', '~> 0.5.0'

# The Observer pattern provides a simple mechanism for one object to inform a set of interested third-party objects when its state changes.
Expand All @@ -43,9 +41,6 @@ gem 'observer', '~> 0.1.2'
# Data structure, similar to a Hash, that allows the definition of arbitrary attributes with their accompanying values
gem 'ostruct', '~> 0.6.3'

# A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written or compiled in another one
gem 'ffi', '~> 1.17.4'

group :development, :test do
# Debug tool used with binding.irb. Explicit require avoids eager loading `debug/prelude`
# which interferes with the Docker boot process.
Expand All @@ -62,6 +57,9 @@ group :development do
gem 'rubocop-performance', '~> 1.26.0', require: false
gem 'rubocop-rails', '~> 2.34.3', require: false
gem 'rubocop-rspec', '~> 3.9.0', require: false
# Typechecking
gem 'rbs-inline', '~> 0.13.0', require: false
gem 'steep', '~> 1.10.0', require: false
end

group :test do
Expand Down
53 changes: 49 additions & 4 deletions ruby-on-rails/restful-api/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ GEM
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
crass (1.0.6)
csv (3.3.5)
database_cleaner (2.1.0)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.2.2)
Expand All @@ -119,8 +120,8 @@ GEM
railties (>= 6.1.0)
faker (3.8.0)
i18n (>= 1.8.11, < 2)
ffi (1.17.4)
ffi (1.17.4-x86_64-linux-gnu)
fileutils (1.8.0)
globalid (1.3.0)
activesupport (>= 6.1)
i18n (1.14.8)
Expand All @@ -137,6 +138,10 @@ GEM
base64
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
listen (3.10.0)
logger
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
loofah (2.25.1)
crass (~> 1.0.2)
Expand All @@ -153,6 +158,7 @@ GEM
drb (~> 2.0)
prism (~> 1.5)
msgpack (1.8.0)
mutex_m (0.3.0)
mysql2 (0.5.7)
bigdecimal
net-imap (0.6.4)
Expand Down Expand Up @@ -223,6 +229,15 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.4.2)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbs (3.10.4)
logger
tsort
rbs-inline (0.13.0)
prism (>= 0.29)
rbs (>= 3.8.0)
rdoc (7.2.0)
erb
psych (>= 4.0.0)
Expand Down Expand Up @@ -278,7 +293,27 @@ GEM
securerandom (0.4.1)
shoulda-matchers (7.0.1)
activesupport (>= 7.1)
steep (1.10.0)
activesupport (>= 5.1)
concurrent-ruby (>= 1.1.10)
csv (>= 3.0.9)
fileutils (>= 1.1.0)
json (>= 2.1.0)
language_server-protocol (>= 3.17.0.4, < 4.0)
listen (~> 3.0)
logger (>= 1.3.0)
mutex_m (>= 0.3.0)
parser (>= 3.1)
rainbow (>= 2.2.2, < 4.0)
rbs (~> 3.9)
securerandom (>= 0.1)
strscan (>= 1.0.0)
terminal-table (>= 2, < 5)
uri (>= 0.12.0)
stringio (3.2.0)
strscan (3.1.8)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
thor (1.5.0)
timeout (0.6.1)
tsort (0.2.0)
Expand Down Expand Up @@ -309,21 +344,21 @@ DEPENDENCIES
dotenv-rails (~> 3.2.0)
factory_bot_rails (~> 6.5.1)
faker (~> 3.8.0)
ffi (~> 1.17.4)
jwt (~> 3.1.2)
mysql2 (~> 0.5.7)
net-smtp (~> 0.5.0)
nokogiri (~> 1.19.3)
observer (~> 0.1.2)
ostruct (~> 0.6.3)
puma (~> 8.0.1)
rails (~> 8.1.3)
rbs-inline (~> 0.13.0)
rspec-rails (~> 8.0.4)
rubocop (~> 1.86.1)
rubocop-performance (~> 1.26.0)
rubocop-rails (~> 2.34.3)
rubocop-rspec (~> 3.9.0)
shoulda-matchers (~> 7.0.1)
steep (~> 1.10.0)
tzinfo-data
will_paginate (~> 4.0.1)

Expand Down Expand Up @@ -353,6 +388,7 @@ CHECKSUMS
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
crass (1.0.6) sha256=dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d
csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f
database_cleaner (2.1.0) sha256=1dcba26e3b1576da692fc6bac10136a4744da5bcc293d248aae19640c65d89cd
database_cleaner-active_record (2.2.2) sha256=88296b9f3088c31f7c0d4fcec10f68e4b71c96698043916de59b04debec10388
database_cleaner-core (2.0.1) sha256=8646574c32162e59ed7b5258a97a208d3c44551b854e510994f24683865d846c
Expand All @@ -367,8 +403,8 @@ CHECKSUMS
factory_bot (6.5.6) sha256=12beb373214dccc086a7a63763d6718c49769d5606f0501e0a4442676917e077
factory_bot_rails (6.5.1) sha256=d3cc4851eae4dea8a665ec4a4516895045e710554d2b5ac9e68b94d351bc6d68
faker (3.8.0) sha256=c147b308df73a90f27a4fc84f18d4c22ef0ad9c2a64b2b61c86fd0ca71753efc
ffi (1.17.4) sha256=bcd1642e06f0d16fc9e09ac6d49c3a7298b9789bcb58127302f934e437d60acf
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
fileutils (1.8.0) sha256=8c6b1df54e2540bdb2f39258f08af78853aa70bad52b4d394bbc6424593c6e02
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
Expand All @@ -378,13 +414,15 @@ CHECKSUMS
jwt (3.1.2) sha256=af6991f19a6bb4060d618d9add7a66f0eeb005ac0bc017cd01f63b42e122d535
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
listen (3.10.0) sha256=c6e182db62143aeccc2e1960033bebe7445309c7272061979bb098d03760c9d2
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
loofah (2.25.1) sha256=d436c73dbd0c1147b16c4a41db097942d217303e1f7728704b37e4df9f6d2e04
mail (2.9.0) sha256=6fa6673ecd71c60c2d996260f9ee3dd387d4673b8169b502134659ece6d34941
marcel (1.1.0) sha256=fdcfcfa33cc52e93c4308d40e4090a5d4ea279e160a7f6af988260fa970e0bee
mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
msgpack (1.8.0) sha256=e64ce0212000d016809f5048b48eb3a65ffb169db22238fb4b72472fecb2d732
mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751
mysql2 (0.5.7) sha256=ba09ede515a0ae8a7192040a1b778c0fb0f025fa5877e9be895cd325fa5e9d7b
net-imap (0.6.4) sha256=9a5598c67a3022c284d98430ef1d4948e7dbdb62596f61081ea8ca933270a02b
net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3
Expand Down Expand Up @@ -412,6 +450,10 @@ CHECKSUMS
railties (8.1.3) sha256=913eb0e0cb520aac687ffd74916bd726d48fa21f47833c6292576ef6a286de22
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe
rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e
rbs (3.10.4) sha256=b17d7c4be4bb31a11a3b529830f0aa206a807ca42f2e7921a3027dfc6b7e5ce8
rbs-inline (0.13.0) sha256=aba6e48c2d1b75276e8557376164f4b4ba96dd0204e779a5cee2af442bd30442
rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
Expand All @@ -428,7 +470,10 @@ CHECKSUMS
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
shoulda-matchers (7.0.1) sha256=b4bfd8744c10e0a36c8ac1a687f921ee7e25ed529e50488d61b79a8688749c77
steep (1.10.0) sha256=1b295b55f9aaff1b8d3ee42453ee55bc2a1078fda0268f288edb2dc014f4d7d1
stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
strscan (3.1.8) sha256=aae2db611a225559f21ffbb71765c9a4e60fd262534a9ea84f4f11c7f32f679e
terminal-table (4.0.0) sha256=f504793203f8251b2ea7c7068333053f0beeea26093ec9962e62ea79f94301d2
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
Expand Down
11 changes: 11 additions & 0 deletions ruby-on-rails/restful-api/Steepfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
D = Steep::Diagnostic

target :app do
check "app"
check "spec"
signature "sig"

library "net-smtp"

configure_code_diagnostics(D::Ruby.default)
end
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/auth/authenticate_user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class AuthenticateUser
def initialize(email, password)
@email = email
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class AuthorizeApiRequest
def initialize(headers = {})
@headers = headers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class ApplicationController < ActionController::API
include Response
include ExceptionHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class AuthenticationController < ApplicationController
skip_before_action :authorize_request, only: :authenticate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
module ExceptionHandler
extend ActiveSupport::Concern

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
module Response
def json_response(object, status = :ok)
render json: object, status: status
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class UsersController < ApplicationController
skip_before_action :authorize_request, only: :create

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class V1::ItemsController < ApplicationController
before_action :set_todo
before_action :set_todo_item, only: %i(show update destroy)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class V1::TodosController < ApplicationController
before_action :set_todo, only: %i(show update destroy)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class V2::TodosController < ApplicationController
def index
# a dummy response
Expand Down
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
Expand Down
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/lib/api_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class ApiVersion
attr_reader :version, :default

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
module ExceptionHandler
extend ActiveSupport::Concern

Expand Down
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/lib/json_web_token.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class JsonWebToken
# secret to encode and decode token
HMAC_SECRET = Rails.application.credentials.secret_key_base
Expand Down
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/lib/message.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class Message
def self.not_found(record = 'record')
"Sorry, #{record} not found."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
Expand Down
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/models/item.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class Item < ApplicationRecord
belongs_to :todo

Expand Down
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/models/todo.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class Todo < ApplicationRecord
has_many :items, dependent: :destroy
belongs_to :user
Expand Down
1 change: 1 addition & 0 deletions ruby-on-rails/restful-api/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class User < ApplicationRecord
# encrypt password
has_secure_password
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rbs_inline: enabled
class TodoSerializer < ActiveModel::Serializer
# attributes to be serialized
attributes :id, :title, :user_id, :created_at, :updated_at
Expand Down
Loading
Loading