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
Just a Rails Patch Update
Search
hatsu
September 12, 2024
Programming
2
520
Just a Rails Patch Update
hatsu
September 12, 2024
Tweet
Share
More Decks by hatsu
See All by hatsu
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
24
14k
Dive into MaintenanceTasks
hatsu38
1
100
GitHub Actions is Fun
hatsu38
1
120
Other Decks in Programming
See All in Programming
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
310
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
Security_for_introducing_eBPF
kentatada
0
110
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
良いユニットテストを書こう
mototakatsu
5
2k
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Visualization
eitanlees
146
15k
Scaling GitHub
holman
458
140k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
What's in a price? How to price your products and services
michaelherold
243
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Unsuck your backbone
ammeep
669
57k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Transcript
RailsͷpatchύʔδϣϯΛ ্͚͛ͨͩͳͷʹ🤕 Roppongi.rb #22 @hatsu_38 2024/09/12
RailsͷύονόʔδϣϯΛ͋͛ͨͱ͖ʹ ى͖ͨΤϥʔʹ͍ͭͯͷݴ͍༁ղઆͰ͢💬
ࣗݾհ • Rubyྺ 5 = ΤϯδχΞྺ • SHE Inc. •
React.js / TypeScript / GitHub Actions • Ruby͕Ұ൪͖
ٕज़ελοΫ • Backend: Ruby, Ruby on Rails, GraphQL, Sidekiq •
Frontend: React.js, TypeScript, Next.js • CI: GitHub Actions • Infrastructure: Kubernetes
ฐࣾͰͷϦϦʔεϑϩʔ(ͬ͘͟Γ) 1. Pull RequestΛग़͢ `gh pr create -t “bundle update
rails —patch” ` 2. ApproveΒ͏ `gh pr review 9999 —approve` 3. MasterʹϚʔδ `gh pr merge 9999 -m -d` 4. εςʔδϯά ϦϦʔε `gh pr create -t “release 2024-09-05” -H master -B release` 5. εςʔδϯά֬ೝ 6. ຊ൪ϦϦʔε `gh pr merge 10000 -m -d`
202408݄09ʹ Rails 7.2.0͕ϦϦʔε͞Ε·ͨ͠🎉
202408݄22ʹ Rails 7.2.1, 7.1.4ͷύονόʔδϣϯ ͕ϦϦʔε͞Ε·ͨ͠🎉
RailsͷύονόʔδϣϯΛߋ৽(2024.09.03) 📝 gem data_migrate 9.4.2(࣌࠷৽)Λར༻
εςʔδϯά֬ೝ (2024.09.05) ɾgemͷupdateҎ֎ʹϓϧϦΫΤετ͕͋Δ ɾDBͷmigrationগ͋͠Δ ɾಈ࡞֬ೝͳ͠👌 📝 2024.09.04 gem data_migrate 11.0.0͕ϦϦʔε͞Ε͍ͯͨ
ຊ൪ϦϦʔε🚀 (2024.09.05)
ϦϦʔεྃ🌈 (2024.09.05)
Τϥʔݕ💥 (2024.09.05)
͑ʁʁʁ💫
ௐࠪ🔍
migration͞Ε͍ͯͳ͍!?🤔
• ΄ͱΜͲͷςʔϒϧͰ·ͩNJHSBUJPOʹ͔͔࣌ؒΔͱ͔ͳ͍ • data_migrateͱ͍͏gemΛར༻͍ͯ͠Δ • data_migrateͷbundle exec rails db:migrate:with_dataίϚϯυΛར༻ •
Rails7.1.4ʹόʔδϣϯΞοϓ࣌(2024.09.03)Ͱ࠷৽ͷ data_migrate 9.4.2Λར༻͍ͯͨ͠ • 2024.09.04ʹEBUB_migrate 11.0.0όʔδϣϯ͕ग़͍ͯͨ ฐࣾͷmigrationࣄ
• ΄ͱΜͲͷςʔϒϧͰ·ͩNJHSBUJPOʹ͔͔࣌ؒΔͱ͔ͳ͍ • data_migrateͱ͍͏gemΛར༻͍ͯ͠Δ • data_migrateͷbundle exec rails db:migrate:with_dataίϚϯυΛར༻ •
Rails7.1.4ʹόʔδϣϯΞοϓ࣌(2024.09.03)Ͱ࠷৽ͷ data_migrate 9.4.2Λར༻͍ͯͨ͠ • 2024.09.04ʹEBUB_migrate 11.0.0όʔδϣϯ͕ग़͍ͯͨ ฐࣾͷmigrationࣄ 3BJMTºEBUB@NJHSBUF PS 3BJMTºEBUB@NJHSBUF ͰNJHSBUJPO͕ಈ͔ͳ͍ͱൃ֮😵 ᠘͗͢Δ…
• ΄ͱΜͲͷςʔϒϧͰ·ͩNJHSBUJPOʹ͔͔࣌ؒΔͱ͔ͳ͍ • data_migrateͱ͍͏gemΛར༻͍ͯ͠Δ • data_migrateͷbundle exec rails db:migrate:with_dataίϚϯυΛར༻ •
Rails7.1.4ʹόʔδϣϯΞοϓ࣌(2024.09.03)Ͱ࠷৽ͷ data_migrate 9.4.2Λར༻͍ͯͨ͠ • 2024.09.04ʹEBUB_migrate 11.0.0όʔδϣϯ͕ग़͍ͯͨ ฐࣾͷmigrationࣄ 3BJMTºEBUB@NJHSBUF PS 3BJMTºEBUB@NJHSBUF ͰNJHSBUJPO͕ಈ͔ͳ͍ͱൃ֮😵 εςʔδϯάͰɺDBͷmigration͕ྃޙʹɺRails7.1.4ʹόʔδϣϯΞοϓ͞Εͨ →͏·͍λΠϛϯάͰɺൃ֮͠ͳ͔ͬͨ💡 ᠘͗͢Δ…
ৄ͘͠ݟͯΈΔ🔬
ϩʔΧϧͰ࠶ݱͯ͠ΈΔ (Rails 7.1.4 × data_migrate 9.4.2) bundle exec rails db:migrate:with_data
bundle exec rails db:migrate →migrate͕ಈ͍ͯͳ͍ →migrate͕ಈ͍͍ͯΔ
Rails 7.1.4Ͱͷมߋ͕data_migrateʹӨڹ͍ͯͨ͠ 3BJMT ˠNJHSBUF͞Ε͍ͯͳ͍όʔδϣϯͷใ͕ฦΔ 3BJMT ˠNJHSBUF͞Ε͍ͯͳ͍όʔδϣϯͷใ͕ฦΒͳ͍
Rails 7.1.4Ͱͷมߋ͕data_migrateʹӨڹ͍ͯͨ͠ 3BJMT ˠNJHSBUF͞Ε͍ͯͳ͍όʔδϣϯͷใ͕ฦΔ 3BJMT ˠNJHSBUF͞Ε͍ͯͳ͍όʔδϣϯͷใ͕ฦΒͳ͍ NJHSBUF͞Ε͍ͯͳ͍όʔδϣϯͷใ͕ฦΒͳ͍ ˠͯ͢NJHSBUJPOࡁΈʜͱͳ͍ͬͯͨ🫠
Rails 7.1.4ͰͷมߋՕॴ ActiveRecord::Tasks::DatabaseTasks.db_con fi gs_with_versions Rails 7.1.3 Rails 7.1.4 →ҾDBͷcon
fi gใ →ҾDBͷڥ໊
Rails 7.1.4ͰͷมߋՕॴ ActiveRecord::Tasks::DatabaseTasks.db_con fi gs_with_versions Rails 7.1.3 Rails 7.1.4 →Ҿdbͷcon
fi gใ →Ҿdbͷڥ໊ 3BJMTºEBUB@NJHSBUFͰ%#ͷDPO fi HใΛ͍ͯͨ͠ ˠ֘ͷڥͷNJHSBUJPOใ͕ͳ͍ ˠNJHSBUF͞Ε͍ͯͳ͍όʔδϣϯͷใ͕ฦΒͳ͍ ˠNJHSBUF͞Εͳ͍
Rails 7.1.4 × data_migrate 11.0.0 ͷར༻ͰͱΓ͋͑ͣղܾ👋 (Rails 7.1.3 × data_migrate
11.0.0ಈ͔ͳ͍)
Patchόʔδϣϯͷߋ৽Ͱ ͘Ε͙Ε͝ҙ͍ͩ͘͞👾