Skip to content

Instantly share code, notes, and snippets.

@sahil839
Last active August 31, 2020 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahil839/754c7a92add0b5bd5bf25d42306bdee3 to your computer and use it in GitHub Desktop.
Save sahil839/754c7a92add0b5bd5bf25d42306bdee3 to your computer and use it in GitHub Desktop.

Google Summer of Code 2020 with Zulip

Summary

This is a report of the work I did as a Google Summer of Code participant with Zulip.

I mostly worked on settings subsystem, including both organization and stream settings. My work mainly revolves around adding a new user Realm Owner user role and implementing Stream Admin feature. Other than this, I also worked on some general refactoring of code and fixing bugs in settings and other parts of the code.

I got 104 commits merged during the GSoC period (including community bonding period) and have some PRs that are under review.

Project

  1. Realm Owner feature - I added a new Realm owner user role. A realm owner has all the permissions that an administrator has and some privileges that admins do not have like deactivating organization, changing message retention policy, etc. While working on this, I also worked on refactoring already exisiting code as preparation for adding Realm Owner role.

    Merged PRs for realm owner feature -

    • #15005 - actions: Merge do_change_is_admin and do_change_is_guest.
    • #15116 - Add realm owner feature.
    • #15119 - tests: Use do_change_user_role in lint rules and test docs.
    • #15143 - users: Modify update user API endpoint to accept role as parameter.
    • #15144 - tests: Fix tests to use role instead of is_admin for updating user.
    • #15154 - events: Update person dict in event for do_change_user_role to send role.
    • #15168 - realm owner: Change desdemona to owner and add is_owner field to user objects.
    • #15184 - Modify do_create_user and create_user to accept role.
    • #15266 - slack_import: Map slack owners to zulip owners.
    • #15267 - Realm owner: Follow-ups and frontend part of the realm owner feature.
    • #15305 - Follow-up for realm owner feature backend.
    • #15460 - invite: Add option to invite user as an organization owner.
  2. Stream admin feature - This feature adds a new role of Stream Admin. Stream Admins are allowed to change stream details like stream name, description, privacy, etc. Most of the work for this is done in a single PR mentioned below. Work on this is not finished yet and is in progress.

    Partially merged PR for stream admin feature-

    • #15334 - Implement concept of stream admin

    Preparatory PR for stream admin feature-

    • #14992 - stream: Allow non admins to set stream post policy when creating streams
  3. Enable changing stream level message retention policy from webapp - Though backend part for message retention policy already existed, there was no support for changing it from webapp and it had to be done by sending an Email to support. I enabled support for changing the stream level message retention policy from webapp UI.

    Merged PRs related to message retention policy -

    • #15395 - Add support for setting message retention policy for individual streams
    • #15578 - Fix UI for stream message retention days.
    • #15695 - docs: Add steps for configuring message retention policy in the docs.
  4. Miscellaneous - Other than the above mentioned things, I have worked on various other issues related to fixing bugs, refactoring existing code and tests, etc. Here is the brief of this work-

    • Removing get_sub calls to avoid bugs related to stream renames.
    • Fix simplebar scrolling in settings and stream overlay.
    • Refactored backend code for invite users.
    • Fixed other small bugs and refactored some other parts of the code.

    Merged PRs -

    • #15069 - message_events: Fix live update of message edit history.
    • #15176 - test_subs: Add tests for unsubscribing multiple users from stream.
    • #15187 - compose: Fix subscribing the user from mention warning.
    • #15196 - stream_edit: Use user_ids for subscribing/unsubscribing to a stream.
    • #15224 - Change needs_subscribe_warning and would_receive_message to use user_id.
    • #15227 - streams: Extract removing_someone_else logic to a function.
    • #15238 - tests: Refactor attempt_unsubscribe_of_principal to accept list of users.
    • #15253 - users: Refactor get_profile_backend to be based on format_user_row.
    • #15409 - api: Remove is_old_stream property from the stream objects.
    • #15469 - stream: Fix message on clicking add button with empty subscribers form.
    • #15491 - subs: Remove click handler for a non-existent class.
    • #15508 - Add link to 'roles and permissions' docs with the user role dropdown.
    • #15519 - models: Update values of PreregistrationUser.invite_as dict to have same set of values as that of UserProfile.role.
    • #15521 - Remove get_sub calls and use stream id to get sub object.
    • #15548 - invites: Do not return multi-use invites to non-admin users.
    • #15588 - invites: Send user_id of the referrer instead of email in invites dict.
    • #15611 - Fix bug in rendering of organization settings tip and minor fixes in emoji settings page.
    • #15656 - settings_panel_menu: Remove "settings-wrapper" class from jquery selectors.
    • #15755 - streams: Remove get_sub calls and use stream id instead of stream name.
    • #15816 - node_tests: Pass correct arguments to needs_subscribe_warning.
    • #16025 - dev_settings: Add EMAIL_PORT setting in zproject/dev_settings.py.
    • #16027 - stream_edit: Send values of changed settings only to backend.
    • #16059 - streams: Send PATCH request for stream name and description only when it is actually changed.
    • #16093 - puppetter: Replace 'visible: false' with 'hidden: true'.

Opened PRs-

I also have a number of PRs opened which are under review currently. I am listing these PRs below -

  • #15240 - drafts: Save stream_id along with stream names for drafts.
  • #15279 - users: Modify 'GET /users/me' endpoint to accept additional arguments.
  • #15574 - Show normal user popover for bot owners instead of extended profile.
  • #16034 - emails: Add quote prefix ">" in plain text missed message emails.
  • #16062 - streams: Show warning when unsubscribing a private stream.
  • #16076 - streams: Do not allow private default streams.
  • #16124 - stream: Do not hide stream email on live update after unsubscribing.
  • #16186 - Fix error message for deactivating the last oraganization owner.
  • #16191 - message_list: Live update trailing bookend on stream deactivation.

My Experience and plans after GSoC

I had a great learning experience working for Zulip this summer. I got to learn many things about writing clean and maintainable code, working with a community of developers and also gained a lot of knowledge about programming in general. I would like to thank the whole Zulip Community, especially my mentor Pragati Agrawal and Zulip organization administrators Tim Abbott and Steve Howell, for their support and valuable feedback throughout the summer. I will keep contributing to Zulip after GSoC, as I have enjoyed working with Zulip very much throughout the summer along with learning many new things and would love to continue this wonderful journey further.

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