Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - Contributor Agreements |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 2 | |
| 3 | Users can be required to sign one or more contributor agreements before |
| 4 | being able to submit a change in a project. |
| 5 | |
| 6 | Contributor agreements are global and can be configured by modifying |
| 7 | the `project.config` file on the `All-Projects` project. Push permission |
| 8 | needs to be granted for the `refs/meta/config` branch to be able to push |
| 9 | back the `project.config` file. Consult |
| 10 | link:access-control.html[access controls] for details on how access |
| 11 | permissions work. |
| 12 | |
| 13 | To retrieve the `project.config` file, initialize a temporary Git |
| 14 | repository to edit the configuration: |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 15 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 16 | mkdir cfg_dir |
| 17 | cd cfg_dir |
| 18 | git init |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 19 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 20 | |
| 21 | Download the existing configuration from Gerrit: |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 22 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 23 | git fetch ssh://localhost:29418/All-Projects refs/meta/config |
| 24 | git checkout FETCH_HEAD |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 25 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 26 | |
| 27 | Contributor agreements are defined as contributor-agreement sections in |
| 28 | `project.config`: |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 29 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 30 | [contributor-agreement "Individual"] |
| 31 | description = If you are going to be contributing code on your own, this is the one you want. You can sign this one online. |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 32 | agreementUrl = static/cla_individual.html |
| 33 | autoVerify = group CLA Accepted - Individual |
| 34 | accepted = group CLA Accepted - Individual |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 35 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 36 | |
| 37 | Each `contributor-agreement` section within the `project.config` file must |
| 38 | have a unique name. The section name will appear in the web UI. |
| 39 | |
David Pursehouse | 05d502f | 2016-08-22 17:46:31 +0900 | [diff] [blame] | 40 | If not already present, add the group(s) used in the `autoVerify` and |
| 41 | `accepted` variables in the `groups` file: |
| 42 | ---- |
| 43 | # UUID Group Name |
| 44 | # |
| 45 | 3dedb32915ecdbef5fced9f0a2587d164cd614d4 CLA Accepted - Individual |
| 46 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 47 | |
| 48 | Commit the configuration change, and push it back: |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 49 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 50 | git commit -a -m "Add Individual contributor agreement" |
| 51 | git push ssh://localhost:29418/All-Projects HEAD:refs/meta/config |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 52 | ---- |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 53 | |
| 54 | [[contributor-agreement.name.description]]contributor-agreement.<name>.description:: |
| 55 | + |
| 56 | Short text describing the contributor agreement. This text will appear |
| 57 | when the user selects an agreement. |
| 58 | |
Marc Petit-Huguenin | bbb8549 | 2012-12-03 11:11:00 -0800 | [diff] [blame] | 59 | [[contributor-agreement.name.agreementUrl]]contributor-agreement.<name>.agreementUrl:: |
| 60 | + |
| 61 | An absolute URL or a relative path to an HTML file containing the text |
| 62 | of the contributor agreement. The URL must use the http or https |
| 63 | scheme. The path is relative to the `gerrit.basePath` variable in |
| 64 | `gerrit.config`. |
| 65 | |
| 66 | [[contributor-agreement.name.autoVerify]]contributor-agreement.<name>.autoVerify:: |
| 67 | + |
| 68 | If present, the user can sign the contributor agreement online. The |
| 69 | value is the group to which the user will be added after signing the |
| 70 | agreement. The group's UUID must also appear in the `groups` file. |
| 71 | |
| 72 | [[contributor-agreement.name.accepted]]contributor-agreement.<name>.accepted:: |
| 73 | + |
| 74 | List of groups that will be considered when verifying that a |
| 75 | contributor agreement has been accepted. The groups' UUID must also |
| 76 | appear in the `groups` file. |
| 77 | |
| 78 | GERRIT |
| 79 | ------ |
| 80 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 81 | |
| 82 | SEARCHBOX |
| 83 | --------- |