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
480
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
13k
Dive into MaintenanceTasks
hatsu38
1
92
GitHub Actions is Fun
hatsu38
1
110
Other Decks in Programming
See All in Programming
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Jakarta EE meets AI
ivargrimstad
0
610
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
Contemporary Test Cases
maaretp
0
140
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
100
Realtime API 入門
riofujimon
0
150
Quine, Polyglot, 良いコード
qnighy
4
640
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Featured
See All Featured
A better future with KSS
kneath
238
17k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Automating Front-end Workflow
addyosmani
1366
200k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Practical Orchestrator
shlominoach
186
10k
Designing the Hi-DPI Web
ddemaree
280
34k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Optimizing for Happiness
mojombo
376
70k
A designer walks into a library…
pauljervisheath
203
24k
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όʔδϣϯͷߋ৽Ͱ ͘Ε͙Ε͝ҙ͍ͩ͘͞👾