Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails アプリケーションのアップデートは大変 / Upgrading Rails application is hard

Bbbf8523dd2997a04cef5b857f2e2445?s=47 hrysd
December 17, 2020
250

Rails アプリケーションのアップデートは大変 / Upgrading Rails application is hard

Pepabo Tech Conference #13

Bbbf8523dd2997a04cef5b857f2e2445?s=128

hrysd

December 17, 2020
Tweet

Transcript

  1. !ISZTE 3BJMTΞϓϦέʔγϣϯͷ Ξοϓσʔτ͸େม

  2. ೥ೖࣾ !ISZTE &$ࣄۀ෦αʔϏεج൫νʔϜ IUUQTISZTEPSH

  3. IUUQTISQFQBCPDPN JOUFSWJFX

  4. αʔϏεج൫νʔϜͬͯ

  5. ࠜݯతͰ͋Γɺղܾɾ࣮ݱํ๏͕Θ͔Βͳ͍ Α͏ͳٕज़՝୊ʹऔΓ૊Έɺ&$ࣄۀ෦ͷ࣍ ͷ೥ͷ੒௕Λࢧ͑Δɻ !LFODIBO

  6. جຊઓུ w%FWFMPQFS&YQFSJFODFͷ޲্ w࣍ͷ೥Λࢧ͑Δٕज़΁ͷ౤ࢿ

  7. جຊઓུ w%FWFMPQFS&YQFSJFODFͷ޲্ w࣍ͷ೥Λࢧ͑Δٕज़΁ͷ౤ࢿ "

  8. %FWFMPQFS&YQFSJFODFͷ޲্ʁ

  9. ࠷ۙ͸͜Μͳ͜ͱΛ͍ͯ͠·͢ wݴޠॲཧܥɺϑϨʔϜϫʔΫ౳ͷόʔδϣϯΞοϓ wΤϥʔ௨஌ͱ޲͖߹͏

  10. ࠷ۙ͸͜Μͳ͜ͱΛ͍ͯ͠·͢ wݴޠॲཧܥɺϑϨʔϜϫʔΫ౳ͷόʔδϣϯΞοϓ wΤϥʔ௨஌ͱ޲͖߹͏ ܧଓతʹߦ͏ͨΊͷ࢓૊Έͮ͘Γ #

  11. ͔͜͜Βຊ୊

  12. 3BJMTΞϓϦέʔγϣϯͷ Ξοϓσʔτ͸େม

  13. ͲΜͳΞϓϦέʔγϣϯʁ wϓϥΠϕʔτͳ8FC"1*Λ୲౰ wೖग़ྗ͸+40/ wෳ਺ͷΞϓϦέʔγϣϯ͔Βࢀর

  14. ͲΜͳঢ়گͳͷʁ $ bundle exec rake stats +----------------------+--------+--------+---------+---------+-----+-------+ | Name |

    Lines | LOC | Classes | Methods | M/C | LOC/M | +----------------------+--------+--------+---------+---------+-----+-------+ | Controllers | 7140 | 5771 | 126 | 494 | 3 | 9 | | Helpers | 104 | 86 | 0 | 14 | 0 | 4 | | Jobs | 777 | 633 | 31 | 46 | 1 | 11 | | Models | 25804 | 17165 | 386 | 1574 | 4 | 8 | | Mailers | 501 | 407 | 16 | 40 | 2 | 8 | | Javascripts | 479 | 375 | 0 | 53 | 0 | 5 | | Libraries | 4927 | 4084 | 177 | 453 | 2 | 7 | | Tasks | 164 | 143 | 0 | 0 | 0 | 0 | | Config specs | 56 | 48 | 0 | 0 | 0 | 0 | | Controller specs | 8095 | 6640 | 0 | 6 | 0 | 1104 | | Decorator specs | 434 | 351 | 0 | 0 | 0 | 0 | | Feature specs | 342 | 261 | 0 | 0 | 0 | 0 | | Job specs | 1807 | 1497 | 0 | 0 | 0 | 0 | | Lib specs | 6743 | 5685 | 0 | 0 | 0 | 0 | | Mailer specs | 2733 | 2181 | 0 | 0 | 0 | 0 | | Model specs | 48150 | 39211 | 0 | 4 | 0 | 9800 | | Request specs | 26140 | 22135 | 0 | 0 | 0 | 0 | | Serializer specs | 1278 | 752 | 0 | 0 | 0 | 0 | | Uploader specs | 155 | 130 | 0 | 0 | 0 | 0 | +----------------------+--------+--------+---------+---------+-----+-------+ | Total | 135829 | 107555 | 736 | 2684 | 3 | 38 | +----------------------+--------+--------+---------+---------+-----+-------+ Code LOC: 28664 Test LOC: 78891 Code to Test Ratio: 1:2.8 4JNQMF$PWͰͷܭଌ݁Ռ΋
  15. ؆୯ʹͰ͖ͦ͏ʂ

  16. None
  17. ΞϓϦέʔγϣϯͷ೉ॴ wෳ਺σʔλϕʔε wෳ߹ओΩʔ

  18. ΞϓϦέʔγϣϯͷ೉ॴ wෳ਺σʔλϕʔε wUIJBHPQSBEJPDUPQVT wෳ߹ओΩʔ wDPNQPTJUFQSJNBSZLFZTDPNQPTJUF@QSJNBSZ@LFZT

  19. ݸਓతͳؾ࣋ͪ w3BJMTΞϓϦέʔγϣϯ͸Ͳͷఔ౓͕ඪ४ػೳͰ࡞Β Ε͍ͯΔ͔͕೉қ౓ʹ௚݁ w֦ுతͳϥΠϒϥϦ͕࢖ΘΕ͍ͯΔͱͦΕ͚ͩ֬ೝൣ ғɺྔ͕γϯϓϧʹ૿͑Δҹ৅

  20. ҰํͰʜ wϥΠϒϥϦΛར༻͍ͯ͠Δͱ͍͏ͷ͸ɺࣗલͰ֦ு͠ ͍ͯΔͱ͍͏ύλʔϯͷ/ഒָ

  21. Ξοϓσʔτͯ͠ΈΑ͏ʂ

  22. UIJBHPQSBEJPDUPQVT w3BJMTܥͰෳ਺σʔλϕʔεʹରԠͨ͜͠ͱ΋͋ͬͯ ׆ಈ͕ԼՐʹ wࢀߟIUUQTHJUIVCDPNUIJBHPQSBEJPDUPQVT wٯʹ͍͏ͱ3BJMTʹ͢Ε͹ෆཁʹͳΔ w3FBE8SJUF4QMJUUJOHͱͯ͠࢖͓ͬͯΓɺ͜Ε͸ඪ ४ػೳͰ·͔ͳ͑Δ

  23. 'DPNQPTJUF@QSJNBSZ@LFZT w։ൃ͸ࠓ΋͞Ε͍ͯΔ w3BJMTͷόʔδϣϯ͝ͱʹରԠόʔδϣϯ͕ଘࡏ w೚ҙͷόʔδϣϯʹରԠͨ͠΋ͷΛ࢖͑͹ऴΘΓʂ

  24. ·͕͍ͪ

  25. Ξοϓσʔτͯ͠Έ͚ͨͲʜ wBMJBT@BUUSJCVUFΛղܾͰ͖ͳ͍ wΞοϓσʔτͷલޙͰൃߦ͞ΕΔΫΤϦʹҧ͍͕ग़Δ

  26. BMJBT@BUUSJCVUFͬͯʁ w೚ҙͷଐੑΛผͷ໊લͰѻ͑ΔΑ͏ʹ͢Δػೳ w IUUQTBQJSVCZPOSBJMTPSHDMBTTFT"DUJWF.PEFM"UUSJCVUF.FUIPET$MBTT.FUIPETIUNM

  27. BMJBT@BUUSJCVUFΛ࢖͏ཧ༝ wΧϥʔϛʔγϣοϓ͸೥Ҏ্ͷྺ࢙Λ࣋ͭαʔϏε w౰࣌ͷɺϑϨʔϜϫʔΫʢ3BJMTʣʹԊͬͨσʔλϞσϧͷઃܭ͕Ͱ͖ ͍ͯͳ͍Օॴ͕ଘࡏ͍ͯ͠Δ wͦ͜Λٵऩ͠ɺ୭΋͕ѻ͍΍͍͢Ϟσϧʹ͢ΔͨΊʹ BMJBT@BUUSJCVUFΛ࢖͏ wΞϓϦέʔγϣϯͱσʔλʹ͓͚ΔϥΠϑαΠΫϧͷҧ͍ͷӨڹ

  28. BMJBT@BUUSJCVUFͰͷ໰୊ wҎԼͷΑ͏ͳΫΤϦ͕ղܾͰ͖ͳ͔ͬͨ wύονΛ͋ͯͯରԠ w6QTUSFBN΁ͷؐݩ͸·ͩͰ͢

  29. ൃߦ͞ΕΔΫΤϦʹҧ͍͕ʜ wςετ΋ΦʔϧάϦʔϯʹͳΓ wݕূ؀ڥ্Ͱ2"Λߦ͍ɺҰ௨Γಈ࡞ݕূΛߦͬͨ wϦϦʔεΛ໨લʹ٧·ΔϦΫΤετΛൃݟ

  30. ൃߦ͞ΕΔΫΤϦʹҧ͍͕ʜ wҎԼͷΑ͏ͳΫΤϦͷ݁Ռ͕ҙਤ͠ͳ͍΋ͷʹ wεϩʔΫΤϦʹͳͬͯ͠·ͬͨ wൃߦ͞ΕΔΫΤϦ·Ͱ͸֬ೝͰ͖͍ͯͳ͔ͬͨ

  31. मਖ਼͸͚ͩ͜͜Ͱ͍͍ͷ͔ʁ

  32. ࠩ෼ͷ֬ೝ͕େมʜ wൃߦ͞ΕΔ42-Λશͯ֬ೝ͢Δͷ͸େมʜ wػցతʹ൑அ͠ɺ໨ࢹͷ਺ΛݮΒͤͳ͍΋ͷ͔ʜ

  33. None
  34. ͜ΕͰ֬ೝͰ͖Δ͔΋ʂ wςετ಺Ͱൃߦ͞ΕΔΫΤϦΛόʔδϣϯຖʹอଘ w"DUJWF3FDPSE-PH4VCTDSJCFSͰൃߦ͞ΕΔ42-Λऩू wલޙͷ݁ՌΛࣈ໘ͷΈͰൺֱ w4FUOFX <26&3:> ?4FUOFX <26&3:>  w1SFQBSFE4UBUFNFOUͳΒ"45Λ࢖Θͳͯ͘΋͍͚Δ͔΋ʂ

    wྫ4&-&$5 '30."8)&3&JE
  35. ΍ͬͯΈͨ

  36. None
  37. ͪΐͬͱμϝ͔΋ʜ wIUUQTHJUIVCDPNISZTETRBQʢSVCZHFNTPSHʹ͸ͳ͍Ͱ͢ʣ wDPNQPTJUF@QSJNBSZ@LFZTͷςετͰࢼͯ͠Έͨ w୯ͳΔࣈ໘Ͱͷൺֱͩͱεϖʔεɺύϥϝʔλͷҧ͍Έ͍ͨͳͷ͕ Ҿ͔͔ͬΓͩΊ͔΋ wͦ΋ͦ΋ςετσʔλͷ༻ҙͷΫΤϦͱ͔΋ೖ͍ͬͯͨΓʜ w݁Ռͷ(JTU͸ͪ͜Β wIUUQTCJUMZP;0,,

  38. ࠷ޙʹ wԣணͤͣʹࠩ෼ΛͪΌΜͱ֬ೝ͠·͠ΐ͏ wվΊͯ͜Ε͕ϥΠϒϥϦΛ࢖͏͜ͱͩͱೝࣝ w·ͩఘΊ͖Εͯͳ͍ͷͰ্ख͍ํ๏͸ͳ͍͔໛ࡧதͰ͢ wͳʹ͔஌͍ͬͯΔਓ͕͍ͨΒڭ͍͑ͯͩ͘͞ʂʂʂ