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. 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.
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 code 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"). 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.
Resist 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 cl push
You need to explicitly request the reviewer to commit for you. You should add "Contributed by firstname.lastname@example.org" in your change description.
Alternatively, in the Reitveld issue, there is a "commit" check box. If you check that, it will send your patch to the build bots, and if all platforms pass, your change will be auto committed. If it fails, check the logs from the buildbot failure. You can find the logs by searching the waterfall for your changelist number and clicking into the links where I see the red failure blocks. If the failure appears unrelated to your change, it is OK to check the commit check box again and retry.
If 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.