A prerequisite for T129068: Improve code contribution guidelines for patch authors.
Because when those instructions to set up Git and Gerrit make me give up, I won't ever need to get to the Code Contribution guidelines.
Description
| Status | Assigned | Task | |
|---|---|---|---|
| · · · | |||
| Resolved | Aklapper | T129068 Improve code contribution guidelines for patch authors | |
| Resolved | Aklapper | T134256 Make Wikimedia's Git/Gerrit documentation less horrible and less scattered | |
| Resolved | Aklapper | T134126 Merge numeous "Git/Gerrit troubleshooting/problems" sections | |
| · · · |
Posting a quick update. As this is complex and as I might wonder what I've been up to.
Work so far (so far in the last two days):
- https://wikitech.wikimedia.org/w/index.php?title=Help%3AGit&type=revision&diff=478303&oldid=161280
- https://www.mediawiki.org/w/index.php?title=Gerrit&type=revision&diff=2114718&oldid=2100476
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2114673&oldid=2063853
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FCode_review&type=revision&diff=2114738&oldid=2100063
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FCode_review%2FGetting_reviews&type=revision&diff=2113564&oldid=1910448
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FGetting_started&type=revision&diff=2114721&oldid=2063841
- https://www.mediawiki.org/w/index.php?title=Gerrit%2Fresolve_conflict&type=revision&diff=2114666&oldid=2039632 (killed)
- https://www.mediawiki.org/w/index.php?title=Git%2FReferences&type=revision&diff=2114444&oldid=775837
- https://www.mediawiki.org/w/index.php?title=Git%2FTips&type=revision&diff=2114739&oldid=1936594
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2114614&oldid=2101411
- went through https://www.mediawiki.org/wiki/Special:PrefixIndex/Code_review/ - only SVN pages here; I added {{Historical}} to all of them
Stuff to do (not at all a complete list):
- Kill https://www.mediawiki.org/wiki/Git/Rebase :
- "Create a new branch" on https://www.mediawiki.org/wiki/Git/Rebase seems to be the same as https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_into_single_commit
- "Perform an interactive rebase" on https://www.mediawiki.org/wiki/Git/Rebase does not explain when I would want to do that. Explain and then either move it into https://www.mediawiki.org/wiki/Gerrit/Advanced_usage or keep it as a sub-item under https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_into_single_commit ?
- T134126: Merge numeous "Git/Gerrit troubleshooting/problems" sections
- https://www.mediawiki.org/wiki/Gerrit/Tutorial#Prepare_to_work_with_Gerrit
- Split the "git-review" installation section on https://www.mediawiki.org/wiki/Gerrit/Tutorial into "per OS" subsections. Or move to https://www.mediawiki.org/wiki/Gerrit/git-review subpage after checking dedicated subpage on content duplication.
- Kill all the Linux-distribution specific stuff in https://www.mediawiki.org/wiki/Gerrit/Tutorial and make sure it is on https://www.mediawiki.org/wiki/Gerrit/git-review instead. Recommend to use the package/software management application of their choice instead. This is 2016.
- And there is also the same stuff in https://wikitech.wikimedia.org/Help:Git
- On https://www.mediawiki.org/wiki/Gerrit/Tutorial, move sections "Squash into single commit", "Push to a branch different than master" and "Amending a change (your own or someone else's)" into a separate "special cases" section as it's not part of the rest of the step-by-step workflow in that section
- https://www.mediawiki.org/wiki/Git/Tips - kill by merging into https://www.mediawiki.org/wiki/Gerrit/Advanced_usage ?
- Clean up link sections on https://www.mediawiki.org/wiki/Gerrit - they are a mess, talks about "Code review". Have this more structured and imagine to be on the page for the first time as a user who wants to start contributing and has not used this yet: What steps should I have performed already / which pages read? https://www.mediawiki.org/wiki/Developer_access etc? If so, say so.
Quick status update:
- https://www.mediawiki.org/wiki/Git/Rebase :
- DONE: Kill "Create a new branch": https://www.mediawiki.org/w/index.php?title=Git%2FRebase&type=revision&diff=2124790&oldid=2124783
- DONE: Fixed "Perform an interactive rebase" in https://www.mediawiki.org/w/index.php?title=Git%2FRebase&type=revision&diff=2124782&oldid=1938256
- DONE: Kill page by merging its content with https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_into_single_commit where it belongs: https://www.mediawiki.org/w/index.php?title=Git%2FRebase&type=revision&diff=2125538&oldid=2124790 and https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2125541&oldid=2125539
- TODO: The content related to Change-Id's feels contradictive in https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_several_commits_into_one_single_commit_via_rebase . Check with someone who knows better.
- DONE: T134126: Merge numeous "Git/Gerrit troubleshooting/problems" sections
- https://www.mediawiki.org/wiki/Gerrit/Tutorial#Prepare_to_work_with_Gerrit
- TODO: Split the "git-review" installation section on https://www.mediawiki.org/wiki/Gerrit/Tutorial into "per OS" subsections. For example Mac OS is in several places. Or move to https://www.mediawiki.org/wiki/Gerrit/git-review subpage after checking dedicated subpage on content duplication.
- TODO: Kill all the Linux-distribution specific stuff in https://www.mediawiki.org/wiki/Gerrit/Tutorial and make sure it is on https://www.mediawiki.org/wiki/Gerrit/git-review instead. Recommend to use the package/software management application of their choice instead. This is 2016.
- https://www.mediawiki.org/wiki/Gerrit/mass_approval
- DONE: Merge into https://www.mediawiki.org/wiki/Gerrit/Advanced_usage ? That page is not linked from anywhere, apart from one bottom "See Also" section on https://www.mediawiki.org/wiki/Gerrit/Advanced_usage : https://www.mediawiki.org/w/index.php?title=Gerrit%2Fmass_approval&type=revision&diff=2125292&oldid=1911150 and https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2125291&oldid=2124826
- https://www.mediawiki.org/wiki/Gerrit/merge_submodule
- DONE: Nothing links to this page and nobody might ever find it. Link from https://www.mediawiki.org/wiki/Gerrit/Advanced_usage : https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2125293&oldid=2125291
- https://www.mediawiki.org/wiki/Gerrit/personal_sandbox
- DONE: Link from explicit section in https://www.mediawiki.org/wiki/Gerrit/Advanced_usage. That page is not linked from anywhere, apart from one bottom "See Also" section: https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2125296&oldid=2125294
- https://www.mediawiki.org/wiki/Gerrit/Tutorial
- DONE: Move sections "Squash into single commit", "Push to a branch different than master" and "Amending a change (your own or someone else's)" into a separate "Other common situations" section as it's not part of the rest of the step-by-step workflow in that section: https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2124814&oldid=2117227
- DONE: Update outdated Gerrit screenshots: https://www.mediawiki.org/wiki/File:Chrome_gerrit_9332.png and https://www.mediawiki.org/wiki/File:Chrome_gerrit_9332_2.png
- TODO: IMHO all those screenshots were added with good intentions but make it really hard to follow a list of steps. (I suffered from that myself.) Remove some or add some as a thumbnail links on the side instead.
- https://www.mediawiki.org/wiki/Git/Tips
- DECLINED: Kill by merging into https://www.mediawiki.org/wiki/Gerrit/Advanced_usage#Other_tips ? Nah, not doing that as I don't feel happy mixing Gerrit and Git docs that radically..
- https://www.mediawiki.org/wiki/Gerrit
- TODO: Clean up link sections - they feel messier than needed. Have this more structured and imagine to be on the page for the first time as a user who wants to start contributing and has not used this yet: What steps should I have performed already / which pages read? https://www.mediawiki.org/wiki/Developer_access etc? If so, say so.
- TODO: There is also the same duplicated stuff in https://wikitech.wikimedia.org/Help:Git. Bleh.
- DONE: Enough other smaller commits...
Quick status update:
- https://www.mediawiki.org/wiki/Git/Rebase :
- DONE: Kill "Create a new branch": https://www.mediawiki.org/w/index.php?title=Git%2FRebase&type=revision&diff=2124790&oldid=2124783
- DONE: Fixed "Perform an interactive rebase" in https://www.mediawiki.org/w/index.php?title=Git%2FRebase&type=revision&diff=2124782&oldid=1938256
- DONE: Kill page by merging its content with https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_into_single_commit where it belongs: https://www.mediawiki.org/w/index.php?title=Git%2FRebase&type=revision&diff=2125538&oldid=2124790 and https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2125541&oldid=2125539
- DONE: The content related to Change-Id's feels contradictive in https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_several_commits_into_one_single_commit_via_rebase . Check with someone who knows better. --- Thanks to Bawolff: https://www.mediawiki.org/w/index.php?title=Gerrit/Tutorial&diff=0&oldid=2125541
- DONE: T134126: Merge numeous "Git/Gerrit troubleshooting/problems" sections
- https://www.mediawiki.org/wiki/Gerrit/Tutorial#Prepare_to_work_with_Gerrit
- DONE: Split the "git-review" installation section on https://www.mediawiki.org/wiki/Gerrit/Tutorial into "per OS" subsections. For example Mac OS is in several places. Or move to https://www.mediawiki.org/wiki/Gerrit/git-review subpage after checking dedicated subpage on content duplication. Kill all the Linux-distribution specific stuff in https://www.mediawiki.org/wiki/Gerrit/Tutorial and make sure it is on https://www.mediawiki.org/wiki/Gerrit/git-review instead. Recommend to use the package/software management application of their choice instead. --- https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2126272&oldid=2126263 and https://www.mediawiki.org/w/index.php?title=Gerrit%2Fgit-review&type=revision&diff=2126273&oldid=2124846
- https://www.mediawiki.org/wiki/Gerrit/mass_approval
- DONE: Merge into https://www.mediawiki.org/wiki/Gerrit/Advanced_usage ? That page is not linked from anywhere, apart from one bottom "See Also" section on https://www.mediawiki.org/wiki/Gerrit/Advanced_usage : https://www.mediawiki.org/w/index.php?title=Gerrit%2Fmass_approval&type=revision&diff=2125292&oldid=1911150 and https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2125291&oldid=2124826
- https://www.mediawiki.org/wiki/Gerrit/merge_submodule
- DONE: Nothing links to this page and nobody might ever find it. Link from https://www.mediawiki.org/wiki/Gerrit/Advanced_usage : https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2125293&oldid=2125291
- https://www.mediawiki.org/wiki/Gerrit/personal_sandbox
- DONE: Link from explicit section in https://www.mediawiki.org/wiki/Gerrit/Advanced_usage. That page is not linked from anywhere, apart from one bottom "See Also" section: https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2125296&oldid=2125294
- https://www.mediawiki.org/wiki/Gerrit/Tutorial
- DONE: Move sections "Squash into single commit", "Push to a branch different than master" and "Amending a change (your own or someone else's)" into a separate "Other common situations" section as it's not part of the rest of the step-by-step workflow in that section: https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2124814&oldid=2117227
- DONE: Update outdated Gerrit screenshots: https://www.mediawiki.org/wiki/File:Chrome_gerrit_9332.png and https://www.mediawiki.org/wiki/File:Chrome_gerrit_9332_2.png
- DECLINED: IMHO all those screenshots were added with good intentions but make it really hard to follow a list of steps. (I suffered from that myself.) Remove some or add some as a thumbnail links on the side instead or convert the terminal screenshots into actual <pre> text (what a crazy idea!), but anybody can do that and perfect is the enemy of good hence declining in this list.
- https://www.mediawiki.org/wiki/Git/Tips
- DECLINED: Kill by merging into https://www.mediawiki.org/wiki/Gerrit/Advanced_usage#Other_tips ? Nah, not doing that as I don't feel happy mixing Gerrit and Git docs that radically..
- https://www.mediawiki.org/wiki/Gerrit
- TODO: Clean up link sections - they feel messier than needed. Have this more structured and imagine to be on the page for the first time as a user who wants to start contributing and has not used this yet: What steps should I have performed already / which pages read? https://www.mediawiki.org/wiki/Developer_access etc? If so, say so.
- DONE: There is some duplicated stuff in https://wikitech.wikimedia.org/Help:Git. Didn't really touch wikitech but link to mw:Gerrit at least: https://wikitech.wikimedia.org/w/index.php?title=Help%3AGit&action=historysubmit&type=revision&diff=511896&oldid=478303
- DONE: Enough other smaller commits...
Last item left before I consider this task "acceptable" and hence resolved (as perfect is the enemy of good):
- TODO: Clean up https://www.mediawiki.org/wiki/Gerrit
- DONE: Marked https://www.mediawiki.org/wiki/Gerrit/Tagging as historical.
- TODO: Merge https://www.mediawiki.org/wiki/Gerrit/HTTPS (written by legoktm) into https://www.mediawiki.org/wiki/Gerrit/Troubleshooting#Push_using_HTTPS_.28when_SSH_is_not_functional.29 and redirect afterwards.
- TODO: Make https://www.mediawiki.org/Gerrit useful and helpful and links descriptive.
I went through mw:Gerrit/* subpages to check which ones are relevant and to link from mw:Gerrit.
I'll drop my thoughts for that specific page https://www.mediawiki.org/wiki/Gerrit in this comment so I can pick them up tomorrow again:
- Prerequisites:
- dev env (vagrant); link to developer_hub and how_to_become_a_hacker, etc
- Get the code and submit your first patch:
- Gerrit/Tutorial - A thorough guide to using Git and Gerrit for MediaWiki development
- Gerrit/Getting started - A very short guide to using Git and Gerrit for MediaWiki development
- Tutorials and help for Gerrit:
- Gerrit/Advanced usage - How to do things "the hard way" in gerrit
- Gerrit/Troubleshooting - Problems and how to solve them
- Gerrit/Navigation - How to navigate Gerrit's interface
- Gerrit/FAQ - Frequently asked questions concerning how to use Git and Gerrit
- Gerrit/GitHub - About integration with the GitHub service
- For code contributors / authors:
- Gerrit/Code review/Getting reviews - Learn how to get your patches reviewed
- Gerrit/Commit message guidelines - Learn how to write good commit summaries
- For code reviewers:
- Gerrit/Code review - Learn how to perform code review. Your help reviewing changes is welcome!
- Gerrit/+2 - Guidelines for reviewers with merging rights in Gerrit
- For project owners / administration:
- Gerrit/Inactive projects - Guidelines how to handle inactive projects
- Gerrit/New repositories - How to create a new project in Gerrit
- Gerrit/Project ownership - How to become the owner of a project in Gerrit
- Gerrit/+2 - Guidelines for reviewers with merging rights in Gerrit
- If you only want to get the code and do not plan to propose changes:
- To simply browse & fork our code you can use the GitHub mirror. (TODO: We ignore pull requests according to https://www.mediawiki.org/wiki/Gerrit/GitHub#..._but_not_pull_requests , hence don't advertise like that?? In any case, link to mw:gerrit/GitHub from here)
- To make an anonymous git clone of core MediaWiki... (TODO: again: is that relevant here? readonly?! Maybe just remove this whole section and move both items to better places in the mw:Gerrit/Tutorial?)
- See Also:
- .... (what's already there)
- DONE: Make https://www.mediawiki.org/Gerrit useful and helpful and links descriptive.
- DONE: Move GitHub details from mw:Gerrit to mw:Gerrit/GitHub: https://www.mediawiki.org/w/index.php?title=Gerrit%2FGitHub&type=revision&diff=2127490&oldid=2013256 and https://www.mediawiki.org/w/index.php?title=Gerrit&type=revision&diff=2127492&oldid=2126277
- TODO: Merge https://www.mediawiki.org/wiki/Gerrit/HTTPS (written by legoktm) into https://www.mediawiki.org/wiki/Gerrit/Troubleshooting#Push_using_HTTPS_.28when_SSH_is_not_functional.29 and redirect afterwards. - Andre pinged legoktm on #wikimedia-dev about this.
- DONE by legoktm: Merge https://www.mediawiki.org/wiki/Gerrit/HTTPS into https://www.mediawiki.org/wiki/Gerrit/Troubleshooting#Push_using_HTTPS_.28when_SSH_is_not_functional.29 and redirect afterwards: https://www.mediawiki.org/w/index.php?title=Gerrit%2FTroubleshooting&type=revision&diff=2141296&oldid=2117220 and https://www.mediawiki.org/w/index.php?title=Gerrit%2FHTTPS&type=revision&diff=2141310&oldid=2001736
135 edits later, we're done with this part I'd say.
Big thanks to everybody who helped with edits and input!
I also emailed wikitech-l.
Done:
- https://wikitech.wikimedia.org/w/index.php?title=Help%3AGit&type=revision&diff=511896&oldid=161280 (6 edits)
- https://www.mediawiki.org/w/index.php?title=Gerrit&type=revision&diff=2142480&oldid=2100476 (7 edits)
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FAdvanced_usage&type=revision&diff=2125296&oldid=2063853 (17 edits)
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FCode_review&type=revision&diff=2119314&oldid=2100063 (14 edits)
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FCode_review%2FGetting_reviews&type=revision&diff=2125544&oldid=1910448 (7 edits)
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FGetting_started&type=revision&diff=2114721&oldid=2063841 (1 edit)
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FGitHub&type=revision&diff=2127490&oldid=2013256 (1 edit)
- https://www.mediawiki.org/w/index.php?title=Gerrit%2Fgit-review&type=revision&diff=2126273&oldid=2101955 (19 edits)
- https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2126893&oldid=2101411 (46 edits)
- https://www.mediawiki.org/w/index.php?title=Git%2FReferences&type=revision&diff=2127435&oldid=775837 (3 edits)
- https://www.mediawiki.org/w/index.php?title=Git%2FTips&type=revision&diff=2115044&oldid=1936594 (2 edits)
- Updated two screenshots
- Created https://www.mediawiki.org/wiki/Gerrit/Troubleshooting (6 edits)
- Killed https://www.mediawiki.org/wiki/Gerrit/resolve_conflict
- Killed https://www.mediawiki.org/wiki/Git/Rebase
- Killed https://www.mediawiki.org/wiki/Gerrit/mass_approval
- Killed https://www.mediawiki.org/wiki/Gerrit/HTTPS
Not done:
- I'm still wondering about the role of https://www.mediawiki.org/wiki/Git_for_dummies compared to https://www.mediawiki.org/wiki/Gerrit/Getting_started and https://www.mediawiki.org/wiki/Gerrit/Tutorial.
- I still consider the screenshots of command line text output distractive on https://www.mediawiki.org/wiki/Gerrit/Tutorial.
- Very likely more.
Next steps:
Something I had seen while asking Hackathon participants to move top down in https://www.mediawiki.org/wiki/Gerrit/Tutorial
- https://www.mediawiki.org/wiki/Gerrit/Tutorial#Prepare_to_work_with_Gerrit - the gerrit installation is fine, but there in the subsection https://www.mediawiki.org/wiki/Gerrit/Tutorial#Setting_up_git-review - the git review -s should be run inside core/ which will only happen in the following 'How to submit a patch' doc. This is clear from the screenshot too. People get stuck here, as they keep on trying git review -s and the error message fatal: Not a git repository (or any parent up to mount point /home) shows up. Solution would be to move this from there, and I think it is not needed too, as clone via git from wm gerrit, and the first patch push would automatically setup gerrit for you.
- Downloading of MW core is given in https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch - this creates confusion and should be renamed as 'Download Mediawiki code (core) from Gerrit' or something like that. I think the downloading of core an extensions section can be a subsection in the submit a patch too, which would make more sense.
- https://www.mediawiki.org/wiki/Gerrit/Tutorial#Download_the_Examples_extension_using_Git is wrongly placed - at that point the user do not have MW core or anything cloned, and I see participants just downloading the Examples extension to maybe their home directory (or wherever their terminal is pointing), and thats it. Solution: Maybe put that one as an alternative or equivalent to downloading extension in current https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch.
These are found to be frequent blockers during hackathons and other events, and I am sure other devs too had been at similar situations.
Something more. This has happened many times, and I just think some fix with the document might help here.
tonythomas> in https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch -- it is said just to clone the Mediawiki core, and I see people just execute that command straightaway, while it should be actually done from the webserver DocumentRoot
17:51 <tonythomas> this can be like /var/www/html/ in most apache installs
17:51 <tonythomas> all my attendees (I guess), gets stuck here, and just clone the thing from where the terminal is at that point, and then wonders
17:52 <tonythomas> but its an expected knowledge for someone who have done something with php, apache etc, that the app should rest in the DocumentRoot, though
@01tonythomas: Thanks! This is extremely viable feedback.
Not 100% happy but I tried to improve things:
- Downloading of MW core is given in https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch - this creates confusion and should be renamed as 'Download Mediawiki code (core) from Gerrit' or something like that. I think the downloading of core an extensions section can be a subsection in the submit a patch too, which would make more sense.
- https://www.mediawiki.org/wiki/Gerrit/Tutorial#Download_the_Examples_extension_using_Git is wrongly placed - at that point the user do not have MW core or anything cloned, and I see participants just downloading the Examples extension to maybe their home directory (or wherever their terminal is pointing), and thats it. Solution: Maybe put that one as an alternative or equivalent to downloading extension in current https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch.
Fixed by yourself in https://www.mediawiki.org/w/index.php?title=Gerrit%2FTutorial&type=revision&diff=2236574&oldid=2235784