A Contributor’s Story with Grace Gao
The Contributor’s Story series is designed to give our key open source contributors and community members a face and voice, an overview of the projects they’re working on, and the successes and challenges contributors face in development.
In this blog post, we will be speaking to Grace Gao, a Pysa employee who is working on a Pysa VSCode plugin through the Major League Hacking (MLH) scholarship.
“The MLH scholarship opened up a lot of new opportunities for growth and I’m really grateful to be part of a community that keeps inspiring me to improve.”
Tell us a little about yourself and your current experience in the MLH scholarship.
Hello, I am Grace (she / she) – here is a little bit about me:
- 1st year Software Engineering @ University of Waterloo
- Ottawa, Canada
- Organizer @ Hack the North, SET.Hacks (), TOHackse
- Hobbies include: painting, drinking instant coffee, grocery shopping
I joined the MLH Fellowship last fall and this is now my second term as an Open Source Fellow! After graduating from high school in the middle of a pandemic last year, I had plenty of free time to try out new coding frameworks and play with various personal projects. When my friend first introduced me to this program, I recognized the familiar MLH logo from hackathons and it seemed like exactly what I needed to “improve” my approach to learning. While I don’t have a lot of professional programming or open source experience, I decided to give it a try (and I’m really glad I did)!
Where did you first find out about open source? How did you come to use / contribute something?
Like most other things, the internet taught me! When I started using Github to collaborate on hackathon projects last year, I knew little about open source. At the time, I thought it was just an updated version of a cloud drive. As I delved deeper into the online coding community, I found all sorts of cool projects and resources that were great starting points for learning new technologies (code is a lot less intimidating when someone else has already done most of the work). Whenever I got stuck, Github repositories became my first stop, and most of the time I found solid examples to play around with.
When I went into the Fellowship, I had limited knowledge of Github and open source, but the people around me were incredibly helpful in keeping me updated. This was my first post on projects maintained and used by other developers, as well as many other “firsts” – my first pull request, my first problem, my first time integration tests failed. Learning to be a good open source citizen has definitely changed the way I approach coding and given me the confidence to become a more active part of this community.
Describe the project you are currently working on.
At the moment I am working with my teammates Sayd and Sarthak, our mentor Javid and the supervisor Graham on Pysa (an open source tool for static analysis of Python patches from Facebook). The goal of our team is to create a Pysa VSCode plugin that is similar to the existing plugin for Pyre. This would include features like syntax highlighting, right click menus, and Pysa error analysis for each workspace with Pysa files.
How did you initially go about approaching the problem?
To start with, I went through a lot of documentation and tutorials for Pyre and Pysa to better understand the project. The links Graham provided were particularly helpful in learning about the various file formats and how they work, as well as Language Server Extensions in VSCode. Since Pysa is based on Pyre (Facebook’s Python type checker), the existing VSCode extension for Pyre was also a good reference point for understanding and creating the new Pysa extension.
What obstacles or problems have you faced in your post so far?
For me, Pyre was used to set up a major roadblock on my laptop. I tried following the installation documents initially but got a lot of low level errors preventing me from continuing. Unfortunately, while reading a similar issue on Github, this tool didn’t seem to be supported on my Apple M1 laptop.
As a workaround, Graham suggested using a Docker container. I ran a Debian image and followed the documents to build it from source, which involved a lot of trial and error and looking for error messages. The documents were missing some dependencies and steps, but with the help of my team I was able to fill in the gaps and get them working. Since the other colleagues also had similar challenges when building from the source, I created a Docker file and documented my setup. After that, I made a pull request to the project so that future contributors would have an alternative way to get set up quickly with Docker.
What is the current state of development?
So far, my team has taken the first steps to set up the VSCode extension and create the voice server. I got on this project a little later this semester, so I mainly worked on keeping myself up to date and contributing to the Docker image. We are currently working on the implementation of the plugin functions and I am trying to set up the syntax highlighting for the taint.config and .pysa files. For this purpose, I hope to use a Python syntax highlighter and possibly make some changes (e.g. use the fully qualified function name as the normal function name).
What have you learned about the project, development or open source so far?
By and large, I’ve learned that picking up new things isn’t as daunting as it seems. Before that, I didn’t really know where to start with open source or development frameworks, and it was intimidating to hear so many unfamiliar terms being casually tossed around. Looking back, I think it was mostly a mental block that quickly cleared when I started working on my team’s projects. Overall, I am glad that the fellowship created an inviting environment that gives me the confidence to tackle future challenges and start contributing.
What advice would you give future contributors to the open source project?
I would say feel free to create problems and add suggestions wherever you see fit. While it may not be exactly the problem you are working on, you may find an error or notice an error in the documents that could save others a lot of trouble. The Pysa community is very friendly and I am sure they would appreciate your ideas even if your PR is not perfect and you are not sure about the problem. Here’s another tip: don’t try to install Pyre on your Apple M1 if it isn’t supported. Use the new Docker image instead!
We’d like to thank Grace for her continued contributions to the Facebook open source ecosystem. You can follow Grace’s work through her website, GitHub, and LinkedIn.
If you’d like to learn more about Facebook Open Source, follow us on Twitter, Facebook, and YouTube for relevant updates, and check out the Pysa website to find out how to get started.