Page MenuHomePhabricator

Proposal: Develop a mechanism to send Wikimedia-specific Zulip welcome messages to newcomers(GSoC 2020)
Closed, DeclinedPublic

Description

Profile

Name: Rohan Gupta
Time zone: UTC +5:30
IRC nick: Rohan-cod
Email id: rohaninjmu@gmail.com
Zulip email: rohaninjmu@gmail.com
GitHub: Rohan-cod
Linkedin: Rohan Gupta Linkedin
Location: India
Working hours: 11:00 am to 01:00 am UTC +5:30

Synopsis

The task is to create a zulip bot for Wikimedia-Zulip that sends customized messages to new users who sign-up and/or who ask for information on getting started. Link to Phabricator: T233478.

Objectives:

  • Welcome new members and share with them kick-start resources related to Wikimedia Outreach projects.
  • Bot should provide help around FAQs (for example by using the following syntax: +search-faqs: <then question>), so we don't wait for a human (waste of time) and also avoid repeating answers.
  • Direct channel members to the relevant members and/or relevant streams/topics.

Proposed Features:

  • Welcome Message.
  • Adding users to a particular stream.
  • Answering queries.
  • Static type checking and support for mypy.
  • Smart bot using natural Language Processing.
  • Automated testing and Mocking apis.

Mentors

Detailed explanation of the proposed features

  • Welcome Message -

Whenever a new user joins the channel he expects some information about the project. Sending the same message to every new user is a tedious task and wastes a lot of time. Here's a solution, the zulip bot will send a welcome message to every new user that joins the channel. The message will contain information about the organization and details about the project. The message will be customized for each topic so that the user gets a message containing information related to the topic of the stream that he/she has joined.

  • Adding user to a particular stream -

It's not the case everytime that a new user joins the exact stream he wanted to join. We have to add that user to the ideal stream manually or he/she has to join the stream himself/herself. Here's a solution, you can use the zulip_bot to be added to a particular stream or the admin can use it to add a particular user to the required stream.

  • Answering queries -

Most of the questions that newcomers ask have been already asked by someone else. Answering the same questions again and again is a tedious task. Here's a solution. All the frequently asked questions would be grouped together and the bot will respond to all of them whenever someone asks them. If a new question comes for which the bot doesn't have an answer, will be sent to the admin so that he/she can answer them. He/She will also have an option to add them to the list of FAQS.

  • Static type Checking -

Python uses dynamic type checking for checking the data type of the variables and the return type of the function at runtime. There is a tool called mypy which helps integrate static type checking into your code. This requires changing the code structure but in the long run it definitely pays off.

Pros of type checking:

  • Type hints help document your code. Traditionally, you would use docstrings if you wanted to document the expected types of a function’s arguments. This works, but as there is no standard for docstrings.
  • Type hints improve IDEs and linters. They make it much easier to statically reason about your code. This in turn allows IDEs to offer better code completion and similar features. With the type annotation, PyCharm knows that text is a string, and can give specific suggestions based on this:

pycharm_code_completion.82857c2750f6.png (515×1 px, 67 KB)

  • Type hints help you build and maintain a cleaner architecture. The act of writing type hints forces you to think about the types in your program. While the dynamic nature of Python is one of its great assets, being conscious about relying on duck typing, overloaded methods, or multiple return types is a good thing.
  • Smart bot -

All the above features will be pre programmed. The bot will do only the thing for which it has been programmed. This has a problem, what if a user wants to have a conversation just like having a conservation with a real human he/she would not be able to have that. Here's a solution, there is a library in Python called ChatterBot which can be used to create smart bots which will be like a real human. Apart from this it will keep on learning as the users chat with it. It will keep on improving.
This library requires ML, AI and nlp. The bot made using ChatterBot will be integrated with the zulip bot by placing the code with the zulip_bot code or using incoming and outgoing webhook integrations. This will make the bot a 'Smart Bot'.

  • Automated Testing and Mocking apis -

Tests are the most important part of a software program. Most of the programmers ignore them. Tests help evaluate your code automatically. You don't have to manually test anything. Tests automates the process of confirming that the code works as expected. For some part of the code access to an api is required which inturn requires an internet connection. Here's a solution, there is a concept called mocking through which we can create a mock api and store it locally in the source code so that connection to the remote api is no longer required. You will be able to test the code even without an internet connection.

In the words of Jacob Kaplan-Moss, one of Django’s original creators,
“Code without tests is broken as designed”.

