-
Notifications
You must be signed in to change notification settings - Fork 5
lab 2
Friday Oct 2 by Midnight.
Please complete this BEFORE you start on Release 0.2
This week we are getting ready to start Release 0.2 and Hacktoberfest. To get you ready, we'll practice contributing and submitting pull requests to other repos we don't own. This lab will help you practice the following:
- forking and cloning other projects
- creating branches to work on new features and fix bugs
- working on code you didn't write, trying to maintain the original style and not break things
- creating pull requests
- collaborating with other developers on GitHub
- updating your pull requests to include fixes for review comments
Pick another student's link checker project from the Release 0.1 Submissions list. You can work on any project other than your own.
File an issue to add one of the optional Release 0.1 features or suggest one of your own. Describe what you want to do, and mention that you'd like to work on this.
Fork the other student's project on GitHub, then clone your fork. Next, create a branch for your work. If you filed Issue #5, name your branch issue-5
:
git checkout -b issue-5
Edit the existing code to implement your feature. Make sure you write your code as closely to the style of the original author as possible. Make it look like the same person wrote all the code. Pay attention to how they name things, how they do formatting, where they put things, etc.
Make sure your changes don't break the original code. Test, test, test, and test again. When you're satisfied that things are working, proceed to step 5.
If your code added a feature, it's likely that you need to update other files too. Perhaps the docs need to be updated? Check to see if your changes require updates to any other files.
When you're finished Steps 1-5, create a pull request. Start by pushing your branch to your fork on GitHub (i.e. your origin
). Assuming you were working on a branch called issue-5
:
git push origin issue-5
Obviously you should rename issue-5
to the correct branch name.
Follow these steps to create a Pull Request from your branch. Pay attention to the following:
- Pick the correct branch in your repo (e.g.,
issue-5
for you andmaster
for the original repo). You want your work to get merged into the original project'smaster
branch eventually - Write a complete title for your pull request. For example, "Add feature x"
- Write a complete description of what you did, including info that this
Fixes #5
(or whatever Issue number you are fixing). GitHub will automatically link an Issue and Pull Request for you if you use the correct syntax.
Find the original repo's author on Slack, and get them to review your Pull Request. It is likely that they will ask you to make changes (NOTE: if you are reviewing someone else's changes to your repo, please ask them to change something so they can practice this part, even if it's small).
When you are asked to make changes, go back to your code and make sure you are on the same branch that you submitted. For example, git checkout issue-5
to get on the issue-5
branch.
Edit the code to address the reviewer's comments. Make sure you deal with all of them! When you're done, add another commit to this branch:
git checkout issue-5
git add file1
git commit -m "Updating x, y, and z based on review feedback"
git push origin issue-5
Again, change issue-5
to whatever branch you are working on. Once you've done this, go back to the Pull Request on GitHub and leave a comment telling the reviewer you have completed all their changes.
Repeat this cycle as many times as necessary for the project owner to Approve your changes and merge your work.
Write a blog post about the process of contributing a change to another project. In your post, include links to everything you discuss (e.g., the project repo, your pull request). Discuss what you did, the changes you made for your feature, and the process of getting your work accepted. What problems did you have? What did you learn? What would you do differently next time?
If your repo received a pull request, please also talk about what it was like to get a submission. How much did you need the author to change? How did that process go?
NOTE: these pull requests do not count toward your Release 0.2 requirements.
When you have completed all the requirements above, please add your details to the table below.