Automating iOS Development Workflow at Trendyol

Omer Kolkanat
Trendyol Tech
Published in
4 min readDec 30, 2020

--

What is workflow automation?

Workflow automation is defining a series of tasks to complete a process. It aims to help you simplify the tasks you do on a daily basis. It frees up our time to work on more valuable tasks.

Our iOS development team has built up a workflow that aligns team members, save time and drive a balance between speed and quality by using an automated workflow.

I would like to talk about our automation features and why we need these tools.

We are using JIRA for task and issue tracking and Stash for a version control system and I’m going to tell you through these tools. But other tools have similar features to automatize similar processes.

We created a project with Vapor to handle Stash and JIRA events or interaction with Slack. We chose Vapor for the project as we are using Swift in daily routine and each iOS Developer in our team can easily understand and develop new features quickly without any learning curve. You can get detailed detailed information about Vapor.

Stash

Generally, JIRA and Stash send many emails and sometimes we can miss important changes like someone adds a comment in your opened pull request or a new pull request created. To solve this problem, we developed these jobs:

  • If someone sends a new comment to a pull request, the message with the comment link is sent to the owner via Slack. Hence, you can’t miss the comment and see it instantly.
Comment added message
  • If someone creates a pull request, Slack sends a message to reviewers of the pull request. Reviewers can easily click and review the pull request.
Pull request created message
  • We have a pull request reminder for non-approved pull requests and it sends a message periodically to reviewers that don’t approve yet.
Pull request reminder message
  • If someone sends a commit after you have approved the pull request, you receive a Slack message with a changed commit URL. So, you can review the changed part quickly.
Pull request updated message

This flow allows teams to more easily engage in conversation about code review. We use webhooks in Stash. When a webhook is triggered, it sends a request to our Event Handler. So, it handles and sends message via Slack. You can get detailed information for creating a new webhook on Stash.

JIRA

  • When someone creates a new pull request, automated job moves the JIRA card from In Progress to Code Review column.
  • When a pull request is approved, we first check the minimum approval count which is exceeded — a minimum of 3 approves are required to start testing a pull request Automated job moves the JIRA card from Code Review to Ready for QA column.
  • When we move an issue to Done column in JIRA, a job is triggered and if the pull request doesn’t have any conflicts, it merges to the target branch automatically.

For detailed information about JIRA API.

Unit Test

Unit tests are executed after each push. Then, Slack notifies the owner of the pull request when they fail. A job sets build status in Stash and all unit tests should be passed successfully before merging to target branch. Otherwise, the owner should fix unit tests and push again.

A sample pull request with 2 different build status

You can get detailed information to set build status in Stash.

Auto Pull

The Auto Pull job updates all non-merged pull request branches when a pull request is merged. For example, when a pull request is merged into the develop branch, the other branches should pull the updated develop branch and merge into the current branch. Auto Pull job automates this process except for conflicts.

Part of a commit history that triggered by Auto Pull job

I tried to explain automating our workflow at Trendyol iOS Team. I hope it would be useful.

--

--