Why is mocking useful?

----> When writing tests, it often occurs that you make calls to functions taking complex arguments. Creating a real instance of such an argument would require the use of various different libraries, a lot of boilerplate code, etc. Another scenario is that the tested code accesses files or objects that don’t exist at testing time. Finally, it is good practice to keep tests independent from others. Mocks help you to isolate test cases by simulating objects and methods irrelevant to a test’s goal.

Timeline

PeriodTask
April 27 to May 17Community bonding period.
May 18Coding officially begins!
May 18 to May 24Writing code for welcome message and information related messages for all the available streams on Wikimedia-Zulip.
May 25 to May 31Writing code for adding users to a particular stream and FAQS.
June 1 to June 7Structuring the code to support static type checking and mypy.
June 8 to June 14Writing tests for the code written.
June 15 to June 19Phase 1 evaluations.
June 20 to June 26Adding support for ChatterBot, enabling it to have conversation with the users just like a human being.
June 27 to July 4Adding ChatterBot support continues. The code written in this period will enable it to answer questions other than the FAQS, for example, the questions available on Stack Overflow.
July 5 to July 12Writing tests for the code written.
July 13 to July 17Phase 2 evaluations.
July 18 to July 24Writing fixtures for all the apis used which will help in mocking the apis.
July 25 to July 31Writing tests and structuring the code to support static type checking.
August 1 to August 8Fixing all the bugs and deploying the bot.
August 9 to August 17Writing documentation and Updating appropriate guides. Code cleanup for submission.
August 17 to August 24Mentors submit final student evaluations.
August 25Final results of Google Summer of Code 2020 announced.
OctoberMentor Summit.

Participation

  • I will make a new repo on git and maintain two branches. Code will be uploaded to the dev branch periodically and will be merged with the master branch once review and testing is done.
  • I will deploy the bot in production using Zulip Botserver and supervisord.
  • I will be available on zulip in my working hours.
  • I will use Phabricator for managing bugs and subtasks.
  • Weekly reports will be published in my meta wiki user page.

About me

My name is Rohan Gupta. Currently I am in the second year(4th semester) of Btech C.S.E at Shri Mata Vaishno Devi University, Katra.

I found the organization on the GSoC organizations page.

I am planning to participate in GSoC 2020.

My final examination will commence on May 13 and will be over by May 22. I will be able to commit enough time from May 18 to May 22. After this I don’t have any other commitments and my complete focus will be on making a wonderful bot for Wikimedia.

This project seems interesting to me because i love to automate tasks. I created two bots using selenium and have past experience with ChatterBot and python-zulip-api.

Why me?

I have been working with python for a long time. I have gained a lot of knowledge about its different libraries and frameworks. I also work on those aspects of python which other programmers deem unimportant but are in reality, crucial to the overall functioning of the project.

I follow the PEP 8 style for writing my code which is highly recommended within the coding fraternity. Also, most of the code I write has support for static type checking through mypy.

I have been in constant contact with the mentors and have gained much knowledge about the project requirements. I am also in constant touch with the zulip support team so that I don't miss anything and learn tricks to optimise my code.

I have gained a considerable amount of familiarity with the codebase by submitting pull requests to the project. I have made very informative commit messages which are very important in efficiently maintaining an Open Source project.

A program can be written by anyone but not everyone can write the most optimised version of it, which I am confident enough that I can write.

Past Experience

I have been working with Python for a long time and have learned a lot about it. I have knowledge about a lot of libraries like argparse, selenium, tkinter, numpy, pandas and many more. I have also worked with Django and have a couple of webapps too.

I have made a zulip bot which is a prototype for the project. This will give you an idea about how I will be implementing all the features.

Wikimedia_zulip_bot

Demo of a fully functioning Zulip bot made by me

RBOT

(zulip)I have contributed to zulip where I added ImgBot for image optimization to their code.
Image Optimisation with ImgBot. · Issue #544 · zulip/python-zulip-api

My contributions to Wikimedia:

  • (toolforge) I have also contributed to Paws which is a sub repository of Toolforge where I added a readme file and added ImgBot for image optimization to their code.

https://github.com/toolforge/paws/pull/36

  • (toolforge) I have also contributed to tool-toolforge-static which is a sub repository of Toolforge where I added a readme file.

https://github.com/toolforge/tool-toolforge-static/pull/1

  • (toolforge) I have also contributed to tools-hitjitsu which is a sub repository of Toolforge where I corrected their readme file.

