Also posted at https://communityblog.fedoraproject.org/gsoc-progress-report-dashboard-for-packit/

About Me

Hi! I am Anchit, a 19 y.o. from Chandigarh, India. I love programming, self-hosting, gaming, reading comic-books and watching comic-book based movies/tv.

The first version of Fedora I tried was 21, when I came across it during my distro-hopping spree. I used it for a couple of months and then moved on to other distros. I came back to Fedora in 2017 after a couple of people on Telegram recommended it and have been using it ever since. A big reason why I stuck with Fedora this time is the community. Shout out to @fedora on Telegram. They’re nice, wholesome and helpful. They also got me into self-hosting and basic sys-admin stuff.

About The Project

Packit-as-a-Service is a GitHub App that helps developers continuously ensure that their project works in Fedora. Packit Service validates pull requests by building that project in Fedora so that others can install and test those built rpms before merging.

I’ll be working on a dashboard for Packit Service. My task is to build/expand the Packit API and use it to build the dashboard.

The Application Period

When this project was announced for GSoC in February, I started playing with the codebase and contacted my mentor Hunor Csomortáni. He and Frantisek Lachman helped me setup Packit Service locally and I started contributing to Packit.

These are some of the things I contributed to Packit Service during the GSoC application period. (February - April)

  • Control packit-service with the command embedded in a comment.
  • Store the date/time of triggering a new copr build. (In Redis and PostgreSQL)
  • Multiple improvements to the dashboard.
  • Rewrite the copr-builds part of the API using PostgreSQL instead of Redis.
  • Store the whitelist in PostgreSQL instead of Redis.
  • Create database based tests for the Packit Service API.

BTW, I had never written tests for code before contributing to Packit but then Tomas Tomecek really drilled the importance on tests in me. (with constant reminders after every PR xD)

Community Bonding Period

I finally met Hunor via video call and then attended a meeting with the entire Packit team. Hunor and I explored different options, features and stacks which are summarized here.

The First Month

The coding period started on 1st June. Hunor and I decided to have daily 10 minute meetings about work, etc. Meanwhile, my uni started sending us huge assignments (thankfully over now).

Here’s what I did on a week-by-week basis.

Week 1: We decided to use a Flask backend and React based frontend with Patternfly as the UI library for the dashboard. I learned about Webpack, a JavaScript bundler, and made Webpack configs and a makefile to integrate react and flask for development. Then I built a boilerplate/skeleton web app using Patternfly React. I also learned a bit of ansible while working on the deployment configuration.

Week 2: Our /copr-builds API endpoint was very slow because it fetched all of the rows in our builds table into memory, used python to merge them according to our required parameters, then did way too many SQL queries to fetch related data and finally paginated them using python. My initial goal at the start of the week was to replace all of this into one complicated SQL query. This, as it turned out was not possible given the way our database was structured. However, I did manage to merge rows and do pagination using a SQL query instead of using python and then fetch related data using additional queries. While this is not what I had initially hoped, it was still significantly faster than the original implementation.

Disclaimer: I was the one who wrote the slow implementation during the GSoC application period so it was my fault in the first place. In my old self’s defense, the database was quite small at that time and that implementation worked well enough.(Packit Service was still using Redis as the data store and PostgreSQL was experimental.)

Week 3: I wrote the GET endpoint for /testing-farm/results/ which returns a list of testing farm results stored in our database. I also started working on the jobs section of the dashboard.

Week 4: I had a minor issue, which got sorted out thanks to the Patternfly team ! I finished the jobs section of the dashboard. Here’s a screenie:

packit-dashboard-jobs

Looking Forward

I had a lot of fun working with the Packit Team and I learned a lot of new things. Big thanks to the Packit team and the Fedora Community for choosing me as their summer of code intern. I look forward to contributing more to Fedora!