| Friday, 10th June 2016 - 15:30 UTC (Note: Shifted to Sunday, 12th June, same time)
| jayvdb, darthbhyrava
Skype
Description: Third weekly project meeting.
Start: 15.30 UTC
End: 16.30 UTC
Agenda:
- Review prototypes for
- Discuss plan for next week:
- How to remove the requests/urllib2 approach, and use site.py to make the API calls.
- Adding User.thanks_enabled property for Subtask 1.
- Assessing the Special:Log/thanks approach for thanks_tests. (How do I test when logging is disabled?)
- Plan for Subtask 2 - T135411 (Where does the Flow code go?)
- Review other tasks defined in minutes of T136892: GSoC: Pywikibot-Thanks | Meeting 4 | 3rd June
- Brief review of MVP requirements.
Minutes of the Meeting
.
Prototype Review: thanks.py
Looking at the thank code in P3232, and fixing it.
- Workflow is as follows: login, get token using Token API, then use urlib2/requests to make a POST request for the Thanks API call.
- Issue: The current code throws a badtoken error, despite having a token which works on APISandbox.
- Unsuccessful Attempts to fix the issue:
- Escape the +\ at the end of the token string, as suggested here and as suggested by @polybuildr
- Shift from using a urllib2 approach to a requests approach, as suggested by @AbdealiJK
- Issue Fixed by jayvdb: Different sessions for token call and thank call, hence badtoken. To keep the same session alive, from pywikibot.comms.http import session.
- Successful proof of concept P3234 which thanked this edit.
Prototype Review: thanks_tests.py
Reviewing the unittests. The plan is to make an edit to test.wikipedia, thank it using the thanks.py script, and then check with unit_tests if the thank action worked.
- Change Line 21 from code = en to code = test since we we will be using test.wikipedia.
- Remove the dry param. We want to make an actual edit to test, not simulate one.
- Editing test: Get add_text to write to test, and get corresponding rev_id.
- Thanking the edit: Get thanks to thank the edit based on the rev_id.
- Checking thanks: Extract the Special:Log/thanks page before and after the thanks, and compare. If there is a new entry from logged in user, thanks was successful.
- Add a note to the test suite indicating that this process relies on two features which may be considered bugs:
- The fact that you can thank yourself.
- The fact that even if thanks notifs are disabled for the recipient, it'll still show up on the log, since logging is a server related activity.
User.thanks_enabled property.
- Core question to answer: How can the MediaWiki API determine whether or not a user has thanks notifications enabled? Investigate.
- One approach: extract the thanked_user from the log, and then extract the thanks_enabled property and check. This may work, it is not a very good approach, though.
- New user, just joined wiki, how do you check if thanks is enabled? Is the preference for thanks of the user exposed via the MediaWiki API? If it is, how do we access it? If it isn't exposed, then it is not possible for us to account for it in pywikibot, either.
- Since a lot of these functionalities are used by JS for user-interface, it probably is exposed. Investigate. If it's possible, then create a prototype which can extract this preference.
- The above will not affect testing accuracy, it is possible to test without knowing the preference, however for the thanks script, we must find out.
- To get the log, use logevents() in site.py, with the correct logtype.
Community Participation
Yet another reminder by @jayvdb, urging me to ask for help beyond #pywikibot and #mediawiki IRC channels.
Plan for adding support for Flow.
- We'll discuss this in the next meeting on Wednesday. Make a quick plan for thanks flow.
- A small session on Tuesday to take a look at the thanks related code.
Before Next Meet:
- Ask for help on more channels.
- @Legoktm helped me out with User Preferences queries on #wikimedia-tech
- Use the pywikibot API workflow in site.py, instead of session.post(), to make the API calls for thanks.py
- Make the following changes to thanks_tests.py:
- Change code and dry values.
- Write to a test page using add_text.py
- Use thanks.py to thank the above edit.
- Get log entry before and after the above using site.logevents() for comparision.
- Add notes as mentioned in the minutes.
- Investigate into MediaWiki API access for thanks preferences for a User.
- Investigated. Now add User.thanks_enabled property only for anonymous users.
- @jayvdb to decide a time for meeting on Wednesday.