https://github.com/toolforge/tools-hatjitsu/pull/3

  • (toolforge) I have also contributed to media-dubiety which is a sub repository of Toolforge where I added a readme file.

https://github.com/toolforge/media-dubiety/pull/1

  • (mediawiki) I have also contributed to BlueSpicePermissionManager where I added a readme file.

https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/BlueSpicePermissionManager/+/578358/

  • (WikipediaLibrary) I have also contributed to TWLight for the task T205531.

https://github.com/WikipediaLibrary/TWLight/pull/430

  • (wikimedia) I have also contributed to analytics-wmde-WDCM-Overview-Dashboard where I added a readme file.

https://gerrit.wikimedia.org/r/#/c/analytics/wmde/WDCM-Overview-Dashboard/+/579845/

  • (wikimedia) I have also contributed to mediawiki-extensions-Maintenance where I added a readme file.

https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Maintenance/+/579917/

  • (wikimedia) I have also contributed to mediawiki-skins-BlueSky where I added a readme file.

https://gerrit.wikimedia.org/r/#/c/mediawiki/skins/BlueSky/+/580075/

  • (wikimedia) I have also contributed to mediawiki-skins-GreyStuff where I added a readme file.

https://gerrit.wikimedia.org/r/#/c/mediawiki/skins/GreyStuff/+/580103/

Future

I will contribute to Wikimedia even after GSoC. There are many interesting projects like Pywikibot, TWLight, toolforge and many more Which seem interesting to me. I will learn a lot working on them. I want to become a core contributor of Wikimedia. The mentors at Wikimedia are really very good. They are very helpful. They have guided me all way long. Some of the people I have interacted with include @Pavithraes, @D3r1ck01, Samwalton9, bd808 and Chicocvenancio.

Resources

University information

  • University name: Shri Mata Vaishno Devi University, Katra, Jammu and kashmir
  • Major: Computer Science & Engineering
  • Current year: 2nd Year
  • Expected graduation date: August 2022
  • Degree: Bachelor of Technology (B.Tech)

Event Timeline

Rohan-cod edited subscribers, added: Chicocvenancio, Samwalton9-WMF; removed: bd808.
Rohan-cod edited subscribers, added: bd808; removed: Samwalton9-WMF, Chicocvenancio.

Hi @Aklapper, I mentioned three members in my task description and they got automatically added to the list of subscribers. Now I am not able to edit the list of subscribers. What should I do?

@Rohan-cod: Anyone can edit the list of subscribers. Either via Add Action... or Edit Task.

Is it fine if they are added to this task as I have to mention them in my task description?

Please feel free to ping me if you need something specific.

@Rohan-cod Hi! Thanks for your proposal. I hope that you are already in touch with potential mentors of this project as it would be nice if you could get early feedback from them. If for some reason you are not able to reach out to them, please let me know!

Hi @srishakatux, I will surely let you know if I face any problems. Thank you :)

Hi @Rohan-cod, thanks for your proposal and we'll begin reviewing soon. Could you create a clone of this on Google Docs for better review (inline, discussions etc). When everything looks good (after we've provided feedback), you can then move it over here on Phab? Thanks!

When you do that, share the link to the Google Doc to all mentors so we can begin reviewing your proposal. :)

I have already made a Google doc. Here's the link.

I have already made a Google doc. Here's the link.

Thanks!

In T247398#5979117, @D3r1ck01 wrote:

I have already made a Google doc. Here's the link.

Thanks!

You’re welcome :)

@Rohan-cod We are sorry to say that we could not allocate a slot for you this time. Please do not consider the rejection to be an assessment of your proposal. We received over 100 quality applications, and we could only accept 14 students. We were not able to give all applicants a slot that would have deserved one, and these were some very tough decisions to make. Please know that you are still a valued member of our community and we by no means want to exclude you. Many students who we did not accept in 2019 have become Wikimedia maintainers, contractors and even GSoC students and mentors this year!

If you would like a de-brief on why your proposal was not accepted, please let me know as a reply to this comment or on the ‘Feeback on Proposals’ topic of the Zulip stream #gsoc20-outreachy20. I will respond to you within a week or so. :)

Your ideas and contributions to our projects are still welcome! As a next step, you could consider finishing up any pending pull requests or inform us that someone has to take them over. Here is the recommended place for you to get started as a newcomer: https://www.mediawiki.org/wiki/New_Developers.

If you would still be eligible for GSoC next year, we look forward to your participation!