Page MenuHomePhabricator

GSoC proposal: Implement Flow support in Pywikibot
Closed, DuplicatePublic

Description

Profile Information

Synopsis

Pywikibot is a collection of tools that allows one to automate work on a MediaWiki site. As per Wikimedia stats 910 M or 25.8 % of total edits are made by bots. So, Pywikibot is one the major projects for Wikimedia Foundation. Pywikibot makes consuming the MediaWiki API simple for bot developers.

Flow, the new communication extension for MediaWiki is not supported by Pywikibot. When the Flow extension is installed and Flow is enabled on a page (usually a Talk page - example), the page becomes a Flow board (the content model property changes to 'flow-board' instead of 'wikitext'). The content in such a page is quite different from a general wiki page (For example, Flow stores a revision per post not per article and flow data can be on a different database. Also, several wikis may use the same database for flow ). As a result, the API calls for a general wiki page will not work for Flow enabled pages. Flow has an extensive set of API’s which needs to be implemented in Pywikibot.

Possible mentors : @jayvdb, @Mattflaschen, @Legoktm

Deliverables

As per T67119 the main goal of this project will be to implement the concepts of Flow as Pywikibot classes and add unit tests to interact with test Flow pages.

The code written as part of the project can be categorized as:

Part 1: Adding flow functionality in Pywikibot

This will be done by inheriting from the pywikibot base class BasePage. The main functionalities will be added in page.py or in a new flow.py.

Basic Flow information

Add the API Action = query,prop = flowinfo in Pywikibot, which should give the basic flow information about a page. Already implemented ( https://gerrit.wikimedia.org/r/#/c/132767/) but we may need to modify and/or add unit tests. Also, it may be needed to update prop = info in Pywikibot.

Flow API

These include the read and write API consisting of submodules of action=flow.

GET - Read API’s ( with corresponding Flow classes that needs to be implemented )

POST - Write API’s

  • new-topic ( ApiFlowNewTopic )
  • edit-header ( ApiFlowEditHeader )
  • edit-post ( ApiFlowEditPost )
  • edit-topic-summary ( ApiFlowEditTopicSummary )
  • reply ( ApiFlowReply )
  • moderate-post ( ApiFlowModeratePost )
  • moderate-topic ( ApiFlowModerateTopic )
  • edit-title ( ApiFlowEditTitle )
  • lock-topic ( ApiFlowLockTopic )
  • close-open-topic ( ApiFlowLockTopic )

Legoktm has added some related code at https://gerrit.wikimedia.org/r/#/c/187066/3 which may or may not be helpful.

Flow parsoid utility

Since, we have the Parsiod web API ( https://www.mediawiki.org/wiki/Parsoid/API ), I am not sure whether it would be relavent the add support for the action=flow-parsoid-utils API, which converts text between wikitext and HTML,in Pywikibot.

Part 2: Unit tests

As specified in T67119 , unit tests will be added to the test suite to interact with test Flow pages on a Flow enabled Wikimedia site (e.g. MediaWiki.org). The tests will interact with Flow objects using the Flow specific functionality, and interact with the same pages using the standard Page functionality where appropriate.

The unit tests will be configured to run on travis-ci , and Flow related tests run when the test site has Flow enabled, and Flow related tests will be skipped when Flow isn’t installed.

Part 3: Server version tracking (optional)

As Flow is being rapidly developed, we can expect changes in functionalities and different wikis may have several different versions of the Flow extension installed. It is important for Pywikibot to support them. If time permits, the Flow support will include server version tracking, so Flow features can easily be enabled/disabled as the Flow extension is enhanced.

Timeline

27 AprilAccepted student proposals will be announced
27 April - 25 MayCommunity bonding period. Get familiar with the Flow and Pywikibot developer community. Finalize plans for the project and go through the code base, read documentation.
25 MayCoding period begins
25 May - 3 JulyPart 1: Adding flow functionality in Pywikibot
3 JulyMid-term evaluations due
3 July - 20 JulyPart 2: Unit tests
20 July - 14 AugustReiterate based on feedback, solve bugs, Part 3: Server version tracking (optional)
14 August - 21 AugustDocumentation, Solve Bugs
21 AugustPencils down date
28th AugustFinal Evaluations due

Participation

I plan to be active on the MediaWiki and Pywikibot development channels and communicate regularly with Flow and Pywikibot developers. I believe that for such a project it is necessary to reiterate several times based on the feedback from the community. I plan to do so by pushing code to gerrit frequently and replying promptly to feedback received.
Will ask for help via IRC and mailing lists.

About me

I am a fourth year student at IIIT Hyderabad pursuing B.Tech + MS in Computer Science and Engineering. I will be completing my coursework this semester and will have one year left to complete the MS requirements. This will leave me with a lot of free time and so I plan to contribute to an open source organization.

Other time commitments

My exams end on 2 May after which I have a 3 month summer vacation. I plan to go for a 10 day vacation sometime during the period which I can decide with discussion with my mentors. Other than that I will be fully committed to GSoC.

Eligibility for Google Summer of Code and FOSS Outreach Program

Only eligible for GSoC.

Past experience

MediaWiki extension on Peer Evaluation - https://github.com/akashagarwal/peer-evaluation

Microtasks

https://gerrit.wikimedia.org/r/#/c/196450/ (T72965 and T85725)

References

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 27 2015, 2:11 AM
akashagarwal updated the task description. (Show Details)Mar 27 2015, 1:40 PM
akashagarwal set Security to None.

It appears I do have one with the same username.
https://www.mediawiki.org/wiki/Special:CentralAuth/Akashagarwal

Right. John forgot to remove "User:" from the URL ;-)