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. Blink, v8, skia, gtest, gmock), you need to use that project's way of getting code submitted. For example, here is a cheatsheet for contributing to Blink, and here's Chrome DevTools. Once your change has landed upstream, you need to update Chromium's DEPS file to pull in the new revision (we update Blink very often, so you don't have to take care of this if you're contributing to Blink).
You either use
Make a changelist with the
This 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:
NOTE: "BUG=xxx" will update the bug in the default issue tracker for the repository you're committing to. That means if you're checking into the chromium-os repository, the bug is assumed to be a chromium-os bug number, and if the chrome repository, a chrome bug number. If this isn't right, you can preface each bug number with chromium: or chromium-os: as appropriate to cause the correct bug to be updated. (Failing to do this will lead to very confused engineers who get the wrong bug mailed to them.)
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:
Creating a change in git is really just creating a branch.
Rietveld is the open source code review tool we use. We use an AppEngine instance at http://codereview.chromium.org.
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
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.
If you specified Rfirstname.lastname@example.org in the CL description, they will be emailed automatically so use --send-mail so you don't need to visit the web UI.
Go 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
Ideally, the reviewer is someone who is familiar with the area of code you are touching. If you have doubts, look at the
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.
Add any new files that need to be added to your checkout
If you need to update the code on an already uploaded CL, simply
Once you're ready for another review, use Publish+Mail Comments again to send another notification (you can say something like "new snapshot uploaded" or PTAL "Please Take A/Another Look").
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.
When the reviewer is happy with your patch, they will say "LGTM" ("Looks Good To Me"). The reviewer types this exact text (case-insensitive, so "lgtm" also works) in their comment, which is detected by Rietveld and marks approval. If this is accidentally typed, writing "not LGTM" withdraws approval.
You need approval from OWNERS of all affected files, either before committing (ex ante) or after committing (ex post).
LGTM gives ex ante approval, which is generally best, and if you have a LGTM from OWNERS of all affected files, you can commit the CL.
Alternatively (instead of getting an LGTM), you can list the OWNERS in the
It is also possible to get an LGTM from some OWNERS and list others in TBR.
The preferred way of committing changes is via the commit queue. This is done by checking the "commit" check box in Rietveld, or from the command line via
Alternatively, it is possible to directly commit your change, bypassing the commit queue. This is discouraged, due to not running the tests, and requires more supervision on the part of the committer, but is acceptable or necessary in certain circumstances. Only committers can commit changes. If you are not a committer, you should try to commit via the commit queue first. If that doesn't work for some reason, ask your reviewer to commit it for you, and add "Contributed by email@example.com" in your change description for clarity.