From development to production: An Android story
You are a new member of the awesome Android chapter in the Vodafone Digital Engineering team! You are ready to implement and release your new super feature for the My Vodafone app. This is a walkthrough of how an idea begins from the implementation and finally gets released in the Play Store.
The first thing you want to do is create your own feature branch from our develop branch. The Android chapter uses Gitflow for managing the workflow of our Git branches. You start crunching through the code, refactoring where needed, and bringing the idea to life. You make sure you write unit tests, covering at least 60% of the new code. Unit testing is easy! Android chapter uses Clean Architecture, MVVM, and Dependency Injection for its features. Testing frameworks available are Rebolectric and Mockito.
You are finally happy with your implementation! You use our state-of-the-art CICD infrastructure hosted on Azure DevOps to create a test build for your team's QA Engineer. The QA Engineer gets the newly created test build through Firebase App Distribution. The QA points out a couple of UI inconsistencies with the provided Figma mockups. So what... One last commit and you get a pixel-perfect result!
The QA has finally given the OK and you are ready to create your Pull Request. You carefully fill the PR template as shown below:
You add the reviewers, yourself as an assignee, and the necessary labels.
While you wait for the reviewers' feedback, our CICD starts working on your nearly-created PR!
- The first check is Detekt. Detekt will let you know of any code smells or violations in your new implementation.
- Next up is Lint. Lint will go through the code and check the functional requirements of Android.
- Third, SonarQube kicks in. SonarQube will check your code for the required Unit Test coverage, check for security hotspots, and general hygiene (duplications, code smells, etc.) of the PR.
- Last but not least, DangerJS will let you know if the PR meets certain requirements set by our chapter (necessary reviewers in place, missing assignee, etc.).
The checks are finalized and the approval from your fellow chapter members is here! You merge your PR just in time for the biweekly release of My Vodafone app. The CICD pipeline once again kicks in, creating a release branch and creating a release candidate build for the UAT team. The UAT teams give the GO, CICD creates a new release and it uploads it to the Play Store! Automated and free of human errors, the release finally reaches our customers' Android devices!
Further Reading
- https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
- https://robolectric.org/ and https://site.mockito.org/
- https://azure.microsoft.com/en-us/products/devops
- https://firebase.google.com/docs/app-distribution
- https://github.com/detekt/detekt and https://developer.android.com/studio/write/lint
- https://www.sonarsource.com/products/sonarqube/
- https://danger.systems/js/