If you want to contribute code to Chromium, there are a few things you can do to make the process flow smoothly. For Chromium OS, please go here. Quick start guide: Life of a Chromium Developer Note: These instructions apply only if your changes are in Chromium code. If your changes are in a directory that we pull from another repository (e.g. WebKit, v8, skia, gtest, gmock), you need to use that project's way of getting code submitted. For example, here are the WebKit instructions on how to contribute code. Once your change has landed upstream, you need to update Chromium's DEPS file to pull in the new revision (we update WebKit very often, so you don't have to take care of this if you're contributing to WebKit). Communicate
Get your code ready
Review Tools
Life of a Change listFind a reviewerIdeally, the reviewer is someone who is familiar with the area of code you are touching. If you have doubts, look at the svn blame or git blame for the file to see who else has been editing it. Failing that, ask on #chromium or #chromium-os on irc.freenode.net. You can also just request review from the respective lists (Chromium | Chromium OS), but more specific review requests will be attended to sooner.Create a change list (CL)GCLRun gcl help for some doc.Make a changelist with the gcl change command . The changelist name is only to help you refer to it on your local computer, so call it whatever you want: C:\code\src\chromium\src> gcl change mychangeThis will open your text editor. Write the change description at the top of the file. The description should
describe what your patch changes and why. This is important for people
who are looking at commit logs in the future to track down an issue:
they should be able to see why you changed it without going anywhere
else. If there's an associated bug file, you should also add a BUG=bug_number line so they can find the associated bug. If you have manual test instructions that you want to pass to the test team so that they can validate the fix, add TEST=how_test_test at the end of the description. If there is no bug or test, leave out the lines. Multiple bugs can be listed, comma separated. Example:
Increase the goat teleporter timeout threshold to 100 because the oldvalue of 10 caused problems for extremely overweight goats. Tests showthat the largest goat in existence should be teleported in 50ms, so...BUG=31337,2754TEST=Try loading an overweight goat and confirm the teleporter works.Broken frame code in Chrome led to black holes spontaneously appearing in ChromeOS devices. BUG=chromium-os:1234TEST=The world is not converted to a small supermassive point on startup. Cut and paste the filenames above or below the divider to add files to or remove files from the changelist. You can use the gcl opened command to see your changed files and changelists:
C:\code\src\chromium\src> gcl openedM chrome\browser\browser.vcproj ← this is a modified file not in any changelist--- Changelist mychange:M chrome\browser\browser.ccGIT CLCreating a change in git is really just creating a branch. git checkout -b mychange origin/masterUpload your change to RietveldRietveld is the open source code review tool we use. We use an AppEngine instance at http://codereview.chromium.org. GCLUse the
gcl upload command:C:\code\src\chromium\src> gcl upload mychangeIssue created. URL: http://codereview.chromium.org/123456Uploading chrome\browser\browser.cc (1/1)You may have to enter a Google Account username and password, for example your Gmail credentials but it's not required to be a Gmail account. The URL it gives you is the page where the review can be accessed. If you want to upload a new copy of your patch, optionally add or remove files using gcl change and upload it again using the same gcl upload command.Once you've uploaded your change and know its patch URL, add that to the bug comments. That way someone coming along later can make comments or see how the bug was fixed. GIT CLUse the git cl upload command:git cl upload Request reviewGo to the supplied URL or just go to the respective code review page (Chromium | Chromium OS) and click Issues created by me. Select the change you want to submit for review and click Edit Issue. Enter at least one reviewer's email address and click Update Issue. Now click on Publish+Mail Comments, add any optional notes, and send your change off for review. All Chromium code reviews are automatically cc'd to their respective review groups, so that everyone has an opportunity to see and comment on the changes being made.
Note: If you don't see editing commands on the review page, click Log In in the upper right. Hint: You can add
-r reviewer@example.com --send-mail to send the email directly when uploading a change in both gcl and git-cl.The review processChromium and Chromium OS reviewers try to review code that conforms to these guidelines as quickly as possible. You should hear back within 24-48 hours. Remember though, if you submit a giant patch, or do a bunch of work without discussing it with the relevant people, you may have a hard time convincing anyone to review it! Speak with others early and often. Sometimes, the tree will be locked down and certain types of changes won't be allowed. This is true when we're preparing a release. During times like these, reviewers may be focused on fixing the bugs required to get the release out the door.Remember that code reviews are an important part of the engineering process. The reviewer will almost always have suggestions or style fixes for you, and it's important not to take such suggestions personally or as a commentary on your abilities or ideas. This is a process where we work together to make sure that the highest quality code gets submitted!
You will likely get email back from the reviewer with comments. Fix these and update the patch set in the issue by uploading again. The upload will explain that it is updating the current CL and ask you for a message explaining the change. GCL Add any new files that need to be added to your checkout gcl change changelist_namegcl upload changelist_nameGIT CL If you need to update code the code on an already uploaded CL, simply edit the code, commit it again locally, and then run git cl upload again e.g. echo "" > GOATSgit add GOATSgit commit -m 'add newline fix to GOATS'git cl uploadOnce you're ready for another review, use Publish+Mail Comments again to send another notification (you can say something like "new snapshot uploaded"). When the reviewer is happy with your patch, they will say "LGTM" ("Looks Good To Me").
Note: As you work through the review process, both you and your reviewers should converse using the code review interface, and send notes using Publish+Mail Comments. Avoid the temptation to respond directly to review mails (or, for reviewers, to send review comments) directly from your email client; doing that won't add your comments to the online record for the issue under review, and can make it hard for others to understand later what the history of a patch was.
Check in your changesGCLgcl commit changelist_nameResist the temptation to just run svn commit, since (a) this will by default submit everything modified and not just your changelist, and (b) gcl commit will automatically create a log message based on your issue description. The descriptions are very important for tracking which bugs were fixed and why a certain change was made. GIT CLgit cl will squash all your commits into a single one with the description you used when you uploaded your change.For Chromium: git cl dcommitFor Chromium OS:git cl pushIf you are not a committer yetYou need to explicitly request the reviewer to commit for you. You should add "Contributed by me@example.com" in your change description.Instructions for Reviewer: Checking-in the patch for a non-committer
Look out for breakage or regressionsIf the most recent set of changes to the repository breaks the build, we say the tree is red, or closed. You cannot check in your changes until it is green again. Check the BuildBot waterfalls (Chromium | Chromium OS) to see that the columns are mostly green before checking in your changes. Otherwise, you will not know if your changes break the build or not. Please be available via the chromium IRC channel when landing changes so that sheriffs may notify you of possible breakages. Hint: Use the try server. See also Committer's responsibility. |