blob: 2c7b194426377ce43d8620f2319b85bac6dd5ef0 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - Contributor Agreements
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -08002
3Users can be required to sign one or more contributor agreements before
4being able to submit a change in a project.
5
6Contributor agreements are global and can be configured by modifying
7the `project.config` file on the `All-Projects` project. Push permission
8needs to be granted for the `refs/meta/config` branch to be able to push
9back the `project.config` file. Consult
10link:access-control.html[access controls] for details on how access
11permissions work.
12
13To retrieve the `project.config` file, initialize a temporary Git
14repository to edit the configuration:
Michael Ochmannb99feab2016-07-06 14:10:22 +020015----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080016 mkdir cfg_dir
17 cd cfg_dir
18 git init
Michael Ochmannb99feab2016-07-06 14:10:22 +020019----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080020
21Download the existing configuration from Gerrit:
Michael Ochmannb99feab2016-07-06 14:10:22 +020022----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080023 git fetch ssh://localhost:29418/All-Projects refs/meta/config
24 git checkout FETCH_HEAD
Michael Ochmannb99feab2016-07-06 14:10:22 +020025----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080026
27Contributor agreements are defined as contributor-agreement sections in
Bob Badourc48da972018-10-12 14:32:57 -070028`project.config` of `All-Projects`:
Michael Ochmannb99feab2016-07-06 14:10:22 +020029----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080030 [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-Hugueninbbb85492012-12-03 11:11:00 -080032 agreementUrl = static/cla_individual.html
33 autoVerify = group CLA Accepted - Individual
34 accepted = group CLA Accepted - Individual
Bob Badourc48da972018-10-12 14:32:57 -070035 matchProjects = ^/.*$
36 excludeProjects = ^/not/my/project/
Michael Ochmannb99feab2016-07-06 14:10:22 +020037----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080038
39Each `contributor-agreement` section within the `project.config` file must
40have a unique name. The section name will appear in the web UI.
41
David Pursehouse05d502f2016-08-22 17:46:31 +090042If not already present, add the group(s) used in the `autoVerify` and
43`accepted` variables in the `groups` file:
44----
45 # UUID Group Name
46 #
47 3dedb32915ecdbef5fced9f0a2587d164cd614d4 CLA Accepted - Individual
48----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080049
50Commit the configuration change, and push it back:
Michael Ochmannb99feab2016-07-06 14:10:22 +020051----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080052 git commit -a -m "Add Individual contributor agreement"
53 git push ssh://localhost:29418/All-Projects HEAD:refs/meta/config
Michael Ochmannb99feab2016-07-06 14:10:22 +020054----
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080055
56[[contributor-agreement.name.description]]contributor-agreement.<name>.description::
57+
58Short text describing the contributor agreement. This text will appear
59when the user selects an agreement.
60
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080061[[contributor-agreement.name.agreementUrl]]contributor-agreement.<name>.agreementUrl::
62+
63An absolute URL or a relative path to an HTML file containing the text
64of the contributor agreement. The URL must use the http or https
65scheme. The path is relative to the `gerrit.basePath` variable in
66`gerrit.config`.
67
68[[contributor-agreement.name.autoVerify]]contributor-agreement.<name>.autoVerify::
69+
70If present, the user can sign the contributor agreement online. The
71value is the group to which the user will be added after signing the
72agreement. The group's UUID must also appear in the `groups` file.
73
74[[contributor-agreement.name.accepted]]contributor-agreement.<name>.accepted::
75+
76List of groups that will be considered when verifying that a
77contributor agreement has been accepted. The groups' UUID must also
78appear in the `groups` file.
79
Bob Badourc48da972018-10-12 14:32:57 -070080[[contributor-agreement.name.matchProjects]]contributor-agreement.<name>.matchProjects::
81+
82List of project regular expressions identifying projects where the
83agreement is required. Defaults to every project when omitted.
84
85[[contributor-agreement.name.excludeProjects]]contributor-agreement.<name>.excludeProjects::
86+
87List of project regular expressions identifying projects where the
88agreement does not apply. Defaults to empty. i.e. no projects excluded.
89
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -080090GERRIT
91------
92Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -070093
94SEARCHBOX
95---------