The effect of bots on Automation

Anıl taşkıran
Trendyol Tech
Published in
6 min readJan 4, 2021

Imagine you have an invisible robot surfing on the Internet doing certain tasks for you.

This is a bot. 🤖

They reduce frustrating repetitive tasks and save people from doing work that would take up a lot of time and energy. So what jobs can bots do? If you can explain the job step by step to a child who does not understand that job at all, i mean by extracting the algorithm, of course a bot can do it.

At Trendyol, we are trying to increase our productivity by simplifying the daily routines done by bots in the iOS team.

Why do we keep doing the things we do over and over again? Let the bots do this job. Do you have a lot of time-consuming works? There are automation tools for this. If you automate this process, you get rid of a lot of burdens. Especially if you completed these works before Covid-19 like us, you could start working remotely overnight without loss of efficiency.

You can reach the article about processes we have automated as iOS Team which is written by my teammate Ömer.

In this article, I will talk about how we trigger our automation tools and why we use them.

Activate Slack’s superpowers by adding your own bots

Slack is not just a chat application where you talk to your team, it is actually an application that makes your automation processes quite easy and even contains an automation tool itself. When we see a tool that we can squeeze water from a stone as a team, we love to adapt it to our system immediately :)

We created the Command Line Tool with Swift to use our bots in Slack. Since we wrote the Trendyol app with Swift, we thought this would be the right approach for us. Because even if someone new to the team, they can easily add new features to the bot we wrote.

We actually use our bots to send requests wherever we want according to our commands. We send requests to our vapor project to get packages for our bot or to list pull requests. It makes the decisions and execute the necessary job.

In this article I will not go into how Slackbot is used on the Swift side. You can reach the Building Slack Bots In Swift article here.

So what did we need and what did we automate?

Package Exporting Processes

In the works we normally do, we had to put the packages manually on the phone and go to the product managers or designers related to that task and show it. This cost us a lot of time. Think about it, you’ve finished a task, passed the code review, tested, and now it’s the last step to do the User Acceptance Test (UAT). In this process, you have to show it to the owner of the task. But after you finished the task, you already started another task and changed the branch. Now you have to leave the task at hand, return to the branch where the task is to be done, get a package from there and show it to the owner of the task. Did you realize what a waste of time it was? That’s exactly why we had to automate this stage. We obtained an Enterprise certificate and started distributing our ipa with over the air. All we have to do is tell our bot the branch (Releases/ rc-5.1.0) and schema we want. We have created a structure where we can install the application on our phone with a single click and eliminate manual processes.

Since we make Trendyol Yemek Application as a separate module, we can get a package just contains the Trendyol Yemek application in a shorter time.

Test Coverage Reports

As the Mobile iOS team, we need to write unit test for every task we do. As Ömer mentioned, our unit tests run automatically after each pull request, and as a result, Trendyol’s Test Coverage falls to our group.

But we do not have to wait for a new pull request to be able to see test coverage. We tell our bot and it calculates it and brings it to us. As Trendyol app, we can calculate the coverage of modules. Because we follow a modular approach. And we can save time by running our tests on certain test plans. You can get the information about Test Plan with Get the Most Out of UI Tests With XCode Test Plans article written by my teammate Atakan.

By writing the branch we want and the Test Plan, we can access the test coverage of only the modules included in that Test Plan.

Listing Open Pull Requests

We also linked the package exporting process to Slack’s workflow. We ask Skynet to list us open pull requests. And by clicking the export package button we can export our package for the Environment with the steps of the Slack workflow.

Sending Packages to the Appstore

You can read the article written by our mobile team leader Efekan for package distribution. Efekan’s automatization of this process made our processes much easier. All we have to do is give the necessary branch and update method to friday. In our team, Friday deals with the Appstore side and skynet deals with the enterprise distribution. That’s why we’re at friday in this section.

As everywhere, we made it to its current state by iterating here. We didn’t handle error cases at first, when we got an error somewhere, we have to open to the jenkins job and find the error. With Batuhan’s suggestion, we create a task to handle the error case and Batuhan quickly started adding the new feature.

Below you can see an error received during upload. One of the most common mistakes we came across in a modular structure was the following error. When we embed & sign our modules in frameworks other than the host app, the following error occurs.

Skynet Check & Friday Check

As everyone knows, our generation does not like to wait, this is a fact. And we always want to be aware of the things we can manage. So there are these two commands. We want to check what Skynet and Friday are doing at the moment and get a report.

Welcome

When a new person joins our team, a warm welcome comes from skynet :) The messages with the word WORKFLOW can be easily integrated into the channels with Slack’s workflow builder tool.

Please feel free to comment below, if you have any questions.

If you like this article, feel free to share it with your friends and leave me a comment. Also, click on the 👏 clap button below to show how much you like the article.

Thanks for reading! 👨🏼‍💻

--

--