User:Zexi.gong721/Bi Weekly Report 2

From mediawiki.org

Introduction

Hello, readers! I'm Zexi Gong, a computer science master's student at Northeastern University in San Francisco. This is the second blog for my journey in GSoC 2023.

In this blog, I will continue sharing my journey in the Google Summer of Code 2023 (GSoC) project, where I am working on the Wikidocumentaries project to import images from the web to Structured Data on Commons. In the previous blog, I talked about the initial coding phase and the progress I made. In this blog, I will focus on the second part of my project.


Coding Period 2

The second phase of the project involved tackling the image upload functionality. This part turned out to be more challenging than I initially anticipated. To begin, I explored the Wikimedia action APIs and discovered two APIs that could potentially meet our requirements for image uploading: the "upload" action API and the "Special:upload" action API. However, we realized that the "Special:upload" API might not fully satisfy the requirements for Structured Data on Commons (SDC) after the images are uploaded. As a result, we decided to use the "upload" API after discussing it during one of our weekly Wikidocumentaries meetings.


To start off, I delved into the documentation for the upload API and attempted to successfully upload an image directly from my computer. I spent some time navigating through the documentation and following the example code provided. However, I encountered numerous errors and faced several roadblocks along the way. Thankfully, I had the support of my mentors, Susanna and Tuukka, who were always there to provide guidance and assistance. When I shared my struggles with them, they immediately reached out to individuals who had experience working with the Wiki action API to seek additional guidance for me. Even people from other sections of Wiki were supportive and willing to hold sessions to help us troubleshoot the issues. Unfortunately, many of them hadn't encountered the specific problem we were facing.


Throughout the process of seeking help, I continued my attempts to make the example code work. After numerous failed attempts, I encountered one last error: permission denied. During the final session where we sought help, Albin suggested trying the code with a different account. So, I shared my code with Tuukka, and to our surprise, he also encountered the same permission error. It seemed impossible for Tuukka's account to lack the necessary user rights, and eventually, he identified and fixed the last error: the example code was using a bot account, and we had not granted the bot appropriate permissions. After two weeks of perseverance and five meetings, we finally made a breakthrough in the first step of the image upload process by getting the example code to work.


Summary

The second part of my project focused on image uploading. Although it presented more challenges than anticipated, with the support and guidance of my mentors, as well as the help from individuals in the Wiki community, we were able to overcome obstacles and make progress. In the upcoming phase, I will be continuing with the image upload process, focusing on how to utilize the OAuth authentication that I have previously implemented.