Contributing to Open Source for the first time

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone my name is kami Williams and today I want to talk to you about how to contribute to your first open source project and things to look for when you're considering contributing if you've never heard of open source before it's exactly how it sounds it's code that is built by the developer community for the developer community visible to everyone the source code for software that is open source is completely free completely open projects that are open source are free for anyone to build modify or use now why is open source valuable to companies well there are three things that it provides the first is leadership anyone can contribute to an open source project by open sourcing tools you can cut out a lot of time from building from the ground up because there are so many developers around the world contributing to it at different times open source software is maintained by developers who want the software to succeed the work is opt-in that said the software is typically well supported by people who are passionate about the technology the second reason is community open source as a whole in general advocates for collaboration transparency and community driven development supporting open source equates to supporting a passionate community finally the last is productivity I kind of touched on this before but open sourcing invites all people of different expertise and background to contribute this yields a lot of software to be very functional and reliable with iterations on features and bugs happening a lot faster with all that in mind I'm going to share my screen now and show you how to get started finding open source projects to contribute to and actually contributing to one this is an introduction for the basics so if you've contributed to an open source project before feel free to leave a comment with your best tips and tricks on how to get started for those who haven't take some time to navigate to github.com this is where a lot of open source projects are hosted including Facebook's create an account with the sign up button if you already have an account you might see a page like this I contribute to open source relatively regularly so I have a couple things in my recent activity as mentioned earlier github is where you can find a lot of open source projects it can be just as easy as searching for something that your interest one of my favorite repositories is PI torch PI torch is an open-source machine learning framework that accelerates the path from research prototyping to production development all of that to say is it's an open source machine learning project now what we're looking at here is the PI torch organization meaning there are a lot of different projects created by community members of the PI torch organization that all live here clicking on this first PI torch repository is where the main library lives what are we looking at here you can see the name of the project it's description a couple of related tags but then as we scroll down we see many different folders and files this is while code this is all entities of the PI torch project now PI torch is a really big project so you'll see a lot of big files but don't be intimidated probably the most important one is the readme every home page on github for a project or github repository typically has a readme the readme should tell you what the project is who it's for and how to develop with it sometimes read Me's also include a license for the project you can search the license to read more about what that means it's always worth it to start by reading the readme first this will give you a good indication of the lay of the land of the project and also give you some links to help you get started in either developing for it or contributing to it really stellar open source projects also include a contribution guide you can see the PI torch contribution guide here even better some open source projects include chat groups like slack Gator discord or you can talk directly with other people who are using and contributing to the project if a project does have those chatting resources you should ensure that the project has a code of conduct to ensure that it's an inclusive space aside from that you can always ask questions about the project on the project's forum or on something like Stack Overflow so after reading through the projects readme you kind of have an understanding of what the project does let's look at what github has built in in order to make development a little it easier at the top of the repository you'll see some buttons first is a watch button you can see that I'm already watching PI torch this essentially is like following the project it all said me relative notifications when there are updates to PI torch next is star this is like liking a project and then forking forking means that you're able to copy the entire project and make your own edits other things to notice is that we've been in this code tab there's also an issues tab pull request actions projects wiki security and insights I have this extra tab because I work for Facebook so clicking on the issues tab these are bugs or feature requests that have been submitted by the PI torch community you can search through a lot of these issues to find out ways to contribute to the open source project again sometimes projects have a lot of open issues but you can see that they can also be labeled so for example in this PI torch repo they label some issues as good first issue this is a great practice because you know exactly where to start whether you're familiar with PI torch have used it before have contributed to open source it's always good to look at the good first issues first some repositories might also write first issue need help on boot camp to see all of the issue labels you can just click on this label tab and search for something similar so I'm gonna click on the good first issue label and now I can see all of the ones in the PI torch repo that are labeled as good first issue now I have a better indication on how to get started clicking on this first issue we can see various details now again it might be a bug or a feature request but typically they'll give you some insight as to what the issue is there might be other conversation that's happening on the issue but it should be enough to get started if it isn't you can always ask a question or leave a comment to ask for some clarification or help pull requests are usually responses to these issues there are people who have solved the issue and want to propose to be submitted this is where the code review process happens meaning one of the core contributors of Pi torch needs to review your code before you push it into the full project repo so now that we have a complete overview of what this project looks like we've read the readme we understand the various github features we've looked into contributing guides and ensured that the project has a code of conduct let's get started making our first contribution to this repository before submitting any code to PI torch or fixing bugs adding features I personally put it on myself to say that a good first contribution to any project is an update to the tech Docs so it's good practice to read through them and if you find any grammatical errors spelling mistakes or things that need clarity that's where you should contribute it might be considered as a non-essential but starting here helps you understand what the cadence is like of contributing to a github project so because PI torch is an open source project yes even the website is open sourced I'm in the tech Doc's of PI torch and reading through the first sentence I think it could use some grammatical tweaking so originally it says the torch package contains data structures for multi-dimensional tensors and mathematical operations over these are defined a little wonky so my first contribution to this PI towards project is going to be to just edit that sentence so now how do I find where this lives in the PI torch organization all I'm gonna do is copy the sentence go back to the PI torch repo and then in github I can paste the sentence and choose to search either in this repository or in all of github I want to contribute to just PI torch so I'm going to search just in this repository okay so we have our result this sentence lives in the torch folder and a file called an it dot Pi so I can either click on the file to go to the file or I can click on the line number to see exactly where this sentence is okay great so now I can see this is where the sentence is this is the file I have to update and this will be my contribution to the open-source project so now I'm going to go back to the top I want to make my own contribution so I am going to fork the repository where should we fork PI torch in my own account so I'm going to click on my github username and it's working PI tours so now you can see this was updated to live under my github account under PI torch let's now edit the file I'm going to clone my repository to my local drive so that way I can code using my favorite IDE or integrated development environment clicking the clone button you can either clone with SSH or clone using HTTP I'm going to clone with SSH clicking the copy button now I'm going to open my terminal in my terminal I'm going to make a directory and call it open source contributions let's enter that folder and now I'm going to clone this repo to that folder in my local drive using git clone and then paste what I copied from github now I have a local copy of PI torch at this point I want to look at the PI torch contributing guide before I start any of my edits or coding to make sure I have all of the knowledge I need in order to properly contribute to the project now the PI torch contributing guide is large and again some projects might not have a contributing guide so use your own discretion when you're going through this and try and find a section that best fits your proposed change for me I'm going to click on writing documentation there's a few steps I need to follow I'm going to cut and do those steps and then come back so according to the contributing guidelines I've just set myself up to start contributing to the PI torch Docs everything that is live on PI torch lives on a branch called master if you want to make a change you should make a new branch off of master so that way your changes don't affect the main public project the reason why it's good to do this is again with open source a lot of updates are coming in at different times you want to work independently of those updates and pull them in when you're ready furthermore you don't want your changes to affect anyone else's development so it's good to keep them separate and then eventually merge everyone's together once development is done so I am going to enter the PI torch folder that I just cloned and you can see that it's all set up just like it as it is on github then I'm going to type git branch this will show us that we are on master I'm going to then type git branch my tech dock contribution it can be named whatever you want it to be but for sake of this tutorial I'm not going to be creative and just name it very explicitly now if we type git branch again we can see that that branch was created but we're still in master so now we want to enter the my tech dock contribution so I'm going to type git checkout my tech dock contribution and we switch the branch to that one everything in my tech dock contribution links back to master meaning if I type git pull I'll get all of the new updates from master so now I'm on my separate branch I'm going to open this code in my favorite IDE or integrated development environment and get started coding so I've hooked up my IDE to my forked version of the PI torch repository and if you can remember that sentence that we wanted to edit from the tech Doc's lived in torch and then an it py and you can see here it is the torch package contains data structures for multi-dimensional tensors and mathematical operations over these are defined so I'm going to do a little grammar magic here and be right back so this is my decided update if the core contributors get better than they'll be able to add these changes to the tech Doc's but essentially I updated the sentence to say the torch package contains data structures for multi-dimensional tensors it also defines mathematical operations that can be performed over these tensors sounds better to me let's try making a pull request or a PR in order to get my code into the main pipe or CH repo before I do that though there are a couple things and the contributing guidelines that I need to do to this file in order to make it ready for master so I'm going to do that really quick back in the terminal in the PI torch folder let's preview all the changes that I've made to do so I just type git diff and I can see my differences between the original file and my edited one with these changes local to me I want to make sure that I'm in sync with master in sync with the main PI torch repo and because this project is forked from the main repo I'm going to switch my branch back to master pull from that main repo into my kami Williams PI torch then go back to my current branch and then pull from my local master so I just cleared my terminal so that way we could reduce some noise I'm going to type git checkout master switch branch to master get pull I'm already up to date not a lot of time has passed but it's a good gut check then I am going to switch my branch back to my contributing branch and then as always it's good practice pull one more time sometimes you'll get which branch you want to receive changes from especially if you multiple so for me I'm going to copy this and set my branch to master meaning I want this one to sync with master cleared the terminal again if that all looks good let's actually submit these changes so the first thing I want to do is type git add period the period means that all of the files I changed rope together into one additive then I'm going to write a commit message this is the message that will just describe what all of my changes mean so I'm going to say grammatically updated the tech Docs and then finally I'm going to push these changes so I'm going to type git push again you might get a message like this especially if it's your first contribution so I'm just going to copy the second one and you can see it was pushed so now we're back at github you can see that I'm on my forked version of Pi torch and we have this notification you recently pushed this branch I'm going to click compare and pull request if you don't have this notification go back to your terminal and make sure that you pushed your changes successfully so clicking comparing pull requests you can see here that I want my base repository to be the main PI torch repo I want to push the changes into master and they're coming from my local pirate repo on the my tech-talk contribution branch so this was my commit message this is what the PR or pull request is going to be called I'm going to describe what it does and why I made the changes again this is a good time to look back at the contributing guidelines to see if there is a template that you should follow for making pull requests in the PI torch contributing guides it's telling me that when I submit changes it's helpful to provide a screenshot if it's from the tech Doc's so I'm gonna write a description in my PR of what this change is I dragged my screenshot into this box in order for them to be able to see my changes and I can preview what all this looks like if I click on preview let's submit our contribution with you I'm gonna click create pull request and Wow now it's live it exists in the main PI torch repos pull request tab now I will await comments from reviewers and hopefully once that's done and all the checks are passed I'll be able to merge this into the main PI torch repo if they come back with some feedback or suggestions on edits that I can make I can just go again to my local machine in the my tech doc contribution branch make those changes ad commit and push to this pull request you should only have one pull request per branch so if you want to make changes separate from this create a new branch off of master hopefully it is with enough to help you get started with your first contribution to open source where I to highlight anything I would say remember that you don't have to know all the ins and outs of a project to contribute it start with looking at the tech Docs and contribute a spelling mistake or grammatical error that you find and ease your way into code take a look at the github issues to find feature requests or bugs that community members have submitted and look for repos that have marked issues as a first good issue a bootcamp task or something similar if you have any questions suggestions or tips for people who are contributing their first time to open source please leave a comment down below my name is kami williams thank you so much for watching
Info
Channel: Facebook Open Source
Views: 135,191
Rating: 4.9317446 out of 5
Keywords:
Id: c6b6B9oN4Vg
Channel Id: undefined
Length: 18min 24sec (1104 seconds)
Published: Thu Apr 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.