Google Summer of Code | Week 3

This week — May 28 to June 3 — was the third week of the coding period of Google Summer of Code (GSoC) with Systers Open Source. If you want to know more about this you can read the introduction to my journey , my latest weekly blog posts or my weekly status report for this week.

These first weeks, I’ve been balancing GSoC and my Master’s thesis work. Next week I’ll present my dissertation and then I can fully focus on GSoC work. Even with the thesis I still managed to get some work done.

This week I had these 3 pull requests (PR) merged:

I also created some issues on GitHub and organized them on the ZenHub board. In case you’re unfamiliar with ZenHub, this is an agile project management tool for GitHub. Some of these issues were based on bugs found by one of my mentors, Murad, and other issues were discussed at this week’s project meeting.

Challenges

This week I had to squash commits on multiple occasions. For my first PR, I had to squash some commits of a branch, which did not include the most recent commit (here’s a stack overflow answer that helped me). For some of my next PRs I had to squash all commits of a certain branch. I never find my self in any of these scenarios before, so it was quite challenging learning about this. I eventually learned how to squash commits, with some tips from the community and one of my mentors, Dilushi. After the second instance of squashing the commits, I was much more comfortable at doing this, for the case where I squashed all the commits of a branch.

Because I was still getting acquainted with flask backend development, I wasn’t doing tests and applying Test-Driven Development (TDD) methodology yet. I was still trying to figure out what was the best way to structure the app to allow me to test each separate module of the app, from DAOs to data model objects and the API itself. So I dedicated a large portion of this week to learn how to test the code. I implemented some basic tests, just to have an idea of how to test the project from now on. Although tests are a very important part of the project development, for now doing all the possible combination of tests wasn’t a priority, this can be done gradually and implemented for the next features. Also, we now have a more stable structure, than in the first weeks, and I understand a bit more of test development for flask applications. Another point is that by having this project open source, anyone can help to add more tests to the project during the GSoC period as well.

I fixed Swagger documentation of the backend API so that anyone can test the whole API, using the Swagger UI instead of just using Postman (how I usually to test the API). I learned how to use flask-RESTPlus framework to both document header authorization field and request body. The authorization field is required for some endpoints that require login with an access token.

Shout-outs to blog posts and open source projects

This week, I discovered other great GitHub open source sample projects that helped me in the learning journey. One of these projects — mjhea0/flaskr-tdd — shows how to approach TDD using flask applications. Another project that I found was mjhea0/flask-basic-registration. These two projects were done by Michael Herman.

I also searched about how to implement email verification for new users, which I’m aiming to start implementing next week. I found this blog post on this topic, which seems very useful, from Real Python website. Here’s the project from the blog post on GitHub.

Another great article that I found was “How to structure a Flask-RESTPlus web service for production builds” by Greg Obinna. I intend to look more into this in the next days. The GitHub project used for this blog post can be found in cosmic-byte/flask-restplus-boilerplate.

Plans for next week