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

How to get satisfaction from ungrateful work: A journey into updating Kotlin

How to get satisfaction from ungrateful work: A journey into updating Kotlin

When working on a new project or joining a mid/big project, you’ll have at some point to update the libraries. Adding or upgrading a library to a newer version seems an easy task. After all most of the time it's "just" updating a number. But in reality it can cause a number of (sometimes) "invisible" failures that require you to approach this upgrade carefully. In this presentation we will show easy steps to prevent these failures and spot the errors.

1ab2a8314c84b1eb1dce60a52b3a6d62?s=128

Syrine Trabelsi

April 25, 2022
Tweet

More Decks by Syrine Trabelsi

Other Decks in Programming

Transcript

  1. A JOURNEY INTO UPDATING KOTLIN HOW TO GET SATISFACTION FROM

    UNGRATEFUL WORK: Syrine Trabelsi
  2. About Trainline Trainline is the leading independent rail and coach

    travel platform selling rail and coach tickets to millions of travellers worldwide. Via our highly rated website and mobile app, people can seamlessly search, book and manage their journeys all in one place. We bring together millions of routes, fares and journey times from more than 270 rail and coach carriers across 45 countries. We help our customers find the best value fares for their journey and smart, real time travel information on the go. Our aim is to make rail and coach travel easier and more accessible, encouraging people to make more environmentally sustainable travel choices. i. Based on transactions from weeks commencing 06/10/2019 to 23/11/2019 ii. iOS rating from UK AppStore as of 29 November 2019 iii. Trainline data for November 2019 (incl. UK consumer number Web/App and EU Web/App) iv. Average monthly visits for year ended 29 February 2020 v. UK consumer mobile app transactions for the year ended 29 February 2020 Trainline is the world’s leading independent rail and coach travel platform We sell tickets on behalf of more than 270 rail and coach companies and are adding more all the time We sell train and coach tickets worldwide, helping our customers travel in and across 45 countries in Europe and the rest of the world We sell tickets to people living in more than 175 countriesi in 14 languages Our customers can book in 10 currencies and payment methods include Apple Pay, PayPal, Google Pay, SOFORT & iDEAL We have built Europe’s leading train and coach app – with a 4.9/5* ratingii There are more than 39.4m cumulative downloads of our appiii Our platforms host more than 90m visits per monthiv 88% of our transactions are mobilev Our team numbers more than 700 people and more than 50 nationalities, including 400+ travel tech specialists and engineers >160 Train companies >110 Coach companies
  3. HOW TO UPDATE A 3RD PARTY LIBRARY IN 6 STEPS?

  4. STEP 0: VERSION

  5. ▸Update the Library number ▸Look for all warnings and fi

    x them
  6. STEP 1: COMPILATION

  7. Do a full build to discover any breaking changes in

    compilation, including deprecations. ./gradlew compileDebugSources compileDebugUnitTestSources assembleDebug --no-build-cache --rerun-tasks
  8. STEP 2: TODO’S

  9. None
  10. None
  11. STEP 3: SECURITY

  12. Read the release notes carefully to discover any potential issues.

    ▸consider security (Log4j vulnerability case) ▸consider license ▸consider how big the artifact is (we'll ship it in APK) ▸consider GDPR compliance
  13. STEP 4: VERIDEX

  14. None
  15. To run Veridex ./appcompat.sh —dex-file=/path-from- root/your-apk.apk

  16. Summary of the result

  17. None
  18. STEP 5: DEPENDENCIES

  19. ./gradlew dependencies > deps_pr.txt In the PR branch

  20. ./gradlew dependencies > deps_pr.txt In the PR branch In the

    base branch ./gradlew dependencies > deps_base.txt
  21. In the base branch In the PR branch

  22. STEP 6: TESTS

  23. Run Tests ▸Test the affected areas of the app. ▸Test

    the affected third-party libraries.
  24. INSIGHT FROM KOTLIN UPDATE

  25. Kotlin update from 1.4.32 to 1.5.32

  26. None
  27. In the Turkish locale, the Unicode LATIN CAPITAL LETTER I

    becomes a LATIN SMALL LETTER DOTLESS I. That’s not a lowercase “i”.
  28. In the Turkish locale, the Unicode LATIN CAPITAL LETTER I

    becomes a LATIN SMALL LETTER DOTLESS I. That’s not a lowercase “i”. ▸Consider the Locale.ROOT or Local.getDefault() use ▸Enum name() for Json, email address …etc expected: title but was: tıtle
  29. No code change, some Unit Tests started to FAIL

  30. No code change, some Unit Tests started to FAIL 😱

  31. No code change, some Unit Tests started to FAIL 😱

  32. Questions ? Syrine Trabelsi syrine.trabelsi@thetrainline.com twitter.com/sarrouna23

  33. Thanks