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

Click-free releases & the making of a CLI app

Adam Ahmed
November 02, 2024

Click-free releases & the making of a CLI app

Adam Ahmed

November 02, 2024
Tweet

More Decks by Adam Ahmed

Other Decks in Programming

Transcript

  1. Adam Ahmed - Senior Android Engineer at TravelPerk - @oheyadam

    Click-free releases & the making of a CLI app
  2. Agenda • Our release process • What does our CLI

    app do? • The making of a CLI app
  3. Agenda • Our release process • What does our CLI

    app do? • The making of a CLI app • Build & distribution
  4. Agenda • Our release process • What does our CLI

    app do? • The making of a CLI app • Build & distribution • Consuming it on Android
  5. Agenda • Our release process • What does our CLI

    app do? • The making of a CLI app • Build & distribution • Consuming it on Android • Automating everything
  6. What does our release process look like? Preparation • Increment

    version across apps • Update database entries
  7. What does our release process look like? Preparation • Increment

    version across apps • Update database entries • Notify stakeholders
  8. What does our release process look like? Preparation QA •

    Cut release branches • Pull latest strings
  9. What does our release process look like? Preparation QA •

    Cut release branches • Pull latest strings • Create & distribute internal release builds to testers
  10. What does our release process look like? Preparation QA •

    Cut release branches • Pull latest strings • Create & distribute internal release builds to testers • Update database entries
  11. What does our release process look like? Preparation QA •

    Cut release branches • Pull latest strings • Create & distribute internal release builds to testers • Update database entries • Notify stakeholders
  12. What does our release process look like? Rollout • Staggered

    rollout • Update database entries • Notify stakeholders
  13. What does our release process look like? Completion • Create

    a PR to merge our release branch back into main
  14. What does our release process look like? Completion • Create

    a PR to merge our release branch back into main • Create release tags
  15. What does our release process look like? Completion • Create

    a PR to merge our release branch back into main • Create release tags • Generate internal release notes
  16. What does our release process look like? Completion • Create

    a PR to merge our release branch back into main • Create release tags • Generate internal release notes • Update database entries
  17. What does our release process look like? Completion • Create

    a PR to merge our release branch back into main • Create release tags • Generate internal release notes • Update database entries • Notify stakeholders
  18. Fastlane App automation done right. Or is it? • Written

    in Ruby • We couldn’t iterate easily
  19. Fastlane App automation done right. Or is it? • Written

    in Ruby • We couldn’t iterate easily • We couldn’t write tests for it
  20. Fastlane App automation done right. Or is it? • Written

    in Ruby • We couldn’t iterate easily • We couldn’t write tests for it • Performed build-logic operations outside of our codebase
  21. Fastlane App automation done right. Or is it? • Written

    in Ruby • We couldn’t iterate easily • We couldn’t write tests for it • Performed build-logic operations outside of our codebase • Needed to replicate the same Ruby environment across di ff erent hosts
  22. Fastlane App automation done right. Or is it? • Written

    in Ruby • We couldn’t iterate easily • We couldn’t write tests for it • Performed build-logic operations outside of our codebase • Needed to replicate the same Ruby environment across di ff erent hosts • Fastlane Swift is kind of the same
  23. • Written entirely in Kotlin • Distributed as CLI app

    • Fully tested / testable • Allowed us to iterate Kronos
  24. Improvements • Unit & integration tests for code paths we

    knew were brittle • Our release process has state
  25. Improvements • Unit & integration tests for code paths we

    knew were brittle • Our release process has state • Automatically generates internal release notes
  26. Improvements • Unit & integration tests for code paths we

    knew were brittle • Our release process has state • Automatically generates internal release notes • Android releases are entirely automated
  27. The making of a CLI app • We just used

    Clikt! • Allowed us to represent CLI commands as classes
  28. The making of a CLI app • We just used

    Clikt! • Allowed us to represent CLI commands as classes • …
  29. The making of a CLI app • We just used

    Clikt! • Allowed us to represent CLI commands as classes • … • Pro fi t!
  30. Build & Distribution • Ideally, we want this • Kronos

    is just a JVM library • Can Gradle help?
  31. Build & Distribution • Ideally, we want this • Kronos

    is just a JVM library • Can Gradle help? • Uber-jars
  32. Build & Distribution • Ideally, we want this • Kronos

    is just a JVM library • Can Gradle help? • Uber-jars • Publishing
  33. Build & Distribution • Ideally, we want this • Kronos

    is just a JVM library • Can Gradle help? • Uber-jars • Publishing
  34. Build & Distribution • Ideally, we want this • Kronos

    is just a JVM library • Can Gradle help? • Uber-jars • Publishing
  35. Build & Distribution • Ideally, we want this • Kronos

    is just a JVM library • Can Gradle help? • Uber-jars • Publishing
  36. Invoking it from the Android project • Create a Gradle

    task • Add the dependency to your classpath
  37. Invoking it from the Android project • Invoking this CLI

    • Add the dependency to your classpath
  38. Invoking it from the Android project • Invoking this CLI

    • Add the dependency to your classpath
  39. Invoking it from the Android project • Invoking this CLI

    • Add the dependency to your classpath
  40. Invoking it from the Android project • Invoking this CLI

    • Add the dependency to your classpath • Pro fi t!
  41. Automating everything Zapier subscribes to Calendar events Zapier calls into

    CircleCI API CCI spins up an instance, runs desired work fl ow
  42. Automating everything Zapier subscribes to Calendar events Zapier calls into

    CircleCI API CCI spins up an instance, runs desired work fl Projects call into Kronos