Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
初めてrails/railsにバグレポートを出してみた
Search
Shintani Teppei
October 17, 2023
Technology
0
220
初めてrails/railsにバグレポートを出してみた
初めてrails/rails にバグレポートを出したのでその流れをまとめました。
https://github.com/rails/rails/issues/49457
Shintani Teppei
October 17, 2023
Tweet
Share
More Decks by Shintani Teppei
See All by Shintani Teppei
3年でバックエンドエンジニアが5倍に増えても破綻しなかったアーキテクチャ そして、これから / Software architecture that scales even with a 5x increase in backend engineers in 3 years
euglena1215
11
4.1k
モジュラモノリス、その前に / Modular monolith, before that
euglena1215
8
900
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
170
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
550
Ruby の型に関する活動をやっている話 / Activities related to Ruby types
euglena1215
3
290
そろそろ理解する includes / Understanding includes
euglena1215
1
860
習うより慣れる Ruby AST / Ruby AST is better to get used to than to learn.
euglena1215
2
460
Railsでエンドポイントごとのテストカバレッジを測定する / Measuring Test Coverage per Endpoint in Rails
euglena1215
1
440
XXXSerializer#to_json を地道に置き換えている話
euglena1215
0
150
Other Decks in Technology
See All in Technology
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
530
Server-Side Engineer of LINE Sukimani
lycorp_recruit_jp
1
450
C++26 エラー性動作
faithandbrave
2
850
型情報を用いたLintでコード品質を向上させる
sansantech
PRO
2
170
AI×医用画像の現状と可能性_2024年版/AI×medical_imaging_in_japan_2024
tdys13
0
530
Fearsome File Formats
ange
0
430
pg_bigmをRustで実装する(第50回PostgreSQLアンカンファレンス@オンライン 発表資料)
shinyakato_
0
130
2024年にチャレンジしたことを振り返るぞ
mitchan
0
160
20241218_今年はSLI/SLOの導入を頑張ってました!
zepprix
0
220
ISUCON、今年も参加してみた / ISUCON, I challenged it again this year.
dero1to
0
110
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
3
1.6k
ネットワーク可視化の世界
likr
7
5.4k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Music & Morning Musume
bryan
46
6.2k
Building Your Own Lightsaber
phodgson
103
6.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Optimizing for Happiness
mojombo
376
70k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
310
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
190
Fireside Chat
paigeccino
34
3.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
830
Transcript
גࣜձࣾλΠϛʔɹShintani Teppei ॳΊͯrails/railsʹ όάϨϙʔτΛग़ͯ͠Έͨ @euglena1215 Reject on Rails2023 @Gotanda
ࣗݾհ ৽୩ ฏʢ@euglena1215ʣ • גࣜձࣾλΠϛʔ • όοΫΤϯυΤϯδχΞ • ϦδΣΫτ͞Εͨϓϩϙʔβϧ ◦
࠶ݱੑ͋Δ Rails ΞοϓάϨʔυͷಓ • εΠΧήʔϜ ϋΠείΞɿ3099 εΠΧΛ2ݸ࡞Δํ๏ͬͯΔํ͍ͨΒ #rejectonrailsΛ͚ͭͯڭ͍͑ͯͩ͘͞
3
એ λΠϛʔ Kaigi on Rails ΛԠԉ͍ͯ͠·͢ 🥈🥈🥈
גࣜձࣾλΠϛʔɹShintani Teppei ॳΊͯrails/railsʹ όάϨϙʔτΛग़ͯ͠Έͨ @euglena1215 Reject on Rails2023 @Gotanda
ൃදͷഎܠ • Rails͕ݪҼͬΆ͍όάʹૺ۰ͯ͠ॳΊͯrails/railsʹόάϨϙʔτΛग़ͨ͠ɻ • ͲΜͳྲྀΕͰૺ۰͠ɺௐࠪͯ͠όάϨϙʔτΛग़ͨ͠ͷ͔Λ ڞ༗͢Δ͜ͱͰrails/railsʹόάϨϙʔτΛग़͢͜ͱͷ ৺ཧతϋʔυϧΛԼ͍͛ͨɻ • rails/railsόάϨϙʔτΛग़ͨ͜͠ͱ͕ͳ͍ਓ͚ͷൃදͰ͢ɻ
ൃදΛฉ͘લ rails/railsͷόάϨϙʔτ ؤுͬͯग़͢ͷͦ͠͏...
ൃදΛฉ͍ͨޙ rails/railsͷόάϨϙʔτ ؤுͬͨΒग़ͤͦ͏ʂ
࣍ 1. όάͱͷૺ۰ 2. ࠷খͷ࠶ݱํ๏ͷཱ֬ 3. όάϨϙʔτΛग़͢
1 όάͱͷૺ۰
όάͱͷૺ۰ ʲલఏʳλΠϛʔͰRailsͷmain branch ΛͬͨςετΛCIͰ࣮ߦ ͍ͯ͠·͢ɻ ઃఆํ๏ʮrails edgeʯͰݕࡧ 🔍
όάͱͷૺ۰ Rails 7.1.0.rc1 ͕ϦϦʔε͞ΕΔલCI͕௨͍ͬͯͨͷͷɺϦϦʔε͞Ε͔ͯ Βશͯͷςετ͕ࣦഊ͢ΔΑ͏ʹɻ ͓ʁͱࢥ͍ௐࠪΛ։࢝ɻ
όάͷௐࠪ ελοΫτϨʔεΛோΊ͍ͯΔͱActiveAdminͷϖʔδΛཧ͢ΔσΟϨΫτϦͷ app/admin/* ͰΤϥʔʹͳ͍ͬͯΔ͜ͱ͕͔ͬͨɻ ActiveAdmin ϧʔςΟϯάΛࣗಈੜ͢ΔͨΊʹ app/admin/* ΛಡΈࠐΈ࣌ʹධՁ ͍ͯ͠ΔɻධՁ࣌ʹಛఆϞσϧΛಡΈࠐΜͩλΠϛϯάͰΤϥʔʹͳ͍ͬͯΔ͜ͱ͕
໌ɻ
όάͷௐࠪ ελοΫτϨʔεΛோΊ͍ͯΔͱ app/admin/* (ActiveAdminͷϖʔδ Λཧ͢ΔσΟϨΫτϦ) ͰΤϥʔʹͳ͍ͬͯΔ͜ͱ͕͔ͬͨɻ ActiveAdmin ϧʔςΟϯάΛࣗಈੜ͢ΔͨΊʹ app/admin/* Λಡ
ΈࠐΈ࣌ʹධՁ͍ͯ͠ΔɻධՁ࣌ʹಛఆΛϞσϧΛಡΈࠐΜͩλΠϛ ϯάͰΤϥʔʹͳ͍ͬͯΔ͜ͱ͕໌ɻ ActiveRecordͷvalidateϝιουʹpresenceΦϓγϣϯΛͯ͠Δͱ ղऍ͞Εͯͦ͏🤔 ͦΜͳ࣮Ͳ͜ʹͳ͍ͣ...ʁ
2 ࠷খͷ࠶ݱํ๏ͷཱ֬
1. ActiveAdminͱΓ͢ ݱঢ়ಡΈࠐΈ࣌ʹࣦഊ͢ΔͷͰ rails c ىಈ͠ͳ͍ঢ়ଶɻ ActiveAdmin ͕ѱ͍ͷ͔ɺActiveAdmin ಡΈࠐΜͰΔ͚ͩͰͦͷଞ͕ ѱ͍ͷ͔۠ผͰ͖ͳ͔ͬͨͷͰΓ͢ํ๏Λߟ͑ͨɻ
1. ActiveAdminͱΓ͢ ݱঢ়ಡΈࠐΈ࣌ʹࣦഊ͢ΔͷͰ rails c ىಈ͠ͳ͍ঢ়ଶɻ ActiveAdmin ͕ѱ͍ͷ͔ɺActiveAdmin ಡΈࠐΜͰΔ͚ͩͰͦͷଞ͕ ѱ͍ͷ͔۠ผͰ͖ͳ͔ͬͨͷͰΓ͢ํ๏Λߟ͑ͨɻ
ରॲɿapp/admin/* Λશ෦আ͢Δ ✂
1. ActiveAdminͱΓ͢ ݱঢ়ಡΈࠐΈ࣌ʹࣦഊ͢ΔͷͰ rails c ىಈ͠ͳ͍ঢ়ଶɻ ActiveAdmin ͕ѱ͍ͷ͔ɺActiveAdmin ಡΈࠐΜͰΔ͚ͩͰͦͷଞ͕ ѱ͍ͷ͔۠ผͰ͖ͳ͔ͬͨͷͰΓ͢ํ๏Λߟ͑ͨɻ
ରॲɿapp/admin/* Λશ෦আ͢Δ ✂ ݁Ռɿ ಡΈࠐΈ࣌ʹࣦഊ͢Δ͜ͱͳ͘ͳͬͯ rails c ىಈ͢ΔΑ͏ʹ 🎉
1. ActiveAdminͱΓ͢ rails c Ͱ֘ϞσϧΛධՁ͢Δ͜ͱͰΤϥʔΛىͤ͜ΔΑ͏ʹɻ ActiveAdminແ࣮ͩͬͨ͜ͱ͕͔ͬͨɻ
2. ͕ى͖͍ͯΔΫϥεΛখ͘͢͞Δ ͕ى͖͍ͯΔϞσϧͱ֘ߦಛఆͰ͖ͨͷͷɺ͕ى͖ͯ ͍ͨΫϥε࣮͕ଟ͘Կ͕ݪҼͳͷ͔அͰ͖ͣɻ
2. ͕ى͖͍ͯΔΫϥεΛখ͘͢͞Δ ͕ى͖͍ͯΔϞσϧͱ֘ߦಛఆͰ͖ͨͷͷɺ͕ى͖ͯ ͍ͨΫϥε࣮͕ଟ͘Կ͕ݪҼͳͷ͔அͰ͖ͣɻ ରॲɿ֘Ϟσϧͷ࣮Λย͔ͬΒআ͢Δ ✂
2. ͕ى͖͍ͯΔΫϥεΛখ͘͢͞Δ ͕ى͖͍ͯΔϞσϧͱ֘ߦಛఆͰ͖ͨͷͷɺ͕ى͖ͯ ͍ͨΫϥε࣮͕ଟ͘Կ͕ݪҼͳͷ͔அͰ͖ͣɻ ରॲɿ֘Ϟσϧͷ࣮Λย͔ͬΒআ͢Δ ✂ ݁Ռɿ ͕ى͖͍ͯͨߦΛғΉ with_options ϒϩοΫҎ֎શͯͷ࣮Λ
ফͯ͠࠶ݱͨ͠ͷͰ with_options ͕ո͍͜͠ͱ͕͔ͬͨ 🎉
2. ͕ى͖͍ͯΔΫϥεΛখ͘͢͞Δ ͕ى͖͍ͯΔϞσϧͱ֘ߦಛఆͰ͖ͨͷͷɺ͕ى͖ͯ ͍ͨΫϥε࣮͕ଟ͘Կ͕ݪҼͳͷ͔அͰ͖ͣɻ ରॲɿ֘Ϟσϧͷ࣮Λย͔ͬΒআ͢Δ ✂ ݁Ռɿ ͕ى͖͍ͯͨߦΛғΉ with_options Ҏ֎શͯͷ࣮Λফͯ͠࠶ݱͨ͠
ͷͰ with_options ͕ո͍͜͠ͱ͕͔ͬͨ 🎉
2. ͕ى͖͍ͯΔΫϥεΛখ͘͢͞Δ ͕ى͖͍ͯΔϞσϧͱ֘ߦಛఆͰ͖ͨͷͷɺ͕ى͖ͯ ͍ͨΫϥε࣮͕ଟ͘Կ͕ݪҼͳͷ͔அͰ͖ͣɻ ରॲɿ֘Ϟσϧͷ࣮Λย͔ͬΒআ͢Δ ✂ ݁Ռɿ ͕ى͖͍ͯͨߦΛғΉ with_options Ҏ֎શͯͷ࣮Λফͯ͠࠶ݱͨ͠
ͷͰ with_options ͕ո͍͜͠ͱ͕͔ͬͨ 🎉 ͖ͪΜͱ validates ϝιουʹ presence ΦϓγϣϯΛ͍ͯ͠Δͷʹ validate ϝιουʹͨ͜͠ͱʹͳ͍ͬͯΔɻԿ͕ى͖͍ͯΔΜͩ...
3. 1ϑΝΠϧͷ࠶ݱεΫϦϓτͰ࠶ݱ͢Δ͔Λ֬ೝ with_options ͷϒϩοΫҎ֎ͷϞσϧͷ࣮Λશͯআͯ͠ Τϥʔܧଓͯ͠ൃੜ͍ͯ͠Δɻ ͜Εͩͱશͯͷ Rails ΞϓϦέʔγϣϯͰൃੜ͢ΔՄೳੑ͋ΔͷͰ ʁͱࢥ͍ɺ࠷γϯϓϧͳܗͰ͕࠶ݱ͢Δ͔֬ೝ͢Δ͜ͱʹɻ
3. 1ϑΝΠϧͷ࠶ݱεΫϦϓτͰ࠶ݱ͢Δ͔Λ֬ೝ rails/railsʹActiveRecordͷόάΛใࠂ͢ΔͨΊʹ1ϑΝΠϧͰ ActiveRecordͷςετΛ࣮ߦ͢ΔςϯϓϨʔτ͕͋Δɻ https://github.com/rails/rails/blob/main/guides/bug_report_templates/ active_record_main.rb
None
1. Gemfile
2. DBεΩʔϚ
3. Ϟσϧ
4. ςετ
3. 1ϑΝΠϧͷ࠶ݱεΫϦϓτͰ࠶ݱ͢Δ͔Λ֬ೝ ରॲɿςϯϓϨʔτͷϞσϧͷఆٛʹ with_options ΛՃ͠ɺRails όʔδϣϯΛ 7.1.0.rc1 ʹࢦఆͯ͠Τϥʔ͕ൃੜ͢Δ͔Λ֬ೝɻ
with_options ΛՃ͢Δɿมߋલ
with_options ΛՃ͢Δɿมߋޙ
3. 1ϑΝΠϧͷ࠶ݱεΫϦϓτͰ࠶ݱ͢Δ͔Λ֬ೝ ରॲɿςϯϓϨʔτͷϞσϧͷఆٛʹ with_options ΛՃ͠ɺRails όʔδϣϯΛ 7.1.0.rc1 ʹࢦఆͯ͠Τϥʔ͕ൃੜ͢Δ͔Λ֬ೝɻ ݁ՌɿಡΈࠐΈ࣌ʹΤϥʔൃੜͤͣ 😢
3. 1ϑΝΠϧͷ࠶ݱεΫϦϓτͰ࠶ݱ͢Δ͔Λ֬ೝ ରॲɿςϯϓϨʔτͷϞσϧͷఆٛʹ with_options ΛՃ͠ɺRails όʔδϣϯΛ 7.1.0.rc1 ʹࢦఆͯ͠Τϥʔ͕ൃੜ͢Δ͔Λ֬ೝɻ ݁ՌɿಡΈࠐΈ࣌ʹΤϥʔൃੜͤͣ 😢
ଞʹԿ͔ݟམͱͯ͠ΔཁҼ͕͋Γͦ͏ 🤔
4. ݟམͱ͍ͯ͠ΔཁҼΛߟ͑Δ
4. ݟམͱ͍ͯ͠ΔཁҼΛߟ͑Δ Ұݟ͢ΔͱӨڹΛ༩͑ͯͳͦ͞͏͚ͩͲɺڍಈʹӨڹΛ༩͑ͦ͏ͳ ͷͬͯͳΜͩΖ͏ʁ
4. ݟམͱ͍ͯ͠ΔཁҼΛߟ͑Δ Ұݟ͢ΔͱӨڹΛ༩͑ͯͳͦ͞͏͚ͩͲɺڍಈʹӨڹΛ༩͑ͦ͏ͳ ͷͬͯͳΜͩΖ͏ʁ ܦݧ্ͦ͏͍ͬͨ͜ͱΛ͢Δͷ͍͍ͩͨGemɻ
4. ݟམͱ͍ͯ͠ΔཁҼΛߟ͑Δ Ұݟ͢ΔͱӨڹΛ༩͑ͯͳͦ͞͏͚ͩͲɺڍಈʹӨڹΛ༩͑ͦ͏ͳ ͷͬͯͳΜͩΖ͏ʁ ܦݧ্ͦ͏͍ͬͨ͜ͱΛ͢Δͷ͍͍ͩͨGemɻ ରॲɿGemfileʹએݴ͞Ε͍ͯΔGemΛย͔ͬΒফ͍ͯ͘͠ ✂
4. ݟམͱ͍ͯ͠ΔཁҼΛߟ͑Δ Ұݟ͢ΔͱӨڹΛ༩͑ͯͳͦ͞͏͚ͩͲɺڍಈʹӨڹΛ༩͑ͦ͏ͳ ͷͬͯͳΜͩΖ͏ʁ ܦݧ্ͦ͏͍ͬͨ͜ͱΛ͢Δͷ͍͍ͩͨGemɻ ରॲɿGemfileʹએݴ͞Ε͍ͯΔGemΛย͔ͬΒফ͍ͯ͘͠ ✂ ݁Ռɿ ͍Α͘ফ͍ͯ͠Δͱ͕࠶ݱ͠ͳ͘ͳΔλΠϛϯάʹૺ۰ 🎉🎉
4. ݟམͱ͍ͯ͠ΔཁҼΛߟ͑Δ Ұݟ͢ΔͱӨڹΛ༩͑ͯͳͦ͞͏͚ͩͲɺڍಈʹӨڹΛ༩͑ͦ͏ͳ ͷͬͯͳΜͩΖ͏ʁ ܦݧ্ͦ͏͍ͬͨ͜ͱΛ͢Δͷ͍͍ͩͨGemɻ ରॲɿGemfileʹએݴ͞Ε͍ͯΔGemΛย͔ͬΒফ͍ͯ͘͠ ✂ ݁Ռɿ ͍Α͘ফ͍ͯ͠Δͱ͕࠶ݱ͠ͳ͘ͳΔλΠϛϯάʹૺ۰ 🎉🎉
→ config gemΛফ͢ͱ͕࠶ݱ͠ͳ͘ͳΔ͜ͱ͕͔ͬͨ 💯
5. ࠶ݱεΫϦϓτͰ࠶ݱ͢Δ͔νΣοΫ͢Δ config gemͷ༗ແͰ͕ى͖Δ͜ͱ͕͔ͬͨͷͰ3.Ͱ༻ҙͨ͠࠶ ݱεΫϦϓτΛ͕ͬͯ࠶ݱ͢Δ͔ͷνΣοΫ͢Δɻ
config gemΛՃ͢Δɿมߋલ
config gemΛՃ͢Δɿมߋޙ
config gemΛՃ͢Δɿมߋޙ ແࣄΤϥʔ͕ൃੜ 💥 ࠷খͷ࠶ݱํ๏ͷཱ֬ʹޭʂ
3 όάϨϙʔτΛग़͢
όάϨϙʔτΛग़͢ config gemͷґଘʹΑΔͰ͋Δ͜ͱ͔ͬͨͷͷɺRailsͷ ͳͷ͔config gemͷͳͷ͔ͷΓ͚͕Ͱ͖ͳ͔ͬͨɻ ͳͷͰRailsʹৄ͍͠ਓʹฉ͚அͰ͖ΔͩΖ͏ͱࢥ͍ɺrails/rails ʹόάϨϙʔτΛग़͢͜ͱʹɻ
όάϨϙʔτΛग़͢ rails/railsͷόάϨϙʔτʹඞཁͳ߲ • ࠶ݱεΫϦϓτ • ظ͢Δڍಈ • ࣮ࡍͷڍಈ • Ruby/Railsͷόʔδϣϯ
όάϨϙʔτΛग़͢ rails/railsͷόάϨϙʔτʹඞཁͳ߲ • ࠶ݱεΫϦϓτ • ظ͢Δڍಈ • ࣮ࡍͷڍಈ • Ruby/Railsͷόʔδϣϯ
࠶ݱεΫϦϓτ͑͋͞Ε͋ͱ͙͢ʹຒΊΒΕΔɻ ӳޠͰڍಈΛ͑ͳ͍͍ͯ͘ͷ͕خ͍͠ϙΠϯτ 🤝
όάϨϙʔτΛग़͢ ग़ͯ͠Έͨ https://github.com/rails/rails/issues/49457
όάϨϙʔτͷԠ issueΛ࡞ޙ30΄ͲͰݪҼΛಛఆͨ͠ࢫͷίϝϯτΛΒ͍ config gemଆͷमਖ਼͕ඞཁͳ͜ͱ͕໌ɻ 4࣌ؒ΄ͲͰconfig gemʹमਖ਼Pull RequestΛ࡞ͯ͠Βͬͨ 🎉
όάϨϙʔτͷԠ ॾࣄʹΑΓमਖ਼Pull Request·ͩmerge͞Ε͍ͯͳ͍ͷͰɺ config gemΛRails 7.1Ͱಈ͔͍ͨ͠ํ࠙ձͰํΛ૬ஊͤͯ͘͞ ͍ͩ͞ 🙏
·ͱΊ 1. Rails EdgeͰͷςετΛCIͰ࣮ߦ͍ͯͨ͜͠ͱʹΑΓɺյΕ͍ͯ Δ͜ͱʹؾ͘ɻ 2. ৭ΜͳϑΝΠϧΛফ͠ͳ͕Β࠷খͰͷ࠶ݱํ๏Λཱ֬͠ɺݪҼͱ ͳΔGemΛಛఆɻ 3. όάϨϙʔτΛग़ͯ͠30ޙʹݪҼ͕ಛఆ͞Ε4࣌ؒޙʹमਖ਼
PR͕࡞ΒΕεϐʔυղܾ 🚀ʢະϚʔδʣ
͓ΘΓ rails/railsͷόάϨϙʔτ ؤுͬͨΒग़ͤͦ͏ʂ