Wrapping Zulip's Issue Up
Tags: opensource, devjournal
Published: 2021-12-11 04:31:41

---
series: Contributing to Zulip
---

As I was preparing for my finals and fixing some automation tests for my [Pull Request](https://github.com/zulip/zulip/pull/20494) (PR), I realized I had made a serious mistake. I was clearly under no influence of alcohol, but I managed to write this comment:

{% github https://github.com/zulip/zulip/pull/20494#issuecomment-989490678 %}

## What happened
I'd like give you some background information first. [Zulip](https://github.com/zulip/zulip/) strives to maintain 100% code coverage. In order for my PR to be merged, it must meet that requirement. If the code coverage is compromised, this message will be displayed:

![Terminal message](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zq4uqid1052136agf3zw.png) 

Believing that getting all my tests passed was enough, my PR failed the CI check at first. Unfortunately, that wasn't the worst part.

Thanks to the test coverage, I noticed there was an unused function. It was used by some functions that I'd modified. This was a huge red flag, but it took me some time to realize that I removed an existing feature without asking the maintainers 🤦. Specifically, the feature highlights any substring in a suggestion that matches their query.

In my defense, there was a complication with integrating the new feature (i.e. showing avatar and username in pill-shaped UI elements) with the one mentioned above. I quickly discussed the [issue](https://chat.zulip.org/#narrow/stream/6-frontend/topic/avatars.20in.20search.20auto-complete.3F/near/1294812) with the maintainers. 

![Discuss the issue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k7w8wjbedz5whifpmd94.png)

My first attempt at solving it failed. Forgetting the test my code thoroughly, I made a silly mistake by double-escaping HTML expressions in every user's name:

{% github https://github.com/zulip/zulip/pull/20494#issuecomment-991293978 %}

Thankfully, I managed to patch my mistake instantly. Here's how it looks:

![Feature demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zhq1l1dx96fdm0k1rfya.gif) 

## What I've learnt

Thanks to the test coverage report, I managed to discover my embarrassing flaw. Although it may be annoying to update the tests at times, I think I've learnt to appreciate a **good** CI pipeline setup more than ever. I found [Zulip's docs](https://zulip.readthedocs.io/en/latest/testing/philosophy.html) a good resource for how a developer should approach testing.

I've also recognized the importance of sleep to keep my sanity. Looking back on my comments and code, I'm astonished by my audacity to have made such mistakes. I should have got started earlier to allow myself more time to get familiar with Zulip's codebase. 

## What's next

Since my PR is still under review by the time I'm writing this blog, I'll try to improve it until it's merged. There are not (hopefully) a lot of things left to do with it, so it should be done soon.

---
Cover photo by <a href="https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Brooke Cagle</a> on <a href="https://unsplash.com/s/photos/celebrate-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>