Gerrit Workflow
We're using Gerrit for code inspections and for managing changes to branches. The workflow for a change in Gerrit begins with an inspection request, and once the request has been approved, it is pushed directly to the branch by the gatekeeper. We don't need to manage patches externally, or manage our landing process using other tools - all of it can be done in Gerrit. Please review the Using Gerrit page for more details on how Gerrit and Git are used together.
Requirements for patch submission
All patches that land on the main release branches in the fs/lustre-release
repository must conform to the Lustre Coding Guidelines, pass the standard Lustre regression tests. All patches should be associated with a Lustre Jira ticket, and by signed off by the developer. Bug fixes should include additional regression tests. Feature patches should include new regression tests to exercise the feature, and potentially performance or load tests as appropriate for the change. All changes submitted to the fs/lustre-release
repository will be tested automatically with the Lustre regression tests in lustre/tests
and a link to the test results (saved in Maloo) and a pass/fail review comment will be added to the Gerrit change. For additional tests run outside of autotest, the results can either be sent to Maloo manually, or test results can be posted into the Jira ticket associated with the patch.
If there are a series of changes being made to the code (e.g. code style fixes, renaming some functions, adding function parameters, moving code from one file to another, making the actual fix for a bug, making some additional fixes to other defects found during coding), these should all go into separate patches for inspection and testing. Having a series of smaller patches, each of which makes a single, clearly understood change speeds up inspection significantly. Ordering uncontroversial and easy-to-inspect changes first in a patch series ensures that they are only inspected a single time, and can land quickly. Ordering complex changes at the end of the patch series ensures that if changes are requested by the inspectors for these patches, the earlier ones do not need to be re-inspected and re-tested for each update. Following this patch submission model speeds up patch landing, and reduces the burden on the patch inspector, and test systems, and reduces the time that the patch submitter needs to spend waiting or rebasing in order to get their patches accepted.
If there are a number of patches on a git branch, pushing the changes to Gerrit will result in the entire series of patches being sent, with a separate change for each patch. Gerrit correctly tracks dependencies for these patches. If the patches are rebased, either on a new Lustre version, or one of the earlier patches in the series is modified, then all modified patches will be resubmitted to Gerrit for re-inspection, build, and testing.
Any patches that require updates to the Lustre manual will also need to submit documentation updates when the patch is ready for submission. See the link Making changes to the Lustre Manual.
For code that requires modifications or additions to the existing suite of automated Lustre tests, the new or modified test scripts must be submitted with the patch. If there is a defect in the existing code, it means that there is no regression test that covers this code path. A new test should be written that confirms the problem be hit by the test before the fix is landed, and verifies the patch resolves the problem afterward. Any additional testing that cannot be covered by the existing automated Lustre tests must also be documented with a clear, step-by-step test plan, and arrangements must be made with the Lustre test team to execute these plans.
Submitting a change to a Lustre Release
The git URLs here assume you have updated your ~/.ssh/config
using the suggestions in Using Gerrit.
The repository we are using for releases is fs/lustre-release
. This is the repository to push to when you request an inspection for a change that is ready for a release. There are currently only two branches here, b1_8 and master, which is the branch for 2.X releases.
git clone ssh://review/fs/lustre-release
Push the change to the fs/lustre-release
repository for inspection and eventual submission to the master branch:
git push origin HEAD:refs/for/master
Once a change request has received at least two positive inspections (and ideally no negatives), the gatekeeper for the branch will, at her discretion, submit the change directly from Gerrit. If a patch no longer applies cleanly to the branch, then it will need to be updated by the developer, and the gatekeeper should be notified when the patch is ready again. The gatekeeper will decide if additional inspections are required or if it is ready to land.
Patch landing process
Brief summary for landing patch to lustre in Whamcloud:
- Test and commit your patch locally.
- Verify patch follows Lustre Coding Guidelines with
git show | build/checkpatch.pl -
- Push your patch to Gerrit for inspection, and request at least two inspectors (preferably with experience in this area of code).
- Test your patch on real cluster and upload your test results to Maloo.
- Add a comment on Gerrit with the Maloo link to indicate that the patch works, and set the
Verified
flag. - Add the branch gatekeeper as inspector on Gerrit to notify him/her that the patch is ready.
- The branch gatekeeper will review the patch, confirm the test results, and submit it when everything goes well.
- If the submission failed due to conflict(s), the gatekeeper will ask you to rebase your patch with the target branch and repeat above steps.
- If your patch is useful for other branch(es), please repeat above steps against corresponding branch(es).