Page MenuHomePhabricator

[Proposal][Final] goodbot: a simple, friendly bot for Wikimedia Zulipchat
Closed, ResolvedPublic

Assigned To
Authored By
QEDK
Mar 17 2020, 5:42 PM
Referenced Files
F31734219: image_8.png
Apr 5 2020, 2:40 PM
F31734213: image_4.png
Apr 5 2020, 2:40 PM
F31734206: image_14.png
Apr 5 2020, 2:40 PM
F31734217: image_5.png
Apr 5 2020, 2:40 PM
F31734215: image_0.png
Apr 5 2020, 2:40 PM
F31734209: image_1.png
Apr 5 2020, 2:40 PM
F31734211: image_9.png
Apr 5 2020, 2:40 PM
F31734210: image_2.png
Apr 5 2020, 2:40 PM
Tokens
"Barnstar" token, awarded by srishakatux."Like" token, awarded by Ammarpad."Like" token, awarded by xSavitar.

Description

Profile

Name: QEDK
IRC nick: qedk
Working hours: 1300 - 2300 hours (UTC+05:30)

Summary

Always listening

Zulip-bot module is too nascent to use as full-fledged bot, instead we must make use of the core Zulip API and utilize its full functionality. The resulting bot will be a bot that records every message, waiting for a cue to activate, instead of only activating via a mention or private message trigger. This means that the bot can be summoned from anywhere with any message we want to summon it with.

image_0.png (346×1 px, 71 KB)

image_2.png (272×1 px, 37 KB)

image_1.png (210×1 px, 34 KB)

Fig 1.1 goodbot is always listening and can be summoned anywhere in various simple ways

Welcoming

The # announce stream announces all new signups, each signup will trigger a bot action from goodbot on the # general stream (Getting started topic). The bot will direct them to https://www.mediawiki.org/wiki/How_to_contribute , . https://www.mediawiki.org/wiki/New_Developers , https://www.mediawiki.org/wiki/Good_first_bugs , offer a list of available GSoC/GSoD/Outreachy commands and inform the participant about the !help command.

image_3.png (346×1 px, 75 KB)

Fig 2.1 goodbot actively detects new users to Wikimedia Zulipchat and provides kickstart resources

Replying and error control

If summoning the bot, the bot will helpfully give a list of commands and expect you to answer them, some commands (such as faq) expect additional commands, so each command will have a failsafe to not trigger an error, as well as helpful follow-ups like "if you intended to ask a question, type !help faq your-question".

image_4.png (298×1 px, 73 KB)

Fig 3.1 goodbot intelligently understands queries and uses a given list of FAQs to answer them

Organization-level assistance

The bot will seek to assist applicants about respective project ideas, guide them to instructions and GSoC/GSoD/Outreachy org-admins. The participant can request help by summoning the bot with a specific command such as !help gsoc, the bot will display further resources related to the outreach program and subscribe them to relevant streams.

image_5.png (532×1 px, 121 KB)

Fig 3.2 goodbot will provide targeted organization-specific help

Project-level assistance

The bot will seek to assist them with specific projects by directing them to respective mentors, Phab tasks and instructions about that particular project by dynamically accessing continually-updated resources.

image_6.png (341×441 px, 14 KB)

Fig 3.3 Planned project-level assistance workflow

Technical assistance

The bot will direct participants to technical IRC channels such as # wikimedia-tech, # pywikibot and other technical channels (with configurable options) when requested.

image_7.png (464×1 px, 94 KB)

Fig 3.4 goodbot will provide technical assistance by guiding users to help channels

Zulip-IRC bridge bot

The bot will also sync messages across a specific stream such as #technical-support stream on Zulipchat and Wikimedia technical IRC channels such as #wikimedia-tech to ensure proper and quick resolution of queries. This will be achieved in real-time without any human intervention.

image_8.png (780×2 px, 269 KB)

Fig 4.1 ircbot will provide real-time and seamless integration between Zulipchat and IRC *

