We use GitHub for tracking Vanadium issues: https://github.com/vanadium/issues/issues
Follow the installation instructions to set up a JIRI_ROOT
directory and fetch all Vanadium repositories.
The instructions below assume you've set the JIRI_ROOT
environment variable and have added $JIRI_ROOT/devtools/bin
to your PATH
:
# Edit to taste. export JIRI_ROOT=${HOME}/vanadium export PATH=$PATH:$JIRI_ROOT/devtools/bin
Recommended: Add the lines above to your ~/.bashrc
or similar.
Before patches can be accepted, contributors must sign the Google Individual Contributor License Agreement (CLA), which can be done online. The CLA is necessary since contributors own the copyright to their code, even after it becomes part of the codebase, so permission is required to use and distribute that code. Contributors don't have to sign the CLA until after a patch has been submitted for review and a member has approved it, but the CLA must be signed before the patch is committed into the codebase.
Contributions made by corporations are covered by a different agreement than the one above, the Software Grant and Corporate Contributor License Agreement.
To send code reviews and commit changes, you must create an account on vanadium.googlesource.com:
Before starting work on a large change, we recommend that you file an issue with your idea so that other contributors and authors can provide feedback and guidance. (For small changes, this is not necessary.)
All of the individual Vanadium projects use Git for version control. The “master” branch of each local repository is reserved for tracking the remote https://vanadium.googlesource.com counterpart. All Vanadium development should take place on a non-master (feature) branch. Once your code has been reviewed and approved, it will be merged into the remote master via our code review system and brought to your local instance via jiri update
.
The only way to contribute to master is via the Gerrit code review process.
To submit a change for review you will need to squash your feature branch into a single commit and send the patch to Gerrit for code review. The jiri tool, in particular the jiri cl
command, simplifies this process.
Sync the master branch to the latest version of the project.
jiri update
Create a new branch for your change.
# Replace `<branch>` with your branch name. jiri cl new <branch>
Make modifications to the project source code.
Stage any changed files for a commit.
git add <file1> <file2> ... <fileN>
Commit your modifications.
git commit
Repeat steps 3-5 as necessary.
Update all of the local master branches using the jiri
command.
jiri update
If you are not already on it, switch to the feature branch that corresponds to the change you are trying to bring up to date with the upstream.
git checkout <branch> git merge master
If there are no conflicts, you are done.
If there are conflicts:
git add <pathspec>...
.git commit
.Switch to the branch that corresponds to the change in question.
git checkout <branch>
Submit your change to Gerrit with the jiri cl
command.
# <reviewers> is a comma-seperated list of emails or LDAPs # Alternatively reviewers can be added via the Gerrit UI jiri cl mail -r=<reviewers>
If you are not sure who to add as a reviewer, you can leave off the -r
flag. Our team periodically scans for unassigned CLs and a reviewer will be added to your CL. If you would rather not wait, feel free to let us know about your change by filing an issue on GitHub.
Switch to the branch that corresponds to the change in question
git checkout <branch>
Modify and commit code as as described above.
Be sure to address each review comment on Gerrit.
Once you have addressed all review comments be sure to reply at the top of the Gerrit UI for the specific patch.
Once you have addressed all review comments, you can update the change with a new patch using:
jiri cl mail
Work with your reviewers to receive “+2” score. If your change no longer applies cleanly due to upstream changes, the reviewer may ask you to rebase it. You will need to follow the steps in the section above: “Syncing a change to the latest version of the project” and then run jiri cl mail
again.
The reviewer will submit your change and it will be merged into the master branch.
Optional: Delete the feature branch once it has been submitted:
git checkout master jiri cl cleanup <branch>
There are several useful shortcuts you can use for quick access to changes and issues.