Wesalius created this task.
Wesalius added a subscriber: Wesalius.
Wesalius added a project: Pywikibot-category.py.
Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION
After moving categories on w:cs with category.py move there are no sortkeys.
In this [[ https://cs.wikipedia.org/w/index.php?title=Kategorie%3ASmlouvy_Alb%C3%A1nie… | diff]] you can see an example.
I tagged with high priority, since this bots work has to be fixed manually (usually in lots of categorized pages) since the sortkeys are important.
TASK DETAIL
https://phabricator.wikimedia.org/T95804
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Wesalius
Cc: pywikipedia-bugs, Wesalius, Aklapper
JAnD created this task.
JAnD added a subscriber: JAnD.
JAnD added projects: pywikibot-core, Pywikibot-interwiki.py.
Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION
Interwiki bot (core) crashes on redirected categories.
pwb.py interwiki -family:wiktionary -start:category:! -lang:sg
```
Retrieving 10 pages from wiktionary:de.
WARNING: D:\pwb\pywikibot\family.py:900: FamilyMaintenanceWarning: Family name w
ikimediachapter does not match family module name wikimedia
Retrieving 10 pages from wiktionary:uz.
Retrieving 10 pages from wiktionary:ro.
Retrieving 10 pages from wiktionary:tn.
Dump sg (wiktionary) appended.
Traceback (most recent call last):
File "D:\pwb\pwb.py", line 213, in <module>
run_python_file(filename, argv, argvu, file_package)
File "D:\pwb\pwb.py", line 82, in run_python_file
main_mod.__dict__)
File ".\scripts\interwiki.py", line 2645, in <module>
main()
File ".\scripts\interwiki.py", line 2620, in main
bot.run()
File ".\scripts\interwiki.py", line 2360, in run
self.queryStep()
File ".\scripts\interwiki.py", line 2333, in queryStep
self.oneQuery()
File ".\scripts\interwiki.py", line 2329, in oneQuery
subject.batchLoaded(self)
File ".\scripts\interwiki.py", line 1455, in batchLoaded
elif page.isEmpty() and not page.isCategory():
File "D:\pwb\pywikibot\page.py", line 688, in isEmpty
txt = self.get()
File "D:\pwb\pywikibot\tools.py", line 869, in wrapper
return obj(*__args, **__kw)
File "D:\pwb\pywikibot\page.py", line 354, in get
self._getInternals(sysop)
File "D:\pwb\pywikibot\page.py", line 386, in _getInternals
raise self._getexception
pywikibot.exceptions.IsRedirectPage: Page [[tn:Category:Inli]] is a redirect pag
e.
<class 'pywikibot.exceptions.IsRedirectPage'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
```
Also it does not work correctly with -ignore parameter
```
D:\pwb>pwb.py interwiki -family:wiktionary -lang:sg -start:category:! -whenneede
d -untranslated -ignore:tn:category:Inli
Traceback (most recent call last):
File "D:\pwb\pwb.py", line 213, in <module>
run_python_file(filename, argv, argvu, file_package)
File "D:\pwb\pwb.py", line 82, in run_python_file
main_mod.__dict__)
File ".\scripts\interwiki.py", line 2645, in <module>
main()
File ".\scripts\interwiki.py", line 2486, in main
if globalvar.readOptions(arg):
File ".\scripts\interwiki.py", line 581, in readOptions
self.ignore += [pywikibot.Page(None, p) for p in arg[8:].split(",")]
File "D:\pwb\pywikibot\tools.py", line 869, in wrapper
return obj(*__args, **__kw)
File "D:\pwb\pywikibot\tools.py", line 869, in wrapper
return obj(*__args, **__kw)
File "D:\pwb\pywikibot\page.py", line 1858, in __init__
super(Page, self).__init__(source, title, ns)
File "D:\pwb\pywikibot\page.py", line 133, in __init__
% (type(source), source))
pywikibot.exceptions.Error: Invalid argument type '<type 'NoneType'>' in Page co
nstructor: None
<class 'pywikibot.exceptions.Error'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
```
TASK DETAIL
https://phabricator.wikimedia.org/T89809
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: JAnD
Cc: pywikipedia-bugs, JAnD, Aklapper, jayvdb
JAnD created this task.
JAnD added a subscriber: JAnD.
JAnD added projects: pywikibot-core, Pywikibot-interwiki.py.
JAnD changed Security from none to none.
TASK DESCRIPTION
Interwiki skips some languages without error mesage, even if they are defined in user-config.py and in compat it worked correctly
(manual selecting of correct links needed)
`pwb.py interwiki -async -family:wiktionary pl:Kategoria:Języki -neverlink:pl`
```
...
Changes to be made: Robot: Modifying [[pl:Kategoria:Indeks slow wg jezykow]] to [[pl:Kategoria:Jezyki]]
@@ -85 +85 @@
- [[pl:Kategoria:Indeks slow wg jezykow]]
+ [[pl:Kategoria:Jezyki]]
@@ -129 +129 @@
- [[zu:Category:Zonke izilimi]]
+ [[zu:Category:Zonke izilimi]]
NOTE: Updating live wiki...
Page [[ta:px?pxp?:m?r?xlx]] saved
WARNING: wiktionary: [[zh-min-nan:fen?:Gi-gian]] does not link to [[pl:Kategoria:Jezyki]] but to [[pl:Kategoria:Indeks slow wg jezykow]]
WARNING: wiktionary: [[simple:Category:Languages]] does not link to [[pl:Kategoria:Jezyki]] but to [[pl:Kategoria:Indeks slow wg jezykow]]
WARNING: wiktionary: [[roa-rup:Category:Limbe]] does not link to [[pl:Kategoria:Jezyki]] but to [[pl:Kategoria:Indeks slow wg jezykow]]
***
Waiting for 63 pages to be put. Estimated time remaining: 0:02:06
```
TASK DETAIL
https://phabricator.wikimedia.org/T76452
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
To: JAnD
Cc: pywikipedia-bugs, JAnD, jayvdb
JAnD created this task.
JAnD added a subscriber: JAnD.
JAnD added projects: pywikibot-core, Pywikibot-interwiki.py.
TASK DESCRIPTION
`pwb.py interwiki.py -pagegenerators -whenneeded`
tries to update wikis, which have no username defined in user_config.py
Bot freezes for a while, then skips
In compat bot skips this pages without try.
TASK DETAIL
https://phabricator.wikimedia.org/T86628
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: JAnD
Cc: Aklapper, JAnD, jayvdb, pywikipedia-bugs
jayvdb created this task.
jayvdb added a subscriber: jayvdb.
jayvdb added a project: Pywikibot-solve-disambiguation.py.
jayvdb changed Security from none to none.
TASK DESCRIPTION
A disambiguation page which include a disambiguation disambiguator should not be 'solved'.
i.e. a link to [[!! (disambiguation)]] is obviously an intentional link, and shouldnt be solved.
On English Wikipedia, we create [[foo (disambiguation)]] -> [[foo]] redirect pages when [[foo]] is a disambiguation page, so that [[foo (disambiguation)]] can be to be used when intentionally linking to a dab page.
TASK DETAIL
https://phabricator.wikimedia.org/T85052
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb
Cc: Aklapper, jayvdb, pywikipedia-bugs
happy5214 created this task.
happy5214 added subscribers: happy5214, Legoktm, gerritbot, rmoen, EBernhardson, NiharikaKohli, Capt_Swing, Qgil, jayvdb, Mattflaschen, Xqt, Ricordisamoa, Multichill, Ladsgroup, pywikipedia-bugs.
happy5214 added projects: Outreachy-Round-10, Google-Summer-of-Code-2015, Collaboration-Team, Patch-For-Review, Possible-Tech-Projects, Flow, pywikibot-core, Pywikibot-General.
Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION
My name is Alexander Jones, and I want to implement Flow support in Pywikibot.
=Personal info and past contributions==
I am currently a sophomore at Northwest Vista College, a community college in San Antonio, Texas. My major is computer science, and I currently have a perfect 4.0 GPA. I know several different programming languages, including Java, PHP, Python, Perl, and Lua. Examples of my programming work can be found at my Github page (https://github.com/happy5214); especially notable are my current FILG (Python) and RPPDb (PHP) projects.
I have previously contributed to Mediawiki, submitting small patches to the Scribunto and WikiEditor extensions. But my biggest contributions to Wikimedia projects have been my edits to the English Wikipedia and Wikidata, which each number over 8,000. Part of my work on both has been creating Lua modules, particularly for road-related topics. I single-handedly devised the framework now used by several road templates, using a database of format strings and specially arranged tables to represent shield, link, abbreviation, and name formats for highway types around the world.
=Why I want to work on this=
Some of my work has brought me to Pywikibot. I currently operate HappyBot on enwikipedia using two Pywikibot scripts, which I will post momentarily. Each script updates a series of tables in my userspace using data collected from the catscan2 tool. The scripts run daily and have proven to be reliable, with the exceptions of catscan2 outages.
I love what Flow is trying to do. As a nut for structure, I love the organized nature of discussions that is a goal for Flow. I hope to help promote Flow and contribute workflow descriptions later on. For me, having a coded and formal framework for community processes would be perfect for my view of order.
=Goals=
Obviously, I want to have working code in Pywikibot that can interface with Flow objects through the MediaWiki API by the end of the coding period. But doing that would have to involve learning the codebases of both Pywikibot and Flow, learning and using the testing system, and figuring out the API.
During this project, I hope to:
# Establish working relationships with the Pywikibot and Flow teams.
# Learn prerequisites, including the MW API, Travis-CI and the testing framework, and the respective codebases and conventions of Pywikibot and Flow.
# Create an initial implementation of Flow support in Pywikibot.
# Test frequently, including in live testing environments and using Flow-specific and generic constructs where appropriate.
# Finish a stable implementation of Flow support in Pywikibot.
# If time allows, add a version-tracking construct to enable/disable specific Flow features as appropriate.
=Time=
I start my summer around May 18, so I can certainly start work by then. I hope to start my prerequisite research sooner than that, having most of it completed by the start of the coding period. The end of my summer vacation should be the last week-or-so of August. I will file a more detailed plan later.
=Other=
* I am only eligible for GSoC.
* I do not have any other fixed commitments for this summer.
I hope you will accept my (almost late) proposal. Thank you.
TASK DETAIL
https://phabricator.wikimedia.org/T93991
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: happy5214
Cc: pywikipedia-bugs, Ladsgroup, Multichill, Ricordisamoa, Xqt, Mattflaschen, jayvdb, Qgil, Capt_Swing, NiharikaKohli, EBernhardson, rmoen, gerritbot, Legoktm, Aklapper, happy5214, Imaculate, matthiasmullie, Gryllida, Spage, Quiddity
akashagarwal created this task.
akashagarwal claimed this task.
akashagarwal added subscribers: akashagarwal, happy5214, Legoktm, gerritbot, rmoen, EBernhardson, NiharikaKohli, Capt_Swing, Qgil, jayvdb, Mattflaschen, Xqt, Ricordisamoa, Multichill, Ladsgroup, pywikipedia-bugs.
akashagarwal added projects: Google-Summer-of-Code-2015, Collaboration-Team, Possible-Tech-Projects, Flow, pywikibot-core, Pywikibot-General.
Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION
==Profile Information==
- Name: Akash Agarwal
- Email: akashslg(a)gmail.com
- IRC nickname: akashagarwal
- Github : https://github.com/akashagarwal/
- Resume : https://dl.dropboxusercontent.com/u/94374390/AkashAgarwal.pdf
- Location: Hyderabad, India (Time Zone - UTC+05:30)
- Typical working hours: 6:00 - 14:00 UTC & 17:00 - 21:00 UTC
==Synopsis==
Pywikibot is a collection of tools that allows one to automate work on a MediaWiki site. As per [[ http://stats.wikimedia.org/EN/BotActivityMatrixEdits.htm | Wikimedia stats ]] 910 M or 25.8 % of total edits are made by bots. So, Pywikibot is one the major projects for Wikimedia Foundation which 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 - [[ https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Breakfast | 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 enables 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 adding unit tests to interact with test Flow pages.
The code written as part of the project can be categories as:
==Part 1: Adding flow functionality in Pywikibot ==
This will be done by inheriting from the pywikibot base class BasePage. The main functionlities 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
- view-topiclist ( ApiFlowViewTopicList ) - example - http://en.wikipedia.org/w/api.php?action=flow&submodule=view-topiclist&page…
- view-post ( ApiFlowViewPost )
- view-topic ( ApiFlowViewTopic )
- view-header ( ApiFlowViewHeader )
- view-topic-summary ( ApiFlowViewTopicSummary )
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 April | Accepted student proposals will be announced |
| 27 April - 25 May | Community 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 May | Coding period begins |
| 25 May - 3 July | Part 1: Adding flow functionality in Pywikibot |
| 3 July | Mid-term evaluations due |
| 3 July - 20 July | Part 2: Unit tests |
| 20 July - 14 August | Reiterate based on feedback, solve bugs, Part 3: Server version tracking (optional) |
| 14 August - 21 August | Documentation, Solve Bugs |
| 21 August | Pencils down data |
| 28th August | Final Evaluations due |
==Past experience==
MediaWiki extension on Peer Evaluation - https://github.com/akashagarwal/peer-evaluation
==Microtasks==
https://gerrit.wikimedia.org/r/#/c/196450/ (T72965 and T85725)
TASK DETAIL
https://phabricator.wikimedia.org/T94131
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: akashagarwal
Cc: pywikipedia-bugs, Ladsgroup, Multichill, Ricordisamoa, Xqt, Mattflaschen, jayvdb, Qgil, Capt_Swing, NiharikaKohli, EBernhardson, rmoen, gerritbot, Legoktm, happy5214, Aklapper, akashagarwal, Imaculate, matthiasmullie, Gryllida, Spage, Quiddity
Silvonen created this task.
Silvonen added a subscriber: Silvonen.
Silvonen added a project: Pywikibot-category.py.
Silvonen changed Security from none to none.
TASK DESCRIPTION
category.py now crashes after every move. I didn't check what it is actually trying to do, but this doesn't seem to affect the end result.
Test run on fiwiki:
>category.py move
Please enter the old name of the category: Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat
Please enter the new name of the category: Parhaan elokuvan Oscar-palkinnon saaneet elokuvat
Page Luokka:Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat moved to Luokka:Parhaan elokuvan Oscar-palkinnon saaneet elokuvat
Page Luokka:Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat is moved and no longer exist.
Getting [[Luokka:Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat]] list...
Getting 60 pages from wikipedia:fi...
...
Traceback (most recent call last):
File "D:\git\pywikipedia\category.py", line 1079, in <module>
main()
File "D:\git\pywikipedia\category.py", line 1049, in main
bot.run()
File "D:\git\pywikipedia\category.py", line 512, in run
self.oldCat.delete(reason, confirm, mark=True)
File "D:\git\pywikipedia\wikipedia.py", line 3765, in delete
self._getActionUser(action='delete', sysop=True)
File "D:\git\pywikipedia\wikipedia.py", line 2018, in _getActionUser
self.site().forceLogin(sysop=sysop)
File "D:\git\pywikipedia\wikipedia.py", line 6719, in forceLogin
if not self.loggedInAs(sysop=sysop):
File "D:\git\pywikipedia\wikipedia.py", line 6713, in loggedInAs
self._load(sysop=sysop)
File "D:\git\pywikipedia\wikipedia.py", line 7772, in _load
data = query.GetData(params, self, sysop=sysop)
File "D:\git\pywikipedia\pywikibot\support.py", line 118, in wrapper
return method(*__args, **__kw)
File "D:\git\pywikipedia\query.py", line 150, in GetData
data=data)
File "D:\git\pywikipedia\wikipedia.py", line 7239, in getUrl
back_response=True)
File "D:\git\pywikipedia\pywikibot\comms\http.py", line 97, in request
if not no_hostname and site.cookies(sysop = sysop):
File "D:\git\pywikipedia\wikipedia.py", line 6797, in cookies
self._loadCookies(sysop=sysop)
File "D:\git\pywikipedia\wikipedia.py", line 6829, in _loadCookies
% (self.family.name, self.lang))
pywikibot.exceptions.NoUsername: You tried to perform an action that requires admin privileges, but you haven't
entered your sysop name in your user-config.py. Please add
sysopnames['wikipedia']['fi']='name' to your user-config.py
>python version.py
Pywikibot: [https] r-pywikibot-compat.git (925d931, g11106, 2014/11/29, 15:08:51, ok)
Release version: 1.0b1
Python: 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
TASK DETAIL
https://phabricator.wikimedia.org/T76687
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
To: Silvonen
Cc: Aklapper, Silvonen, pywikipedia-bugs
jayvdb created this task.
jayvdb claimed this task.
jayvdb added a subscriber: jayvdb.
jayvdb added a project: pywikibot-core.
jayvdb changed Security from none to none.
TASK DESCRIPTION
The Page save logic uses the 'cosmetic changes' script, which is not currently packaged with the Pywikibot library.
[[https://www.mediawiki.org/wiki/Requests_for_comment/pywikibot_2.0_packaging…]]
TASK DETAIL
https://phabricator.wikimedia.org/T76320
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
To: jayvdb
Cc: pywikipedia-bugs, jayvdb
VcamX created this task.
VcamX claimed this task.
VcamX added subscribers: Aklapper, NiharikaKohli, JeanFred, Legoktm, Qgil, Ricordisamoa, Halfak, Krinkle, jayvdb, valhallasw, MZMcBride, csteipp, pywikipedia-bugs, VcamX.
VcamX added projects: Outreachy-Round-10, Google-Summer-of-Code-2015, Pywikibot-network, Pywikibot-login.py, Possible-Tech-Projects, Google-Code-in-2014, pywikibot-core, Pywikibot-General.
TASK DESCRIPTION
# Implement OAuth Support for Pywikibot
## Abstraction
This project is focusing on implement OAuth support for Pywikibot, which is a collection of tools that automate work on MediaWiki sites. OAuth will offer a more reasonable, safe and robust way to identity authentication for users who use Pywikibot to maintain their MediaWiki sites.
## Name and contact information
- Name: Jiarong Wei
- Email: vcamx3(a)gmail.com
- IRC Nickname: VcamX
- Blog: [http://vcamx.net](http://vcamx.net)
- GitHub: [https://github.com/VcamX](https://github.com/VcamX)
- Resume: [http://vcamx.net/resume/](http://vcamx.net/resume/)
- Location: Hangzhou, Zhejiang
- Typical working hours: (UTC+8:00) 9:30 AM to 17:00 PM. Waking hours are 8:30 AM to 23:00 PM.
## Synopsis
OAuth is a popular open standard which allows third-party applications to access sensitive resources on some websites on behalf of users. Usually if applications have to access some user's data on other websites, users may expose their username and password to those applications, which may cause the risk of leaking information. OAuth uses tokens as the solution. Applications would get tokens instead of users' name and password. Different token means different privilege. Tokens can be assigned and revoked. Applications can only access resources which users want them to access.
As a typical toolkit of MediaWiki, it's important for Pywikibot to supply reasonable, safe and robust authentication method to users. MediaWiki support OAuth 1.0a through OAuth extension. Considering its rule as an automatic tool of cooperating people to manage wiki sites, it may involve high level account, like sysop account. If users are less careful, they could also leak their password through logs. Leaking of such information is very serious. So it's reasonable to assign tokens (limited privilage) instead of password (unlimited privilage) to applications which serve MediaWiki projects, e.g. Pywikibot. Thus, besides default password-authentication method, supporting OAuth for Pywikibot is a necessary and urgent mission.
Possible mentors: jayvdb and Hallfak
## Deliverables
According to the description of [T74065](https://phabricator.wikimedia.org/T74065) on Phabricator, the requirement is very clear:
### 1. OAuth support
The implmentation of OAuth 1.0a support.
### 2. Unit tests and deploying
Two mandatory unit tests:
- A unit test should perform a login and logout using OAuth with assertions that verify APISite._userinfo is correct.
- A unit test should login, edit a userpage, and confirm the edit was performed using the OAuth-authenticated account.
These two are mandatory, but I have to assume that more tests may be needed since more requirements for test could arise during the development.
The unit tests should be configured to run on Travis CI when the secret key is available in the Travis CI configuration, and skipped when it isn't.
### 3. Documentation
OAuth is a new authentication method for Pywikibot. So supplying a How-to document about its usage is necessary. Also, docs for developers may be needed.
## Timeline
- **Before May 25, 2015**
- Plan and confirm implementation details (see below).
- Implement OAuth support.
- **May 25, 2015 (Students begin coding for their Google Summer of Code projects) to June 25, 2015**
- Implement OAuth support.
- **June 26, 2015 (Mentors and students can begin submitting mid-term evaluations) to Aug 16, 2015**
- Implement two mandatory unit tests (maybe more if needed) and deploy test running on Travis CI.
- Write How-to and other related documents.
- Fix bugs.
- **Aug 17, 2015 (Suggested 'pencils down' date) to August 21, 2015 (Firm 'pencils down' date)**
- Finish the final report, present the result to the community and Google.
- **August 28, 2015 (Students can begin submitting required code samples to Google)**
- Submit required code samples to Google.
## Project Details
### Preparation
I'd like to seperate it into three parts:
1. Get familiar with Pywikibot code and MediaWiki API
2. Get familiar with OAuth-related knowledge, libraries (e.g. MediaWiki-OAuth) and OAuth extension of MediaWiki software
3. Get familiar with Pywikibot test code, Travis CI and its configuration
4. Build development environment
Frankly speaking, I just started to touch Pywikibot and MediaWiki software on Februray this year. I'm getting familiar with code of Pywikibot and inner implementation. With the help of jayvdb and Nullzero, I've solved some bugs ([T74974](https://phabricator.wikimedia.org/T74974) and [T57140](https://phabricator.wikimedia.org/T57140)) of Pywikibot-login.py and got them merged. I built local MediaWiki site, installedfor testing and bug replication by using Bitnami stack. Also I read the source code of MediaWiki-OAuth and got to know the usage of Travis CI.
I think the preparation for me is mostly done.
### Planning
Mentors discussed about the implementation details on [Phabricator](https://phabricator.wikimedia.org/T74065). Thanks to Halfak's work, there is a generic OAuth handshake helper in Python, MediaWiki-OAuth, dedicated to MediaWiki OAuth. This really does a big favor for me. So what's left is how to sign new requests with the AccessToken achieved through MediaWiki-OAuth, just as Halfak said. As a conclusion of the discussion, there are two available schemas for signing new requests. The first one is sticking to httplib2 and implementing our own signing strategy with oauthlib. The second one is switching from httplib2 to requests as HTTP communication handler and using requests-oauthlib to signing requests. I've done some investigation for this. And I think these two different schemas focus on different points.
The first schema is to implement our own OAuth signing strategy. It's more relevant to this project considering the goal of this project, that's we're coding OAuth. However, as Halfakk said, this will be hard to do and need some experienced guys to review the implementation. The bug of authentication is vital.
The second schema is more about migrating I think. Since requests and requests-oauthlib support OAuth 1/2 natively and are widely used, the robusty of OAuth authentication is more reliable. But considering conisistency, it's not sensible to use requests/requests-oauthlib and httplib2 simultaneously in my opinion. So migrating to requests/requests-oauthlib is necessary. Pywikibot doesn't just use httplib2 directly, it adds some add-ons, e.g. cookies-support, multi-thread and connection-pool. So confirming requests has equivelant functions and implementing some wrappers for requests is the main point.
Both schemas have their own pros and cons. Httplib2 is more historical and compact. Requests is more popular and powerful. It's hard to judge which one is much better. But I think it's more painful to fully migrate to requests since httplib2 is integrated so tightly in Pywikibot. A lot of work had been done for adaptation. Migrating may be less meaningful considering we are just need OAuth. So I prefer the first schema. That's just my opinion for this delimma. (I don't have any strong bias for this. Both schemas make sense for me. Discussion with two mentors is necessary.)
There are some other implementation details need to be considered: storing keys and tokens for OAuth, Site object adaptation, exception catching and so on.
### Implementation details
#### OAuth implementation
According to the requirement of OAuth implementation, some changes and updatation are needed:
1. **pywikibot/comms**: This is a sub-package which provide basic HTTP request/response handlers. So, MediaWiki-OAuth need to be integrated here to handle OAuth handshakes between Pywikibot and web server. Signing requests with access token when using OAuth authentication also goes here. The first schema need to extend **pywikibot/comms/threadedhttp.py** by adding our own OAuth requests signing. The second schema is more complicated. Most parts of **pywikibot/comms/http.py** and **pywikibot/comms/threadedhttp.py** need to changed (There's a [commit](https://gerrit.wikimedia.org/r/#/c/189821/) on Gerrit about this, which is mentioned on the discussion on Phabricator).
2. **pywikibot/config2.py**: This works as a template for user-config.py which is provided by users. Since OAuth is different from password authentication, we need to add new configuration items here.
3. **pywikibot/login.py**: This is the implementation of basic login mechanism. So this module need update.
4. **pywikibot/data/api.py**: This contains a wrapper for LoginManager in pywikibot/login.py, so I have to assume this also need to be updated.
5. **pywikibot/site.py**: This contains the abstraction of wiki sites. So if users choose to use OAuth, the access token might be stored in Site object and also have some flags indicating that.
6. **pywikibot/exception.py**: This contains exceptions might be throwed. Exceptions which inform users about what's wrong during OAuth authentication need to be added.
#### Unit tests
For OAuth support, we should test that Pywikibot could achieve the right user identity through OAuth authentication and use the identity obtained to perform proper actions.
My opinion is to add an individual test like **pywikibot/test/oauth_tests.py**, under **pywikibot/test**, so the two mandatory tests or more related tests could go there. Also, to support these tests, something may be needed:
1. **pywikibot/test/aspects.py**: This module provides some building blocks for tests. The **RequireUserMixin** provides user login checking. The **MetaTestCaseClass** provides metadata for configuration. The corresponding code may be added to these class. Also, we should provide something like OAuthSiteTestCase other than DefaultSiteTestCase to distinct two authentication methods. And it'll be used in our tests
2. **pywikibot/test/http_tests.py**: This is for **pywikibot/comms**. So all tests should be passed and additional tests may be needed here if we choose to migrating to requests library from httplib2.
#### Documentation
This part may include comments in code, documentation in Pywikibot's manual and documentation for developers.
The comments in code should be meaningful and concise.
The How-to documentation for the usage of OAuth authentication could be added to [Manual:Pywikibot/Basic use](http://www.mediawiki.org/wiki/Manual:Pywikibot/Basic_use)
The documentation for developers should describe the idea of design and the basic structure for convenience of bug fixing and improvement.
#### Note
The implementation details above is based on what I understand about the code by now. if there are bugs or mistakes, I'll appreciate if you could point them out and help me fix them, so I improve the details :D
## Participation
### Communication of progress
- IRC Channel: This is always my first option for help whenever I am stuck at something. I'll be available on IRC channels, pywikibot and wikimedia-dev, by the nickname VcamX.
- Mailing list: I suscribed to mailing lists such as wikitech-l and Pywikipedia-l. If I can't get instant response, mailing list is my second choice.
- Weekly report: Weekly report is helpful for summing up, reviewing what I have done and what I need to change. It's a good way of communicating progress.
### Publishing source code
- Gerrit: Wikimedia Code Review
### How and where you plan to ask for help?
- Try to solve by my self: read documentation, search online and so on.
- Ask help from the mentors and community through IRC and mailing list.
## About me
**Education completed or in progress**
B.S. in Computer Science, Zhejiang University, Hangzhou, China
**How did you hear about this program?**
I searched for organizations available on GSoC 2014 and found MediaWiki. On its Phabricator, I found this project seems good for me. This project was for GCI 2014 originally and I was not sure whether it's available on GSoC 2015. Then I got confirmation from jayvdb. So, I think that's it.
**Will you have any other time commitments, such as school work, another job, planned vacation, etc., during the duration of the program?**
Before June (included), I must spend some time on my graduation project and graduation affairs, so I decide to start coding earlier for compensating the loss.
**We advise all candidates eligible to Google Summer of Code and FOSS Outreach Program for Women to apply for both programs. Are you planning to apply to both programs and, if so, with what organization(s)?**
Only GSoC.
## Past experience
### FOSS Projects
**[Xapian](http://www.xapian.org)**
Xapian is an Open Source Search Engine Library written in C++. In GSoC 2014, my work is mainly focusing on refactoring the LETOR module. [Link](https://www.google-melange.com/gsoc/project/details/google/gsoc2014/v…
### Personal Repositories
[GitHub](https://github.com/VcamX)
[BitBucket](https://bitbucket.org/VcamX)
### Relevant projects
I've been using Python for many years. I like its conciseness and power.
During the second year of university, I took an part-time internship at a small startup in Hangzhou, China. My job is to write Web spiders using Python for B2C online retailers in Mainland China: Tmall/Taobao, JD.com, Amazon and Yixun. As a course project, I used Django to build a website for comparing price, which has a back end service for scrap the price and a front end for displaying the detailed information of goods. Also, my group's course project of Information Retrieval is a tiny picture search engine based on Python and MIRFLICKR dataset. It can search by both text and picture. I implemented the text search by using TF-IDF and the website front end based on Flask and JavaScript.
Besides those, I wrote some Python code for fun. I also have project experience of C/C++, Java.
### Interested projects
I like writing Python code. Pywikibot is what I need. I don't apply for other projects. For me, concentrating on one single project is better than diffusing energy on many projects. Focusing makes me more efficient.
## Any other info
MediaWiki Foundation is one of the greatest nonprofit organization around the world. I benefited so much from Wikipedia and its sibiling projects as everyone on earth. I'm very willing to get involved in Pywikibot project and MediaWiki to learn and contribute.
TASK DETAIL
https://phabricator.wikimedia.org/T93352
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: VcamX
Cc: VcamX, csteipp, MZMcBride, valhallasw, jayvdb, Krinkle, Halfak, Ricordisamoa, Qgil, Legoktm, JeanFred, NiharikaKohli, Aklapper, Imaculate, pywikipedia-bugs