Summoning user-groups

Since Zulip API does not allow bots to fetch user_groups, the bot will maintain its own database of user_groups, such as mentors for specific projects, GSoC/GSoD/Outreachy org-admins. The bot will provide resources to contact these user-groups as well the ability to send pings via Zulipchat itself.

image_9.png (244×2 px, 52 KB)

Fig 5.1 goodbot will quickly summon user_groups if other users require their help

CI/CD

We will use Travis CI for continuous integration, build verification and continuous deployment. We will use a mirror testbot and use integration testing instead of standard unit-testing and rely on preventive error control mechanisms, integration testing using the mirror-testbot should relay any errors instead of setting up expensive unit-testing methods that will bulk up bot packages.

image_10.png (526×2 px, 110 KB)

Fig 6.1 goodbot repository is set up for continuous integration

Toolforge deployment and integration

The entire pipeline of integration and deployment to Toolforge will be triggered by an event (either through Travis CI or GitHub Actions) carried out after the commit is pushed to production and results in a successful build. Setting up config files needs to be done on the production host itself as well as Travis, as well as integration testing in a staged production environment (such as a # test stream) that will be done using scripts in Travis CI.

Searching Wikipedia and StackOverflow

Wikipedia and StackOverflow can prove to be very helpful resources for applicants and participants. Both sites have strong, mature APIs and will be a very useful resource without needing to leave Zulipchat, also helpful in answering queries by mentors on why certain errors are occurring.

image_11.png (354×1 px, 75 KB)

image_12.png (598×1 px, 95 KB)

Fig 7.1 goodbot will allow users to quickly search necessary resources

Code quality

Extension documentation is always a prerequisite for maintaining code quality presently and in the future. Hence, I have provided ample time for documentation purposes, which we can host on GitHub wiki itself.

Another aspect of maintaining code quality is to enforce a consistent style guide and ensure absence of logical and syntactical errors in our project using a linter - preferably such as flake8, primarily for its speed and the lack of false-positives. It combines pyflakes (logical linting), pycodestyle (stylistic linting) and mccabe (cyclomatic complexity), thus making a well-rounded wrapper for overall Python linting. Linting will be automatically enforced in continuous integration via Travis-CI.

image_13.png (870×2 px, 117 KB)

Fig 8.1 Travis-CI will automatically lint all code with flake8 to ensure code quality is enforced

Dependency management will be handled by Dependabot. It seeks to serve as a drop-in solution for most repositories and works without any human intervention (except merging a pull request), saving time and effort on our side.

image_14.png (960×1 px, 97 KB)

Fig 8.2 Dependabot will automatically upgrade goodbot dependencies when necessary


  • Possible mentor(s): @Pavithraes @D3r1ck01 @Medhabansal
  • Have you contacted the mentor?** Yes, I've contacted the mentors via email and Zulipchat.

Timeline

PeriodTask
[x] May 4 to June 1
Community bonding period
Discuss requisites and prerequisites with mentors and identify most important features. Research about deployment on Toolforge and identify potential problems (proactive risk strategy). Also, talk to current and ex (if available) Outreachy, GSoC, GSoD participants and mentors, and see what features they would want in such a bot and how they would like it to be implemented.
[x] June 1 to June 7Start implementing core features for the bot, such as welcoming and replying to participants.
[x] June 8 to June 14Start implementing more user-facing features, such as intelligently answering questions based on given FAQs, links and subscribing them depending on whether they are an Outreachy/GSoC/GSoD participant as well as directing them to technical resources.
[x] June 15 to June 21Begin production deployment on Toolforge and iron out all possible errors.
[x] June 22 to June 28Testing Round 1: Exploratory testing and documentation. Get an MVP out the door.
[x] June 29 to July 3Phase I evaluation
[x] July 4 to July 10Take input from stakeholders such as volunteer developers, current and previous mentors and participants to gauge requirements of features. Identify and implement strategies to enable seamless message transfers between Wikimedia IRC channels and Zulipchat.
[x] July 11 to July 17Deploy bridgebot to production and iron out all possible kinks to ensure reliability and uptime.
[x] July 18 to July 23Implement a feature to allow the bot to intelligently determine projects and assist in the same by parsing MediaWiki project idea pages and matching it to queries.
[x] July 24 to July 27Testing Round 2: Exploratory testing, automated testing and documentation. Refine present features and strategize on what features to be added next.
[x] July 27 to July 31Phase II evaluation
[x] August 1 to August 7Allow setting of summon groups, such as "org-admins", “GSoC”, “Outreachy”. Participants can make use of these summon groups to summon them as well as get available details (such as email, IRC nick).
[x] August 8 to August 14Use goodbot's user_groups functionality to set up bot administration via on-stream commands.
[x] August 9 to August 15Implement search functionality from Wikipedia and StackOverflow.
[x] August 15 to August 21Testing Round 3: test robustness and recovery, set up failsafe measures.
[x] August 22 to August 27Freeze the codebase and iron out all kinks (bug fixes, production errors) before final deployment.
[x] August 28 to August 31Improve UX, prettify documentation, introduce bot to participants.
Submit project summaries and final evaluations.
[x] August 31 to September 7Mentors submit final student evaluations.
[x] September 8Final results of Google Summer of Code 2020 announced

Stretch goals

  • Contributor guide for new contributors
  • Allow bot admins to configure core messages, such as links to resources and welcome messages.
  • Possibility of expansion beyond GSoC/GSoD/Outreachy by increasing modularity in the code.
    • Google Code-In 2020 as a first priority. (cancelled)
  • Expand querying beyond Wikipedia and StackOverflow.
  • Gamification
    • Chatting with the bot!
    • Implement a feature to play games with the bot, such as Tic-Tac-Toe.

Deliverables

  • A user-friendly bot that can understand commands and assist new members to the Zulipchat realm.
  • A robust and reliable bot that has mechanisms in place that will restart by itself in case it fails.
  • An interactive bot that does exactly what it's asked with a 100% accuracy.
  • A bot that makes the org-admins' life easier by summoning them only when required.
  • A real-time Zulip-IRC bridgebot that functions seamlessly without any intervention.
  • Proper documentation about the functioning of the bot on the repository itself - to assist future volunteer developers to make new features.
  • High-quality code with potential for reusability and modularity.

Participation

  • I will communicate with mentors via email and Zulipchat. I am also active on WhatsApp if that's preferable.
  • I plan to deploy the development code to GitHub:https://github.com/QEDK/goodbot preferably under an MIT license. It can be branched into development and master/production branches to separate development from production code if required.
  • I will use Phabricator for managing tasks and subtasks.
  • The production code will be deployed to Toolforge, which will be synced via a deploy script running through Travis CI.
  • I will provide reports twice a week via Google Docs and publish a blog post at the end of the period on my Medium (https://medium.com/@ankittt) summarizing the entire experience.

About me

  • I am currently pursuing Bachelor's of Science in Computer Science (Honours). I expect to graduate in May 2021.
  • My friend from a nearby university successfully completed his GSoC project with FOSSASIA, we participated in hackathons together, during one of which he told me about this experience.
  • In the first week (of the community bonding period), I will have my semester exams but I expect to be available on most days. They are fairly spread out so I doubt that it will impact my availability. After my exams, I do not have any job or educational commitments as it will be my semester break period. I am confident I will be available for the entire duration of this project. I expect to give 350+ hours (estimating from 5x70) to this project.
  • I am only applying for GSoC '20. As of now, Wikimedia Foundation is the only organization I am applying to. Per eligibility requirements, I would also like to state that I have never participated in GSoC or Outreachy.
  • As someone who has been a long-time contributor to Wikipedia and someone who intends to be a part of the Wikimedia movement in the future as well, taking on the role of a student developer with the Foundation gives me the opportunity to give back to the project. Outreachy and GSoC do a good job of bringing excellent developer candidates directly in contact with people organizations such as the WMF. I believe I can make that process easier for those candidates, as well as expand my knowledge and involvement with the worldwide Wikimedia movement. It would mean a lot to me personally to be able to contribute positively towards making their onboarding process easier and giving deserving candidates a helping hand to begin contributing to the Wikimedia community. I would also like to keep contributing to this particular project to make it successful and also the Wikimedia movement as a whole.

Past experience

I've been a long-time contributor to Wikimedia projects (~10 years), I also hold the sysop and edit filter manager rights on the English Wikipedia and autopatrolled on a few others. I began contributing to the Twinkle codebase in 2012, a Gadget that is used by most editors contributing to Wikipedia. I am still an active contributor to the codebase:

I also assisted in the updating of Twinkle Bengali back in 2013 as their version was running out-of-date:

until it was localized and branched off via a Gadget as Twinkle is not yet i18n-ized.

I've interned with companies in the fields of data science and machine learning, unfortunately, most of my work there is covered by copyright and NDA. I've been reporting bugs on MediaWiki since the Bugzilla days, I've also contributed code to the Xtools project (1) and the Toolforge-hosted WHOIS tool (1, 2, 3) both of which are widely used by contributors.

Apart from this, I've recently worked on fixing Phabricator tasks tagged as "patch welcome" and "good first bug" some of which are in core MediaWiki:

I am also whitelisted as a long-term WMF contributor and volunteer developer (see gerrit commit). I have experience with Python, Java, JavaScript, C++ and C as a result of working with free open-source software and other projects. I also have experience with running tools on Toolforge (see my bot, ongoing request for approval and TF tool). I have deployed multiple Python apps (such as the one for Zulip-bot) on services like Heroku (a demo face detection app) and Microsoft Azure (learnt as part of a hackathon, link to repo) with different version control services (mostly Git), learning the technologies in the process.

Working with the Wikimedia community as well the local developer community has given me experience with community organization and collaboration, which has been enlightening for me. I've used and set up multiple bots (like Tatsumaki) on Discord which gives me an idea about suitable workflows for helpbots and chatbots.

Demo

The demo pictures can be found at https://phabricator.wikimedia.org/M298
Goodbot video demo: https://youtu.be/vz0l8wwemoE
Zulip-IRC bridgebot video demo: https://youtu.be/pH88rWM9vbI
The bot (currently run locally) is accessible on the private # goodbot stream on the Zulipchat channel.

Resources

Event Timeline

Hi @QEDK, 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. :)

In T247879#5979103, @D3r1ck01 wrote:

Hi @QEDK, 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. :)

Done now!
QEDK renamed this task from [WIP][Proposal] goodbot: a simple, friendly bot for Wikimedia Zulipchat to [Proposal][WIP Final] goodbot: a simple, friendly bot for Wikimedia Zulipchat.Mar 31 2020, 6:13 PM
QEDK updated the task description. (Show Details)
QEDK updated the task description. (Show Details)
QEDK updated the task description. (Show Details)
QEDK renamed this task from [Proposal][WIP Final] goodbot: a simple, friendly bot for Wikimedia Zulipchat to [Proposal][Final] goodbot: a simple, friendly bot for Wikimedia Zulipchat.Apr 5 2020, 2:40 PM
QEDK updated the task description. (Show Details)
QEDK updated the task description. (Show Details)
QEDK updated the task description. (Show Details)
QEDK moved this task from Inbox to In Progress on the User-QEDK board.
QEDK added a project: Goal.

Google-Summer-of-Code (2020) is over! I believe you have already documented your project here https://www.mediawiki.org/wiki/Google_Summer_of_Code/Past_projects#2020. If not, I would encourage you to do so. Also, is there anything else remaining in this task to address? If not, please consider closing this task as resolved.

This project was completed successfully. One subtask is open for future development.