Hackdayz #18: Absence Hub

Reading Time: 5 minutes

The best way is the easiest!

You want to plan the next projects, but do not know which of your employees are available? Who is on vacation πŸ–? Who is ill πŸ€’? Who is where?

Or you are planning your next vacation and you are swiping about the best hotel offers and places. But then a mail from your boss: Your request is rejected πŸ‘Ž. The reason is that there is even a more important project and your talent is needed there!

These were our problems

We use for that two tools currently: Absence.io for planning your vacations and other absences and ResourceGuru for scheduling the resources for each project and customer.

Both tools are the best for its use case. But why so complicated? Why so many tools? Questions, questions and more questions,…

  • Can we make the absence requests easier for both sides?
  • Can we create the entries in one tool for the others at the same time?
  • In short – Can we optimize the process?

Our answer: YES, we can!

stay focused, be yourself and just do it

Boris Karov (Senior Software Engineer)

Our winning team

But how could we win?

First, we should have a look at our current approval process.

It’s complicated, isn’t it πŸ€¦β€β™‚οΈ? You have to log in, then your boss – in our case Fatih – has to log in in both tools and has to manage the requests. We had a discussion about the tools, which we might use, and finally came up with the answer: Absence.io sends us every morning the absences of each team member via SLACK. 😍

A new idea was born

How can we use this Slack bot engine? Or can we create a new one?

We decided to create a new Slack bot for all out-of-office requests, to connect both tools and to make the approval process easier and faster.

After we achieved this milestone, we started with the project. For research and development, we shared the following tasks among each other:

  • Boris mainly took care of ResourceGuru
  • Stefan mainly took care of Absence.io and CI/CD pipeline
  • and I of the Slack bot communication and node service

but there MUST exist an API for that!

Stefan Maurer (Co-Founder & VP Engineering)

Let the game begin

We developed the first lines of code and sent the first API calls via Slack. Also, we figured out how to create slash-commands in the Slack bot UI and how to connect the commands to the service endpoints.

A slash-command for sending an absence request

Then we created more useful and prettier messages to make the approvement decisions comfortable.

The bot message to the approver

Both back-end guys had some troubles to learn how to write a nodeJS service (e.g. promises, …). And I had also issues in understanding the Slack SDK, but we mastered the brainfucks and achieved a lot in two short days:

  • CI/CD with Gitlab Pipelines
  • SlackBot deployment on Heroku
  • User Slack command
  • Absence is created in Absence.io
  • Approver can accept / reject in Slack

And we won πŸ˜‰

The happy winning team

Further steps

We still needed some other features for going live, too:

  • Let Dev choose who the approver is
  • Create TimeOff in ResourceGuru
  • Add caching via mongoDB to keep users IDs
  • Add handling to manage different user API keys
  • Add i18n date formats 2018/12/14, 14.12.2018,…
  • Support more formats like:
/remote 14.12.2018 morning
/illness 14.12.2018 afternoon to 15.12.2018 morning

Technology Stack

stay the way you are and get better and better every single day for the rest of your life

Stephan Ullenboom (Senior Frontend Engineer)

Conclusion

There were two very funny and productive Hackdayz. We had some challenges with API keys, because of both tools assigned there keys to a specific user and not to a project. Also, it required many, many, many API calls to find the users and resources etc. However, we made it πŸ™Œ.

We got to know each other better and went the extra mile together to win the trophy.

...and now, we have a new challenge: defend our trophy πŸ† at the next hackdayz 😁.

Hackdayz #18: Mr. Moody

Reading Time: 6 minutes

The Team

Shady Eltobgy (Senior Software Engineer)
Jeremy Haas (Co-Founder & VP Engineering)
Timo KΓΆhler (IT Consultant)

Why we create our own Mr. Moody

Mr. Moody was implemented πŸ‘¨β€πŸ’», while attending our first offsite event Hackdayz18 at the Oberwaid in St. Gallen. Check out the video if you missed it! The idea was born in a short brainstorming session. Primarly we wanted to implement a Slackbot, because we already are Slack users for years now πŸ’¬. We really like to “slack” and love/use several bots already. Of course we also have to deal with new technologies, that might be used for future projects. Besides that, the idea of customizing our own application according to fit our needs is a plus βž•.

Discussing, coding, writing, thinking…. Snapshot of #Hackdayz18

Mr. Moody is based on the niko-niko calendar which is a simple practice to track the team mood, conventional used on a board with stickers  or written on paper. It allows every team member to track his mood at the end of a work day.  The Japanese word “niko” means “smile”; following a common pattern of word doubling in Japanese, “niko-niko” has a meaning closer to “smiley”. This calendar is an information radiator and can be seen as an opportunity to be used on a regular basis (e.g. in retrospectives or dailies) for reflection, adaption and improvements.

Used as a slackbot, Mr. Moody will remind you via direct message to tell your mood and ask you if you would like to add a comment on that. The personal mood calendar and also the accumulated team  mood is shown on a dashboard so the team can use it itself e.g. in dailies or retrospectives or team leads & managers can see how it is goig in the team(s) and see if there is action required.

Mr. Moody is a great complement to other metrics and will help the team identify impediments.

Sometimes we are happy….
…sometimes we are sad!

Technologies we used πŸ› 

Ngrok – https://ngrok.com/

A very cool, lightweight tool that creates a secure tunnel on your local machine along with a public URL you can use for browsing your local site. When ngrok is running, it listens on the same port that you’re local web server is running on and proxies external requests to your local machine.

Heroku – https://www.heroku.com

Heroku is a cloud platform as a service. That means you do not have to worry about infrastructure. You just focus on your application!

Botkit – https://botkit.ai/

Building Blocks for Building Bots. One of the good advantages to select botkit, is the ability to start a conversation using bot.startConversation() with a specific user using their user ID or channel ID. Very easy to use!

How does it work? πŸ€”

Botkit is designed to ease the process of designing and running useful, creative bots that live inside messaging platforms. Bots are applications that can send and receive messages, and in many cases, appear alongside their human counterparts as users.

A best effort is made to generate a slackbot where a cronjob ⏱ should be run everyday at 03:00 pm. This job will do the following:

  1. We get from slack the list of all users.
  2. Iterate through the list of users. Afterwards, each user should get the massage, asking about his mood, which is like a variety between different options (e.g. very good, good, normal, bad)
  3. An interaction is done with each user, by asking each user if he/she wants to add a comment.
  4. At the end of each week, another cronjob is run to send all data, and feedback to a certain user or group of users.

An example of how Mr. Moody is interacting

Wanna try it out? πŸ’»

Yes! The code is open source and everything else (technical setup process) is described in the README.MD

https://gitlab.com/47northlabs/public/mr-moody

Mr. Moody Logo

Some other issues and questions ⚠️

The implementation of Mr. Moody is not totally completed. Some points need to be covered in the future. Some of them are as follows:

  • Storing the given rating from each user in a database, where later at the end of each week, a weekly report is generated.
  • When asking slack for giving us a list of all users, where we iterate through each user to interact, the given list is not only for uses, but also for slackbots, and old users. This causes a problem when we try interact with each user, and results in exceptions. A filtering criteria should be done to filter only the current users from unused users, deleted users, or slackbots.
  • ِA cronjob for generating a report and sending it on the admin, is not done in the moment. However, we need to see how the report should be generated, what type of diagrams should the report contain, etc.
  • How do we handle Vacations/Holidays and avoid spamming employees while they are sipping Pina Colada at the beach?
  • How do we handle external Slack users which maybe should not get a Mr. Moody message?