Contributing to Open Source Phase at Encora Apprenticeship — Week 1
This post is part of a weekly assignment at Encora Apprentice and in this series, I’ll share my journey as a Software Engineer Apprentice. I hope these stories help and motivate others on their tech journey.
This week at Encora
This week at Encora was the start of a new phase, in which the main focus is the open-source community. In this post, I’ll talk about what I’ve learned and how has been my experience in diving for the first time in open-source projects.
Open-source projects
As I mentioned, this week I embarked on a quest to find projects in which I could make some contribution. Github is the place where you not only can find the source code of thousands of projects, but you can also search for them as well. Also, there are some pretty cool sites like CodeTriage and Good First Issue that can help you get started.
The cool thing about open-source projects is that not only the code is free for everyone that wants to take a look at it, but also are made for and by communities that come together to work on a new tool or software to solve a problem.
Also, when working with open-source projects, we must be able to read a lot of documentation and code in order to put ourselves in context.
Netlify
This week I came across Netlify. It is a platform that helps you have infrastructure hosting and CI/CD pipelines in one place in a single workflow. Before picking an issue I dive a little bit into the documentation and experiment a little bit creating sites and building them.
After a while, I went to the CLI repository of Netlify, picked an issue, and started working with it, trying to replicate the issue and getting started with the code. The issue consists on being able to link the site automatically after running the sites:create
command. So far I got a little stuck with the tests, but hopefully, I’ll sort it out soon!
Ava
I also got to work with Ava, which is a test runner for Javascript. To use it you just have to install npm install ava --save-dev
and then, in a /test
folder, we can write our files .test.js
and Ava will automatically run those files.
The main structure of the tests written using Ava can be seen as:
const test = require("ava");
const correctJSON = { someProperty: "value" };
const otherJSON = { someProperty: "value" };test("JSON is correct", (t) => {
t.deepEqual(correctJSON, otherJSON);
});
With this, we are defining a test, with a description JSON is correct
, which takes two objects in t.deepEqual
and compares them, if the contents are equal, the test will pass.
Git and LFS
I also worked more with some git commands, in particular, with the Git > 2.28 since it introduces a new flag to the init
command, --initial-branch
, which lets you specify the name of the initial branch when initializing a new repository.
I also needed Git LFS (Large File System), which helps you work with large media/files by replacing those large files with pointers, which improves the management of them.
Final thoughts
The first week of this face is coming to an end, but there is still some work to be done. While working on the first issue and reading code from other projects I found myself researching a lot about new technologies/libraries, that’s why it has been very interesting!