Skip to content

Instantly share code, notes, and snippets.

@yuroitaki
Last active October 11, 2022 22:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yuroitaki/e31335ed1a83eccecbe7f3f1da101291 to your computer and use it in GitHub Desktop.
Save yuroitaki/e31335ed1a83eccecbe7f3f1da101291 to your computer and use it in GitHub Desktop.
This document summarises the work that I have done as part of Google Summer of Code 2022.

Google Summer of Code 2022 Work Product

This document summarises the work that I have done as part of Google Summer of Code 2022 (GSoC).

Summary

GSoC project details: Improve the Framework of Zulip’s Native Integrations

Repository contributed to: zulip/zulip

Merged pull requests: yuroitaki's merged pull requests

Contributions

I have spent around 60% of the 12-week coding period working on improving Zulip's native integrations, as planned in my proposal. The rest of the time was spent on Zulip's backend API and production issues. All of these works are detailed below.

Azure DevOps Integration

Azure Devops is a DevOps service that includes a version control repository. A new integration was added to send notifications in Zulip when the following events occur in Azure DevOps.

  • Code pushed
  • Pull request created
  • Pull request updated
  • Pull request merged

Issue: #22438

Pull request: #22507

Status: Completed

RhodeCode Integration

RhodeCode is a version control repository product. A new integration was added to send notifications in Zulip when a repository push event occurs in RhodeCode.

Issue: #19627

Pull request: #22436

Status: Completed

Harbor Integration

Harbor is a artefact repository that helps secure images. The Zulip's integration was updated to cater for new payload formats sent from Harbor when scanning of an image is completed. A detailed investigaton was also done to track down when Harbor made the payload format change — to determine if Zulip needs to support both the old and new formats.

Issue: #21628

Pull request: #22260

Status: Completed

Database Deadlock Fix

A deadlock issue in Zulip's PostgreSQL database was reported (by Alex Vandiver) to be caused by concurrent bulk update operations on the UserMessage table. A fix was implemented to ensure the row locks acquired by concurrent bulk update operations are in the same order, which prevented the deadlock issue from happening.

Issue: #19054

Pull request: #22710

Status: Completed

API Latency Optimisation

GET /events API is an endpoint with the highest traffic that impacts the scalability of Zulip's backend system (more info here). Its latency was reported (by Tim Abbott) to have drifted up from 2-3ms to 5-10ms, and a list of optimisation strategies was proposed (by Tim Abbott) to reduce this latency. One of the optimisation strategies was experimented to reduce the time taken for the API to send messages to the RabbitMQ queue, by using an asynchronous batch operation.

Issue: #13917

Code branch: optimise-get-events

Status: In progress

Pending Works

The following issues have been studied in terms of any related pull requests and discussions in CZO, but I have not started working on them.

  • #20225 — bulk_remove_subscriptions and bulk_add_subscriptions can race with themselves and cause duplicated RealmAuditLog entries
  • #16772 — push_notifications: Modify receiver_is_off_zulip logic to only consider "full clients", and not just bots that access a user's message history

Acknowledgements

In this 12-week GSoC period, I have learnt many technical skills and knowledges, not just from the implementations above, but also through studying Zulip's codebase, asking general architectural questions in CZO, and reading extensive documentations on architectures, subsystems, git practices and more. It has been a rewarding journey — working with technically skilled people within an active open-source community that is very helpful and friendly.

I would like to express my gratitude to Tim Abbott for all the helps, guidances, discussions and pull request reviews throughout this GSoC period. I would also like to thank Adam Birds and Anders Kaseorg for helping to review my pull requests. I am also thankful for all the guidances that were provided by my mentor Gaurav Pandey. Finally, I would like to thank Zulip and Google for the opportunity to participate in GSoC and kickstart my open-source contribution journey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment