Public notes on first contribution instructions - maybe ideas for some new contributor opportunities

Wrote these public notes as I went through the first contribution instructions to submit a PR for #37093.

Each horizontal line indicates a separate stumbling point or thought while I went through it.

I could see going through these notes and creating related tickets to help the instructions and therefore experience/flow for first-time contributors.

I can do that when I have some time in the future, but if anyone has time before I do to make tickets / address them with PRs if the tickets are accepted, you’re more than welcome to take any ideas from my notes below. Especially could be useful if you’re a brand new contributor who hasn’t submitted a ticket or PR yet but wants kind of an easier one to get a feel for the process since these would be pretty much all small documentation edits and ones that are specifically about the first-time contribution experience.

The notes are messy and not fully cleaned up yet – I thought it more important to just get it out with the time I had than clean it up further. But, yeah sorry it’s not so cute :slight_smile: I’m happy to clarify if anything is unclear and definitely would clean up if putting any of this into Trac. Also I didn’t fully evaluate if everything here should be put in Trac - they’re just some messy notes on the experience for now

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
1
write first contribution instructions

Some code blocks are missing the copy capability - Missing it are:

**$** source \~/.virtualenvs/djangodev/bin/activate

**$** . \~/.virtualenvs/djangodev/bin/activate

There are other code blocks that don’t have it but they are more like example code or example terminal messages and less like commands someone is likely to actually copy (idk if those are supposed to be always anyway)

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
2

How to find the path to do the

**$** python -m pip install -e /path/to/your/local/clone/django/

Part of write first contribution instructions

Feel kind of silly about flagging this but it did make me have to go look it up and pulled me away from what I was doing and since the instructions are putting in stuff like git, maybe something about this should be in there too

Specifically, I ultimately did: `pip install -e ~/Desktop/code/django` and the info I found that actually helped me was knowing that

β€’ ~ is a shortcut for home directory

  • On macOS, home directory is:
    /Users/yourusername/

If you see a path like \~/Desktop/myfile.txt it actually means /Users/yourusername/Desktop/myfile.txt

echo $USER\ in terminal will will print your username.

And if it shows (djangodev) username@MacBook-Pro

"MacBook-Pro = hostname of your Mac. It’s the name you gave your computer when you set it up.

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
3

I don’t understand this: β€œThe installed version of Django is now pointing at your local copy by installing in editable mode. You will immediately see any changes you make to it, which is of great help when testing your first contribution.”

Specifically β€œβ€¦installing in editable mode. You will immediately see any changes you make to it…”

didn’t seem to affect what I was doing much so fine to ignore for now I guess

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
4

After running tests, I’m still in the β€œtests” directory instead of the general one (because I moved to tests to run the command as instructed (β€œBefore running the test suite, enter the Django tests/ directory using the cd tests command, and install test dependencies by running:”)

Am I supposed to move back to the directory or does it not matter if I stay in the tests directory?

I feel like I’m supposed to move back, right?

Maybe recommend adding something like:

Run command `cd ..` to go back to the django directory instead of the django/tests (where you were before running the tests)

This is confirmed when it later has β€œcd to the Django tests/ directory and run:” again (or if not needed to make the branch, this line can be removed or edited to β€œyou should still be in the tests/ directory”)…it actually says to change back to the tests directory several times without ever saying to leave it with a cd so idk but I guess I did get through it fine ultimately

write first contribution instructions

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
5

Might be good to include a sentence of what the documentation syntax/language is…e.g. it’s not markdown…what is this strangeness

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
6

How can I credit the reviewer in a commit message for a commit that hasn’t been reviewed yet since it’s not yet committed….I don’t get that? Seems like paradox. How could anyone? prob relates to some specific situations I just don’t know about yet

committing code django docs
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
7

That i / esc / :wq editor mode thing is not familiar pretty weird/intimidating looking if not encountered before. Should include info about that coming up when you do `git commit`? and whatever mode that’s called (I think I’ve read its name before - look up)

write first contribution instructions - test section

Should include there and/or also in the commit message guidelines linked from above link in that section

committing code django docs

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
8

It’s not clear to me if there’s an easier way people do the 72 character limit for lines in commit messages….I opened a word counter and copy and pasted and went back and forth while editing and I’m pretty positive that was not the easiest way to do that….

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
9

It’s pretty unclear/confusing on whether I should be writing on forum, in the ticket thread, or in the GitHub PR for any given question. Some things more obvious than others, but ultimately it feels odd to have the same conversation spread across three things. What’s the source of truth? Trac I think? But to feel well-organized you’d still have to reference each thing in each place

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
10

β€œYou can create a pull request by visiting the Django GitHub page. You’ll see your branch under β€œYour recently pushed branches”. Click β€œCompare & pull request” next to it.”

That’s no longer accurate. It doesn’t say β€œYour recently pushed branches”

It looks like this:

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
11

Trac says

β€œ β€’ To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn’t duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the β€œHas patch” flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].”

But the `pull_request_template.md` for GitHub has

β€œ- [ ] I have checked the β€œHas patch” ticket flag in the Trac system.”

So I was left like which do I do first: the PR in GitHub or the patch thing in Trac? Obvs didn’t think it mattered as long as I did both but process is clearly important so trying to do the right way. What I decided: Ultimately I didn’t have pull request ID # (obvs because it’s impossible to get that before actually submitting the pull request) which means I didn’t have the link desired for β€œHas Patch” think in Trac so what I did was not check the box intending to do it right after which then resulted in:

:warning: Warning: Incorrect Trac Ticket Flag

The referenced ticket ticket-37093 does not have the Has patch flag set in Trac. This flag must be checked before a pull request can be reviewed.

What to do:

  1. Open the ticket at #37093 (Adjust GitHub PR description template + bot check error emoji) – Django.
  2. Scroll down and check the Has patch checkbox on the ticket.
  3. Save the ticket.

Which is not shocking of course just more like feeling β€” β€œyeah, I know I have to do that, and I’m already about to do that, but I just couldn’t do it before actually submitting the PR if you also want me to include the PR link in the Trac ticket”

1 Like

This is awesome, thanks for sharing all your notes! I have some ideas for possible improvements. Let me know if they would have been helpful.

Agreed, this isn’t very clear. And not silly at all! I would change it like so:
Change directories to your new local copy of Django and install it

cd ./django
python -m pip install -e .

The docs can link to the Python Packaging Authority’s explanation.

To keep things simple the docs can include the tests/ directory in instructions instead of asking the reader to change directories.

python -m pip install -r tests/requirements/py3.txt
python ./tests/run_tests.py

reStructuredText. It is mentioned on the Writing documentation page which is linked to on the Writing your first contribution page. So I don’t think a change is needed here.

This is confusing. I would take away that there’s an expectation to rewrite your commit after the review. Perhaps this page could be organized to match the workflow chronologically.

  1. Cloning a PR
  2. Writing commits
  3. Merging a PR

Agreed. The docs say that β€œThose of you who are unfamiliar with version control systems and Trac will find that this tutorial and its links include just enough information to get started.” If that’s the benchmark then I think the guidelines should help the new contributor write their first ever commit.

Neovim’s gitcommit file type handles this very nicely. But all editors likely display a column count value.

Don’t forget the Discord Server! I’m trying to be funny, but it is legitimately useful. Especially in these situations where I’m uncertain of the status quo. We also have occasional β€œLearn how to contribute to Django” events. The next one being tomorrow at 5:00am PST.

I’ve gone ahead and drafted up some changes to the Writing your first contribution page.

@villager thanks for the additional thoughts and taking the initiative to start drafting actual changes!

I was starting to read through the proposal but I feel like for me to review it well, I’ll have to actually try to make a new change using the updated proposed version of the instructions. It’s too hard for me to accurately imagine it as I read without actually following the steps to see if it makes sense in the moment in practice.

I’m happy to do that, I just have a few too many things on my plate at the moment so I just wanted to say I see what you did and do plan to look at it closer, it just might take me a while to circle back