I submitted my first PR to the Django project! I'm going to write about the process and the challenges I faced while submitting my PR.
Lesson 1, Find a ticket you want to contribute and assign it to yourself.
Django issue tickets aren't on Github - they're managed on a separate website. You need to login to the Django site in order to assign yourself to a ticket.
You can assign yourself to a ticket by clicking Modify Ticket button on the ticket you want to work on, and selecting your name in the assign to field. (This lets other contributors know that you plan to work on that ticket.)
Lesson 2, Understand the problem and think about how to solve it.
During this process, I got help from Gemini, went through the Django docs, and organized my understanding of the problem.
Lesson 3, Writing the code
In the Django documentation, there's a well-written guide for first-time contributors. (Writing your first contribution for Django)
- Installing Git.
- Downloading a copy of Django’s development version.
- Running Django’s test suite.
- Writing a test for your changes.
- Writing the code for your changes.
- Testing your changes.
- Submitting a pull request.
- Where to look for more information.
Before writing your code, run all the tests first and note how many fail. Then, after writing your code, run them again and compare the number of failed tests.
You can also check if your test passes successfully for the code you wrote.
Lesson 4, Checking the code
[] This PR targets the main branch.
[] The commit message is written in past tense, mentions the ticket number, and ends with a period.
[] I have checked the "Has patch" ticket flag in the Trac system.
[] I have added or updated relevant tests.
[] I have added or updated relevant docs, including release notes if applicable.
[] I have attached screenshots in both light and dark modes for any UI changes.
When submitting a PR, you'll find a checklist like this.
You need to make sure your commit message is well written and follows the Django committing guidelines.
You need to check Has Patch flag on the issue ticket. You can find this option after clicking the Modify Ticket button on the issue page.
You need to add the relevant tests, documentation, and release notes.
⭐ When you write the documentation, make sure it follows the correct format according to the Writing documentation guide. If you don’t check this, the GitHub Action will fail — (my experience 😅)
All checks have passed ! 🎉
Now, all I have to do is wait for the review.
My first PR submission is finally done… what a journey! 💪
Top comments (2)
Thanks for sharing that experience
Great work, on the PR and on this write up!