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
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
470
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
ドメインイベント増えすぎ問題
h0r15h0
2
300
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
testcontainers のススメ
sgash708
1
120
php-conference-japan-2024
tasuku43
0
280
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
103 Early Hints
sugi_0000
1
230
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Gamification - CAS2011
davidbonilla
80
5.1k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
RailsConf 2023
tenderlove
29
940
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Mobile First: as difficult as doing things right
swwweet
222
9k
GraphQLとの向き合い方2022年版
quramy
44
13k
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όʔδϣϯͷߋ৽Ͱ ͘Ε͙Ε͝ҙ͍ͩ͘͞👾