Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Google Summer of Code 2022 @zulip | Work Product

Work Product for Google Summer of Code 2022 at Zulip

This work product is a summary of the work I did for the zulip-terminal client under the Zulip organization as part of Google Summer of Code 2022.

Even while writing this, I feel immense joy, satisfaction and gratitude to have been part of Google Summer of Code for 2022. A huge thanks to my mentors Neil Pilgrim and Sai Rohitth Chiluka for guiding and supporting me throughout this program. Their reviews and suggestions have been very valuable to me. The ease with which they have explained even the most sophisticated logics still amazes me. Apart from my mentors, I would also like to thank the entire Zulip community which has been very supportive and helpful through the entire length of the program.

Project Description



Through this summer, I worked on a variety of issues and PRs. A major chunk involved migration of Zulip terminal to modern API elements, automation of docstrings and expanding search functionality.

Merged pull requests during GSoC 🎉

lint-docstring: Add docstrings to each source file and add linting for developer-file-overview

This PR introduces a new linting tool for ZT, that is, lint-docstrings. Using this tool, the developer file-overview document can be linted against the existing docstrings in the files. In case of an mismatch, the overview file can also be generated by passing the --fix flag. An extension to this PR was #1254 which added linting docstring to CI.

  • 3cb107b: docstrings: Add docstrings to files matching
  • 2c825da: tools: Add tools/lint-docstring to generate
  • 5a712b5 lint-docstring/lint-all: Add linting for developer-file-overview.

model: Add support for is_muted event

As per ZFL 139 under Zulip 6.0, the is_muted event is supported by the server. However, for backwards compatibility, the server sends two events, one containing in_home_view and another with is_muted. This PR is to provide support for handling is_muted event.

  • 7d69b92 model: Add support for stream muting via is_muted property in events.

model/api_types: Remove support for Subscription["in_home_view"]

The purpose of this PR was to migrate event handling for subscription events from in_home_view to is_muted events due to server version upgrades.

  • 989e852 refactor: api_types/model: Migrate from in_home_view to is_muted.

Partially Merged Pull Requests

model: Add handling for User update events

Prior to this pull request, the changes in the meta data of the user were not being handled by ZT. The commits from this PR which have been merged handle events under the realm_user. This can later be extended to displaying changes on the UI and allowing the user to change the meta data through ZT itself (#989).

  • 8571383 api_types: Add RealmUserEvent and RealmUserEventPerson.
  • 01b3853 model: Add function to handle realm_user update events.

Pull requests opened and unmerged 📝

model/core: Add support for keywords in searchbar

The purpose of this PR is to enhance search fucntionality. This PR enables the user to enter keywords as mentioned in the list of operators and search under the desired narrow. It extracts the keywords from the search text and constructs the corresponding narrow as the user desires.

model: Add subscribe/unsubscribe feature

This pull request adds support to handle remove and add operations under subscription events. The aim here was to make changes to the internal data structures when the user subscribes or unsubscribes a stream. The new key binding introduced in the PR opens a popup of all the streams present in the realm, across which the user can toggle subscribe/unsubscribe.

[WIP] Migrate message['subject'] to message['topic']

As part of API migrations towards higher server versions, this pull request was to take the subject attribute of Message and change it to topic.

Pull requests reviewed during GSoC

themes/model: Showing Bot Markers

hotkeys: Add linting for hotkeys

views: User-friendly date and time formatting

bugfix: boxes: fixes #1151

Pull Requests opened during Application Period

views: Collapse large messages and scroll through them

readme: Add fetch-upstream command

Pull requests worked on before the application period

ui/boxes: Added heading-style for all the four themes #1146

views: Added stream_post_policy to the streaminfo view

Restrict posting messages on streams

Challenges and learnings

The most important skills and lessons that I learned were version control, Commit flow for PRs, linting and testing and value of peer reviews. The valuable feedback that I got from the community on my PRs helped me improve the quality of my code and the structure of my commits. I learned to write maintainable, simplified code without any complex logic. I got a chance to learn what it is like to work on a project that is used in real time, by people regularly.

The biggest challenge was to take time out for contributions towards Zulp, as I am a working professional. Contributing on weekdays had become very difficult, hence my mentors suggested that I should try pushing updates on weekends and thus make the review cycle quicker on weekends. Apart from this, writing tests had always been challenge to me. Earlier, writing tests consumed more time for me, than writing the functional code. But over the course of the summer, I understood the philosophhy behind writing tests and now, I have become much better at that.

A huge takeaway from this program for me was that just thinking over a solution is not useful enough. One has to come up with at least WIP level functional code which can help initiate discussion with the mentors and help you understand the direction you are supposed to be headed. Asking for help is not a bad thing, open source is not a competition and everyone here is with the intention of a collaboration, helping beginners always feels good, because I too was once a beginner. But one has to make an effort and try their best before asking for help.

Closing Remarks

  • My experience with Zulip for the entire program of Google Summer of Code 2022 has been amazing and filled with a lot of learnings.
  • My knowledge and understanding about version control has drastically improved. Creating atomic commits with appropriate commit messages has made me a much better programmer. Very high emphasis is put on commit structure, and over this summer, I understood the importance of this practice.
  • The idea of involving the contributors in peer reviews has helped me enhance my ability to read, understand and test code quickly. Writing maintainable and clean code has now become a habit for me, all thanks to Zulip.
  • The well maintained (API and developer) documentations and codebase with extensive comments have shown me that there's a lot more to software development apart from just writing functional code.
  • All this has become possible due to the support I got from my mentors – Neil Pilgrim and Sai Rohitth Chiluka. Their knowledge and technical skills still continue to amaze me. My mentors made me realise that one of the key factors towards becoming a successful open contributor involve understanding the importance of communication. I shall never forget all that I have learnt from them and the entire Zulip community at large. I am proud to be a contributor at this great organisation and at the project of Zulip-terminal.

Post GSoC

I intend to continue contributing to the Zulip terminal project, with my first priority being working on my pending PRs and getting them to a mergeable state. Other than that, I hope to expand my contributions towards other projects under Zulip.

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