Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 1 | = Project Owner Guide |
| 2 | |
| 3 | This is a Gerrit guide that is dedicated to project owners. It |
| 4 | explains the many possibilities that Gerrit provides to customize the |
| 5 | workflows for a project. |
| 6 | |
| 7 | [[project-owner]] |
| 8 | == What is a project owner? |
| 9 | |
| 10 | Being project owner means that you own a project in Gerrit. |
| 11 | Technically this is expressed by having the |
| 12 | link:access-control.html#category_owner[Owner] access right on |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 13 | `+refs/*+` on that project. As project owner you have the permission to |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 14 | edit the access control list and the project settings of the project. |
| 15 | It also means that you should get familiar with these settings so that |
| 16 | you can adapt them to the needs of your project. |
| 17 | |
| 18 | Being project owner means being responsible for the administration of |
| 19 | a project. This requires having a deeper knowledge of Gerrit than the |
| 20 | average user. Normally per team there should be 2 to 3 persons, who |
| 21 | have a certain level of Git/Gerrit knowledge, assigned as project |
| 22 | owners. It normally doesn't make sense that everyone in a team is |
| 23 | project owner. For normal team members it is sufficient to be committer |
| 24 | or contributor. |
| 25 | |
| 26 | [[access-rights]] |
| 27 | == Access Rights |
| 28 | |
| 29 | As a project owner you can edit the access control list of your |
| 30 | project. This allows you to grant permissions on the project to |
| 31 | different groups. |
| 32 | |
| 33 | Gerrit comes with a rich set of permissions which allow a very |
| 34 | fine-grained control over who can do what on a project. Access |
| 35 | control is one of the most powerful Gerrit features but it is also a |
| 36 | rather complex topic. This guide will only highlight the most |
| 37 | important aspects of access control, but the link:access-control.html[ |
| 38 | Access Control] chapter explains all the details. |
| 39 | |
| 40 | [[edit-access-rights]] |
| 41 | === Editing Access Rights |
| 42 | |
| 43 | To see the access rights of your project |
| 44 | |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 45 | - go to the Gerrit Web UI |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 46 | - click on the `Projects` > `List` menu entry |
| 47 | - find your project in the project list and click on it |
| 48 | - click on the `Access` menu entry |
| 49 | |
| 50 | By clicking on the `Edit` button the access rights become editable and |
| 51 | you may save any changes by clicking on the `Save Changes` button. |
| 52 | Optionally you can provide a `Commit Message` to explain the reasons |
| 53 | for changing the access rights. |
| 54 | |
| 55 | The access rights are stored in the project's Git repository in a |
| 56 | special branch called `refs/meta/config`. On this branch there is a |
| 57 | `project.config` file which contains the access rights. More |
| 58 | information about this storage format can be found in the |
| 59 | link:config-project-config.html[Project Configuration File Format] |
| 60 | chapter. What is important to know is that by looking at the history |
| 61 | of the `project.config` file on the `refs/meta/config` branch you can |
| 62 | always see how the access rights were changed and by whom. If a good |
| 63 | commit message is provided you can also see from the history why the |
| 64 | access rights were modified. |
| 65 | |
Dave Borowitz | a3d6788 | 2015-06-05 15:22:23 -0700 | [diff] [blame] | 66 | If a Git browser such as gitweb is configured for the Gerrit server you |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 67 | can find a link to the history of the `project.config` file in the |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 68 | Web UI. Otherwise you may inspect the history locally. If you have |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 69 | cloned the repository you can do this by executing the following |
| 70 | commands: |
| 71 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 72 | ---- |
Edwin Kempin | 32f314b | 2016-10-12 20:05:27 +0200 | [diff] [blame] | 73 | $ git fetch ssh://localhost:29418/project refs/meta/config |
| 74 | $ git checkout FETCH_HEAD |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 75 | $ git log project.config |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 76 | ---- |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 77 | |
| 78 | Non project owners may still edit the access rights and propose the |
| 79 | modifications to the project owners by clicking on the `Save for |
| 80 | Review` button. This creates a new change with the access rights |
| 81 | modifications that can be approved by a project owner. The project |
| 82 | owners are automatically added as reviewer on this change so that they |
| 83 | get informed about it by email. |
| 84 | |
| 85 | [[inheritance]] |
| 86 | === Inheritance |
| 87 | |
| 88 | Normally when a new project is created in Gerrit it already has some |
| 89 | access rights which are inherited from the parent projects. |
| 90 | Projects in Gerrit are organized hierarchically as a tree with the |
| 91 | `All-Projects' project as root from which all projects inherit. Each |
| 92 | project can have only a single parent project, multi-inheritance is |
| 93 | not supported. |
| 94 | |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 95 | Looking at the access rights of your project in the Gerrit Web UI, you |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 96 | only see the access rights which are defined on that project. To see |
| 97 | the inherited access rights you must follow the link to the parent |
| 98 | project under `Rights Inherit From`. |
| 99 | |
| 100 | Inherited access rights can be overwritten unless they are defined as |
| 101 | link:access-control.html#block[BLOCK rule]. BLOCK rules are used to |
| 102 | limit the possibilities of the project owners on the inheriting |
| 103 | projects. With this, global policies can be enforced on all projects. |
| 104 | Please note that Gerrit doesn't prevent you from assigning access |
| 105 | rights that contradict an inherited BLOCK rule, but these access rights |
| 106 | will simply have no effect. |
| 107 | |
| 108 | If you are responsible for several projects which require the same |
| 109 | permissions, it makes sense to have a common parent for them and to |
| 110 | maintain the access rights on that common parent. Changing the parent |
| 111 | of a project is only allowed for Gerrit administrators. This means you |
| 112 | need to contact the administrator of your Gerrit server if you want to |
| 113 | reparent your project. One way to do this is to change the parent |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 114 | project in the Web UI, save the modifications for review and get the |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 115 | change approved and merged by a Gerrit administrator. |
| 116 | |
| 117 | [[refs]] |
| 118 | === References |
| 119 | |
| 120 | Access rights in Gerrit are assigned on references (aka refs). Refs in |
| 121 | Git exist in different namespaces, e.g. all branches normally exist |
| 122 | under `refs/heads/` and all tags under `refs/tags/`. In addition there |
| 123 | are a number of link:access-control.html#references_special[special refs] |
| 124 | and link:access-control.html#references_magic[magic refs]. |
| 125 | |
| 126 | Access rights can be assigned on a concrete ref, e.g. |
| 127 | `refs/heads/master` but also on ref patterns and regular expressions |
| 128 | for ref names. |
| 129 | |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 130 | A ref pattern ends with `+/*+` and describes a complete ref name |
| 131 | namespace, e.g. access rights assigned on `+refs/heads/*+` apply to all |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 132 | branches. |
| 133 | |
| 134 | Regular expressions must start with `^`, e.g. access rights assigned |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 135 | on `+^refs/heads/rel-.*+` would apply to all `+rel-*+` branches. |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 136 | |
| 137 | [[groups]] |
| 138 | === Groups |
| 139 | |
| 140 | Access rights are granted to groups. It is useful to know that Gerrit |
| 141 | maintains its own groups internally but also supports different external |
| 142 | group backends. |
| 143 | |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 144 | The Gerrit internal groups can be seen in the Gerrit Web UI by clicking |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 145 | on the `Groups` > `List` menu entry. By clicking on a group you can |
| 146 | edit the group members (`Members` tab) and the group options |
| 147 | (`General` tab). |
| 148 | |
| 149 | Gerrit internal groups contain users as members, but can also include |
| 150 | other groups, even external groups. |
| 151 | |
| 152 | Every group is owned by an owner group. Only members of the owner |
| 153 | group can administrate the owned group (assign members, edit the group |
| 154 | options). A group can own itself; in this case members of the group |
| 155 | can, for example, add further members to the group. When you create new |
| 156 | groups for your project to assign access rights to committer or other |
| 157 | roles, make sure that they are owned by the project owner group. |
| 158 | |
| 159 | An important setting on a group is the option |
| 160 | `Make group visible to all registered users.`, which defines whether |
| 161 | non-members can see who is member of the group. |
| 162 | |
| 163 | New internal Gerrit groups can be created under `Groups` > |
| 164 | `Create New Group`. This menu is only available if you have the global |
| 165 | capability link:access-control.html#capability_createGroup[Create Group] |
| 166 | assigned. |
| 167 | |
| 168 | Gerrit also has a set of special |
| 169 | link:access-control.html#system_groups[system groups] that you might |
| 170 | find useful. |
| 171 | |
| 172 | External groups need to be prefixed when assigning access rights to |
| 173 | them, e.g. link:access-control.html#ldap_groups[LDAP group names] need |
| 174 | to be prefixed with `ldap/`. |
| 175 | |
| 176 | If the link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/singleusergroup[ |
| 177 | singleusergroup] plugin is installed you can also directly assign |
| 178 | access rights to users, by prefixing the username with `user/` or the |
| 179 | user's account ID by `userid/`. |
| 180 | |
| 181 | [[common-access-rights]] |
| 182 | === Common Access Rights |
| 183 | |
| 184 | Different roles in a project, such as developer (committer) or |
| 185 | contributor, need different access rights. Examples for which access |
| 186 | rights are typically assigned for which role are described in the |
| 187 | link:access-control.html#example_roles[Access Control] chapter. |
| 188 | |
| 189 | [[code-review]] |
| 190 | === Code Review |
| 191 | |
| 192 | Gerrit's main functionality is code review, however using code review |
| 193 | is optional and you may decide to only use Gerrit as a Git server with |
| 194 | access control. Whether you allow only pushes for review or also |
| 195 | direct pushes depends on the project's access rights. |
| 196 | |
| 197 | To push a commit for review it must be pushed to |
| 198 | link:access-control.html#refs_for[refs/for/<branch-name>]. This means |
| 199 | the link:access-control.html#category_push_review[Push] access right |
| 200 | must be assigned on `refs/for/<branch-name>`. |
| 201 | |
| 202 | To allow direct pushes and bypass code review, the |
| 203 | link:access-control.html#category_push_direct[Push] access right is |
| 204 | required on `refs/heads/<branch-name>`. |
| 205 | |
| 206 | By pushing for review you are not only enabling the review workflow, |
Edwin Kempin | cee50e7 | 2014-04-24 09:40:22 +0200 | [diff] [blame] | 207 | but you can also get link:#continuous-integration[automatic |
| 208 | verifications from a build server] before changes are merged. In |
| 209 | addition you can benefit from Gerrit's merge strategies that can |
| 210 | automatically merge/rebase commits on server side if necessary. You can |
| 211 | control the merge strategy by configuring the |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 212 | link:project-configuration.html#submit_type[submit type] on the project. If you |
Edwin Kempin | cee50e7 | 2014-04-24 09:40:22 +0200 | [diff] [blame] | 213 | bypass code review you always need to merge/rebase manually if the tip |
| 214 | of the destination branch has moved. Please keep this in mind if you |
| 215 | choose to not work with code review because you think it's easier to |
| 216 | avoid the additional complexity of the review workflow; it might |
| 217 | actually not be easier. |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 218 | |
| 219 | You may also enable link:user-upload.html#auto_merge[auto-merge on |
| 220 | push] to benefit from the automatic merge/rebase on server side while |
| 221 | pushing directly into the repository. |
| 222 | |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 223 | [[project-options]] |
| 224 | == Project Options |
| 225 | |
| 226 | As project owner you can control several options on your project. |
| 227 | The different options are described in the |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 228 | link:project-configuration.html#project_options[Project Options] section. |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 229 | |
| 230 | To see the options of your project |
| 231 | |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 232 | - go to the Gerrit Web UI |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 233 | - click on the `Projects` > `List` menu entry |
| 234 | - find your project in the project list and click on it |
| 235 | - click on the `General` menu entry |
| 236 | |
| 237 | [[submit-type]] |
| 238 | === Submit Type |
| 239 | |
| 240 | An important decision for a project is the choice of the submit type |
Sebastian Schuberth | 774aac9 | 2015-04-16 13:21:04 +0200 | [diff] [blame] | 241 | and the content merge setting (see the `Allow content merges` option). |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 242 | The link:project-configuration.html#submit_type[submit type] is the method |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 243 | Gerrit uses to submit a change to the project. The submit type defines |
| 244 | what Gerrit should do on submit of a change if the destination branch |
| 245 | has moved while the change was in review. The |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 246 | link:project-configuration.html#content_merge[content merge] setting applies |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 247 | if the same files have been modified concurrently and tells Gerrit |
| 248 | whether it should attempt a content merge for these files. |
| 249 | |
| 250 | When choosing the submit type and the content merge setting one must |
| 251 | weigh development comfort against the safety of not breaking the |
| 252 | destination branch. |
| 253 | |
| 254 | The most restrictive submit type is |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 255 | link:project-configuration.html#fast_forward_only[Fast Forward Only]. Using |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 256 | this submit type means that after submitting one change all other open |
| 257 | changes for the same destination branch must be rebased manually. This |
| 258 | is quite burdensome and in practice only feasible for branches with |
| 259 | very few changes. On the other hand, if changes are verified before |
| 260 | submit, e.g. automatically by a CI integration, with this submit type, |
| 261 | you can be sure that the destination branch never gets broken. |
| 262 | |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 263 | Choosing link:project-configuration.html#merge_if_necessary[Merge If Necessary] |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 264 | as submit type makes the life for developers more comfortable, |
| 265 | especially if content merge is enabled. If this submit strategy is used |
| 266 | developers only need to rebase manually if the same files have been |
| 267 | modified concurrently or if the content merge on such a file fails. The |
| 268 | drawback with this submit type is that there is a risk of breaking |
| 269 | the destination branch, e.g. if one change moves a class into another |
| 270 | package and another change imports this class from the old location. |
| 271 | Experience shows that in practice `Merge If Necessary` with content |
| 272 | merge enabled works pretty well and breaking the destination branch |
| 273 | happens rarely. This is why this setting is recommended at least for |
| 274 | development branches. You likely want to start with |
| 275 | `Merge If Necessary` with content merge enabled and only switch to a |
| 276 | more restrictive policy if you are facing issues with the build and |
| 277 | test stability of the destination branches. |
| 278 | |
Edwin Kempin | 1781adb | 2014-04-22 10:02:40 +0200 | [diff] [blame] | 279 | It is also possible to define the submit type dynamically via |
| 280 | link:#prolog-submit-type[Prolog]. This way you can use different submit |
| 281 | types for different branches. |
| 282 | |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 283 | Please note that there are other submit types available; they are |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 284 | described in the link:project-configuration.html#submit_type[Submit Type] |
Edwin Kempin | eaff6c1 | 2014-04-17 15:23:42 +0200 | [diff] [blame] | 285 | section. |
| 286 | |
Edwin Kempin | 1781adb | 2014-04-22 10:02:40 +0200 | [diff] [blame] | 287 | [[labels]] |
| 288 | == Labels |
| 289 | |
| 290 | The code review process includes that reviewers formally express their |
| 291 | opinion about a change by voting on different link:config-labels.html[ |
| 292 | labels]. By default Gerrit comes with the |
| 293 | link:config-labels.html#label_Code-Review[Code-Review] label and many |
| 294 | Gerrit servers have the link:config-labels.html#label_Verified[Verified] |
| 295 | label configured globally. However projects can also define their own |
| 296 | link:config-labels.html#label_custom[custom labels] to formalize |
| 297 | project-specific workflows. For example if a project requires an IP |
| 298 | approval from a special IP-team, it can define an `IP-Review` label |
| 299 | and grant permissions to the IP-team to vote on this label. |
| 300 | |
| 301 | The behavior of a label can be controlled by its |
| 302 | link:config-labels.html#label_function[function], e.g. it can be |
| 303 | configured whether a max positive voting on the label is required for |
| 304 | submit or if the voting on the label is optional. |
| 305 | |
| 306 | By using a custom link:#submit-rules[submit rule] it can be controlled |
| 307 | per change whether a label is required for submit or not. |
| 308 | |
| 309 | A useful feature on labels is the possibility to automatically copy |
| 310 | scores forward to new patch sets if it was a |
| 311 | link:config-labels.html#label_copyAllScoresOnTrivialRebase[trivial |
| 312 | rebase] or if link:config-labels.html#label_copyAllScoresIfNoCodeChange[ |
| 313 | there was no code change] (e.g. only the commit message was edited). |
| 314 | |
| 315 | [[submit-rules]] |
| 316 | == Submit Rules |
| 317 | |
| 318 | A link:prolog-cookbook.html#SubmitRule[submit rule] in Gerrit is logic |
| 319 | that defines when a change is submittable. By default, a change is |
| 320 | submittable when it gets at least one highest vote on each label and |
| 321 | has no lowest vote (aka veto vote) on any label. |
| 322 | |
| 323 | The submit rules in Gerrit are implemented in link:prolog-cookbook.html[ |
| 324 | Prolog] and projects that need more flexibility can define their own |
| 325 | submit rules to decide when a change should be submittable. A good |
| 326 | link:prolog-cookbook.html#NonAuthorCodeReview[example] from the Prolog |
| 327 | cookbook shows how to allow submit only if a change has a |
| 328 | `Code-Review+2` vote from a person that is not the change author. This |
| 329 | way a four-eyes principle for the reviews can be enforced. |
| 330 | |
| 331 | A Prolog submit rule has access to link:prolog-change-facts.html[ |
| 332 | information] about the change for which it is testing the |
Eryk Szymanski | 2b93eb0 | 2016-11-15 17:56:28 -0800 | [diff] [blame] | 333 | submittability. Among others the list of the modified files can be |
Edwin Kempin | 1781adb | 2014-04-22 10:02:40 +0200 | [diff] [blame] | 334 | accessed, which allows special logic if certain files are touched. For |
| 335 | example, a common practice is to require a vote on an additional label, |
| 336 | like `Library-Compliance`, if the dependencies of the project are |
| 337 | changed. |
| 338 | |
| 339 | [[prolog-submit-type]] |
| 340 | It is also possible to control the link:prolog-cookbook.html#SubmitType[ |
| 341 | submit type] from Prolog. For example this can be used to define a more |
| 342 | restrictive submit type such as `Fast Forward Only` for stable branches |
| 343 | while using a more liberal submit type, e.g. `Merge If Necessary` with |
| 344 | content merge, for development branches. How this can be done can be |
| 345 | seen from an link:prolog-cookbook.html#SubmitTypePerBranch[example] in |
| 346 | the Prolog cookbook. |
| 347 | |
| 348 | Submit rules are maintained in the link:prolog-cookbook.html#RulesFile[ |
| 349 | rules.pl] file in the `refs/meta/config` branch of the project. How to |
| 350 | write submit rules is explained in the |
| 351 | link:prolog-cookbook.html#HowToWriteSubmitRules[Prolog cookbook]. There |
| 352 | is also good support for link:prolog-cookbook.html#TestingSubmitRules[ |
| 353 | testing submit rules] while developing them. |
| 354 | |
Edwin Kempin | 693888a | 2014-04-23 13:50:24 +0200 | [diff] [blame] | 355 | [[continuous-integration]] |
| 356 | == Continuous Integration |
| 357 | |
| 358 | With Gerrit you can have continuous integration builds not only for |
| 359 | updates of central branches but also whenever a new change/patch set is |
| 360 | uploaded for review. This way you get automatic verification of all |
| 361 | changes *before* they are merged and any build and test issues are |
| 362 | detected early. To indicate the build and test status the continuous |
| 363 | integration system normally votes with the |
| 364 | link:config-labels.html#label_Verified[Verified] label on the change. |
| 365 | |
| 366 | There are several solutions for integrating continuous integration |
| 367 | systems. The most commonly used are: |
| 368 | |
| 369 | - link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[ |
| 370 | Gerrit Trigger] plugin for link:http://jenkins-ci.org/[Jenkins] |
| 371 | |
| 372 | - link:http://www.mediawiki.org/wiki/Continuous_integration/Zuul[ |
| 373 | Zuul] for link:http://jenkins-ci.org/[Jenkins] |
| 374 | |
| 375 | For the integration with the continuous integration system you must |
| 376 | have a service user that is able to access Gerrit. To create a service |
| 377 | user in Gerrit you can use the link:cmd-create-account.html[create-account] |
| 378 | SSH command if the link:access-control.html#capability_createAccount[ |
| 379 | Create Account] global capability is granted. If not, you need to ask |
| 380 | a Gerrit administrator to create the service user. |
| 381 | |
| 382 | If the link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/serviceuser[ |
| 383 | serviceuser] plugin is installed you can also create new service users |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 384 | in the Gerrit Web UI under `People` > `Create Service User`. For this |
Edwin Kempin | 5d6b9f1 | 2014-04-24 14:30:07 +0200 | [diff] [blame] | 385 | the `Create Service User` global capability must be assigned. |
Edwin Kempin | 693888a | 2014-04-23 13:50:24 +0200 | [diff] [blame] | 386 | |
| 387 | The service user must have link:access-control.html#category_read[read] |
| 388 | access to your project. In addition, if automatic change verification |
| 389 | is enabled, the service user must be allowed to vote on the |
| 390 | link:config-labels.html#label_Verified[Verified] label. |
| 391 | |
| 392 | Continuous integration systems usually integrate with Gerrit by |
| 393 | listening to the Gerrit link:cmd-stream-events.html#events[stream |
| 394 | events]. For this the service user must have the |
| 395 | link:access-control.html#capability_streamEvents[Stream Events] global |
| 396 | capability assigned. |
| 397 | |
Edwin Kempin | 7716775 | 2014-07-16 08:21:06 +0200 | [diff] [blame] | 398 | [[commit-validation]] |
| 399 | == Commit Validation |
| 400 | |
| 401 | Gerrit provides an |
| 402 | link:https://gerrit-review.googlesource.com/Documentation/config-validation.html#new-commit-validation[ |
| 403 | extension point to do validation of new commits]. A Gerrit plugin |
| 404 | implementing this extension point can perform validation checks when |
| 405 | new commits are pushed to Gerrit. The plugin can either provide a |
| 406 | message to the client or reject the commit and cause the push to fail. |
| 407 | |
| 408 | There are some plugins available that provide commit validation: |
| 409 | |
| 410 | - link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/uploadvalidator[ |
| 411 | uploadvalidator]: |
| 412 | + |
| 413 | The `uploadvalidator` plugin allows project owners to configure blocked |
| 414 | file extensions, required footers and a maximum allowed path length. |
| 415 | |
| 416 | - link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/commit-message-length-validator[ |
| 417 | commit-message-length-validator] |
| 418 | + |
| 419 | The `commit-message-length-validator` core plugin validates that commit |
| 420 | messages conform to line length limits. |
| 421 | |
Edwin Kempin | 34f4f88 | 2014-04-22 16:13:18 +0200 | [diff] [blame] | 422 | [[branch-administration]] |
| 423 | == Branch Administration |
| 424 | |
| 425 | As project owner you can administrate the branches of your project in |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 426 | the Gerrit Web UI under `Projects` > `List` > <your project> > |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 427 | `Branches`. In the Web UI both link:project-configuration.html#branch-creation[ |
| 428 | branch creation] and link:project-configuration.html#branch-deletion[branch |
Edwin Kempin | 34f4f88 | 2014-04-22 16:13:18 +0200 | [diff] [blame] | 429 | deletion] are allowed for project owners without requiring any |
| 430 | additional access rights. |
| 431 | |
| 432 | By setting `HEAD` on the project you can define its |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 433 | link:project-configuration.html#default-branch[default branch]. For convenience |
Edwin Kempin | 34f4f88 | 2014-04-22 16:13:18 +0200 | [diff] [blame] | 434 | reasons, when the repository is cloned Git creates a local branch for |
| 435 | this default branch and checks it out. |
| 436 | |
Edwin Kempin | ef2b6af | 2014-04-22 11:04:10 +0200 | [diff] [blame] | 437 | [[notifications]] |
| 438 | == Email Notifications |
| 439 | |
| 440 | With Gerrit individual users control their own email subscriptions. By |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 441 | editing the link:user-notify.html#user[watched projects] in the Web UI |
Edwin Kempin | ef2b6af | 2014-04-22 11:04:10 +0200 | [diff] [blame] | 442 | under `Settings` > `Watched Projects` users can decide which events to |
| 443 | be informed about by email. The change notifications can be filtered by |
| 444 | link:user-search.html[change search expressions]. |
| 445 | |
| 446 | This means as a project owner you normally don't need to do anything |
| 447 | about email notifications, except maybe telling your project team where |
| 448 | to configure the watches. |
| 449 | |
| 450 | Gerrit also supports link:user-notify.html#project[notifications on |
| 451 | project level] that allow project owners to set up email notifications |
| 452 | for team mailing lists or groups of users. This configuration is done |
| 453 | in the `project.config` file in the `refs/meta/config` branch as |
| 454 | explained in the section about link:user-notify.html#project[project |
| 455 | level notifications]. |
| 456 | |
Edwin Kempin | 09c4960 | 2014-04-22 11:33:00 +0200 | [diff] [blame] | 457 | [[dashboards]] |
| 458 | == Dashboards |
| 459 | |
| 460 | Gerrit comes with a pre-defined user dashboard that provides a view |
| 461 | of the changes that are relevant for a user. Users can also define |
| 462 | their own link:user-dashboards.html[custom dashboards] where the |
| 463 | dashboard sections can be freely configured. As a project owner you can |
| 464 | configure such custom dashboards on |
| 465 | link:user-dashboards.html#project-dashboards[project level]. This way |
| 466 | you can define a view of the changes that are relevant for your |
| 467 | project and share this dashboard with all users. The project dashboards |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 468 | can be seen in the Web UI under `Projects` > `List` > <your project> > |
Edwin Kempin | 09c4960 | 2014-04-22 11:33:00 +0200 | [diff] [blame] | 469 | `Dashboards`. |
| 470 | |
Edwin Kempin | 96cdad4 | 2014-04-22 13:30:56 +0200 | [diff] [blame] | 471 | [[issue-tracker-integration]] |
| 472 | == Issue Tracker Integration |
| 473 | |
| 474 | There are several possibilities to integrate issue trackers with |
| 475 | Gerrit. |
| 476 | |
| 477 | - Comment Links |
| 478 | + |
Edwin Kempin | 8691f5a | 2014-04-30 09:21:57 +0200 | [diff] [blame] | 479 | As described in the link:#comment-links[Comment Links] section, comment |
Edwin Kempin | 96cdad4 | 2014-04-22 13:30:56 +0200 | [diff] [blame] | 480 | links can be used to link IDs from commit message footers to issues in |
| 481 | an issue tracker system. |
| 482 | |
| 483 | - Tracking IDs |
| 484 | + |
| 485 | Gerrit can be configured to index IDs from commit message footers so |
| 486 | that the link:user-search.html#tr[tr/bug] search operators can be used |
| 487 | to query for changes with a certain ID. The |
| 488 | link:config-gerrit.html#trackingid[configuration of tracking IDs] can |
| 489 | only be done globally by a Gerrit administrator. |
| 490 | |
| 491 | - Issue Tracker System Plugins |
| 492 | + |
| 493 | There are Gerrit plugins for a tight integration with |
| 494 | link:https://gerrit-review.googlesource.com/\#/admin/projects/plugins/its-jira[Jira], |
| 495 | link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/its-bugzilla[Bugzilla] and |
| 496 | link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/its-rtc[IBM Rational Team Concert]. |
| 497 | If installed, these plugins can e.g. be used to automatically add links |
| 498 | to Gerrit changes to the issues in the issue tracker system or to |
| 499 | automatically close an issue if the corresponding change is merged. |
| 500 | If installed, project owners may enable/disable the issue tracker |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 501 | integration from the Gerrit Web UI under `Projects` > `Lists` > |
Edwin Kempin | 96cdad4 | 2014-04-22 13:30:56 +0200 | [diff] [blame] | 502 | <your project> > `General`. |
| 503 | |
| 504 | [[comment-links]] |
| 505 | == Comment Links |
| 506 | |
| 507 | Gerrit can linkify strings in commit messages, summary comments and |
| 508 | inline comments. A string that matches a defined regular expression is |
| 509 | then displayed as hyperlink to a configured backend system. |
| 510 | |
| 511 | So called comment links can be configured globally by a Gerrit |
| 512 | administrator, but also per project by the project owner. Comment links |
| 513 | on project level are defined in the `project.config` file in the |
| 514 | `refs/meta/config` branch of the project as described in the |
| 515 | documentation of the link:config-gerrit.html#commentlink[commentlink] |
| 516 | configuration parameter. |
| 517 | |
| 518 | Often comment links are used to link an ID in a commit message footer |
| 519 | to an issue in an issue tracker system. For example, to link the ID |
| 520 | from the `Bug` footer to Jira the following configuration can be used: |
| 521 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 522 | ---- |
Edwin Kempin | 96cdad4 | 2014-04-22 13:30:56 +0200 | [diff] [blame] | 523 | [commentlink "myjira"] |
| 524 | match = ([Bb][Uu][Gg]:\\s+)(\\S+) |
| 525 | link = https://myjira/browse/$2 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 526 | ---- |
Edwin Kempin | 96cdad4 | 2014-04-22 13:30:56 +0200 | [diff] [blame] | 527 | |
Edwin Kempin | 5d80395 | 2014-04-24 14:19:42 +0200 | [diff] [blame] | 528 | [[reviewers]] |
| 529 | == Reviewers |
| 530 | |
| 531 | Normally it is not needed to explicitly assign reviewers to every |
| 532 | change since the project members either link:user-notify.html#user[ |
| 533 | watch the project] and get notified by email or regularly check the |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 534 | list of open changes in the Gerrit Web UI. The project members then |
Edwin Kempin | 5d80395 | 2014-04-24 14:19:42 +0200 | [diff] [blame] | 535 | pick the changes themselves that are interesting to them for review. |
| 536 | |
| 537 | If authors of changes want to have a review by a particular person |
| 538 | (e.g. someone who is known to be expert in the touched code area, or a |
| 539 | stakeholder for the implemented feature), they can request the review |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 540 | by adding this person in the Gerrit Web UI as a reviewer on the change. |
Edwin Kempin | 5d80395 | 2014-04-24 14:19:42 +0200 | [diff] [blame] | 541 | Gerrit will then notify this person by email about the review request. |
| 542 | |
| 543 | With the link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/reviewers[ |
| 544 | reviewers] plugin it is possible to configure default reviewers who |
| 545 | will be automatically added to each change. The default reviewers can |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 546 | be configured in the Gerrit Web UI under `Projects` > `List` > |
Edwin Kempin | 5d80395 | 2014-04-24 14:19:42 +0200 | [diff] [blame] | 547 | <your project> > `General` in the `reviewers Plugin` section. |
| 548 | |
| 549 | The link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/reviewers-by-blame[ |
| 550 | reviewers-by-blame] plugin can automatically add reviewers to changes |
| 551 | based on the link:https://www.kernel.org/pub/software/scm/git/docs/git-blame.html[ |
| 552 | git blame] computation on the changed files. This means that the plugin |
| 553 | will add those users as reviewer that authored most of the lines |
| 554 | touched by the change, since these users should be familiar with the |
| 555 | code and can most likely review the change. How many reviewers the |
| 556 | plugin will add to a change at most can be configured in the Gerrit |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 557 | Web UI under `Projects` > `List` > <your project> > `General` in the |
Edwin Kempin | 5d80395 | 2014-04-24 14:19:42 +0200 | [diff] [blame] | 558 | `reviewers-by-blame Plugin` section. |
| 559 | |
Edwin Kempin | e622b79 | 2014-04-23 13:06:57 +0200 | [diff] [blame] | 560 | [[download-commands]] |
| 561 | == Download Commands |
| 562 | |
| 563 | On the change screen in the `Downloads` drop-down panel Gerrit offers |
| 564 | commands for downloading the currently viewed patch set. |
| 565 | |
| 566 | The download commands are implemented by Gerrit plugins. This means |
| 567 | that the available download commands depend on the installed Gerrit |
| 568 | plugins: |
| 569 | |
| 570 | - link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/download-commands[ |
| 571 | download-commands] plugin: |
| 572 | + |
| 573 | The `download-commands` plugin provides the default download commands |
| 574 | (`Checkout`, `Cherry Pick`, `Format Patch` and `Pull`). |
| 575 | + |
| 576 | Gerrit administrators may configure which of the commands are shown on |
| 577 | the change screen. |
| 578 | |
| 579 | - link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/egit[ |
| 580 | egit] plugin: |
| 581 | + |
| 582 | The `egit` plugin provides the change ref as a download command, which is |
| 583 | needed for downloading a change from within |
| 584 | link:https://www.eclipse.org/egit/[EGit]. |
| 585 | |
| 586 | - link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/project-download-commands[ |
| 587 | project-download-commands] plugin: |
| 588 | + |
| 589 | The `project-download-commands` plugin enables project owners to |
| 590 | configure project-specific download commands. For example, a |
| 591 | project-specific download command may update submodules, trigger a |
| 592 | build, execute the tests or even do a deployment. |
| 593 | + |
| 594 | The project-specific download commands must be configured in the |
| 595 | `project.config` file in the `refs/meta/config` branch of the project: |
| 596 | + |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 597 | ---- |
Edwin Kempin | e622b79 | 2014-04-23 13:06:57 +0200 | [diff] [blame] | 598 | [plugin "project-download-commands"] |
David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame^] | 599 | Build = git fetch ${url} ${ref} && git checkout FETCH_HEAD && bazel build ${project} |
Edwin Kempin | e622b79 | 2014-04-23 13:06:57 +0200 | [diff] [blame] | 600 | Update = git fetch ${url} ${ref} && git checkout FETCH_HEAD && git submodule update |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 601 | ---- |
Edwin Kempin | e622b79 | 2014-04-23 13:06:57 +0200 | [diff] [blame] | 602 | + |
| 603 | Project-specific download commands that are defined on a parent project |
| 604 | are inherited by the child projects. A child project can overwrite an |
| 605 | inherited download command, or remove it by assigning no value to it. |
Edwin Kempin | 96cdad4 | 2014-04-22 13:30:56 +0200 | [diff] [blame] | 606 | |
Edwin Kempin | 37e6d96 | 2014-04-24 13:32:36 +0200 | [diff] [blame] | 607 | [[theme]] |
| 608 | == Theme |
| 609 | |
| 610 | Gerrit supports project-specific themes for customizing the appearance |
| 611 | of the change screen and the diff screens. It is possible to define an |
| 612 | HTML header and footer and to adapt Gerrit's CSS. Details about themes |
| 613 | are explained in the link:config-themes.html[Themes] section. |
| 614 | |
| 615 | Project-specific themes can only be installed by Gerrit administrators |
| 616 | since the theme files must be copied into the Gerrit installation |
| 617 | folder. |
| 618 | |
Edwin Kempin | 1519979 | 2014-04-23 16:22:05 +0200 | [diff] [blame] | 619 | [[tool-integration]] |
| 620 | == Integration with other tools |
| 621 | |
| 622 | Gerrit provides many possibilities for the integration with other |
| 623 | tools: |
| 624 | |
| 625 | - Stream Events: |
| 626 | + |
| 627 | The link:cmd-stream-events.html[stream-events] SSH command allows to |
| 628 | listen to Gerrit link:cmd-stream-events.html#events[events]. Other |
| 629 | tools can use this to react on actions done in Gerrit. |
| 630 | + |
| 631 | The link:access-control.html#capability_streamEvents[Stream Events] |
| 632 | global capability is required for using the `stream-events` command. |
| 633 | |
| 634 | - REST API: |
| 635 | + |
| 636 | Gerrit provides a rich link:rest-api.html[REST API] that other tools |
| 637 | can use to query information from Gerrit and and to trigger actions in |
| 638 | Gerrit. |
| 639 | |
| 640 | - Gerrit Plugins: |
| 641 | + |
| 642 | The Gerrit functionality can be extended by plugins and there are many |
| 643 | extension points, e.g. plugins can |
| 644 | + |
| 645 | ** link:dev-plugins.html#top-menu-extensions[add new menu entries] |
| 646 | ** link:dev-plugins.html#ui_extension[extend existing screens] and |
| 647 | link:dev-plugins.html#screen[add new screens] |
| 648 | ** link:config-validation.html[do validation], e.g. of new commits |
| 649 | ** add new REST endpoints and link:dev-plugins.html#ssh[SSH commands] |
| 650 | |
| 651 | + |
| 652 | How to develop a Gerrit plugin is described in the link:dev-plugins.html[ |
| 653 | Plugin Development] section. |
| 654 | |
David Pursehouse | a61ee50 | 2016-09-06 16:27:09 +0900 | [diff] [blame] | 655 | [[project-lifecycle]] |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 656 | == Project Lifecycle |
| 657 | |
| 658 | [[project-creation]] |
| 659 | === Project Creation |
| 660 | |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 661 | New projects can be created in the Gerrit Web UI under `Projects` > |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 662 | `Create Project`. The `Create Project` menu entry is only available if |
| 663 | you have the link:access-control.html#capability_createProject[ |
| 664 | Create Project] global capability assigned. |
| 665 | |
| 666 | Projects can also be created via REST or SSH as described in the |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 667 | link:project-configuration.html#project-creation[Project Setup] section. |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 668 | |
| 669 | Creating the project with an initial empty commit is generally |
| 670 | recommended because some tools have issues with cloning repositories |
| 671 | that are completely empty. However, if you plan to link:#import-history[ |
| 672 | import an existing history] into the new project, it is better to |
| 673 | create the project without an initial empty commit. |
| 674 | |
| 675 | [[import-history]] |
| 676 | === Import Existing History |
| 677 | |
| 678 | If you have an existing history you can import it into a Gerrit |
| 679 | project. To do this you need to have a local Git repository that |
| 680 | contains this history. If your existing codebase is in another VCS you |
| 681 | must migrate it to Git first. For Subversion you can use the |
| 682 | link:http://git-scm.com/book/en/Git-and-Other-Systems-Git-and-Subversion[ |
| 683 | git svn] command as described in the |
| 684 | link:http://git-scm.com/book/en/Git-and-Other-Systems-Migrating-to-Git#Subversion[ |
| 685 | Subversion migration guide]. An importer for Perforce is available in |
| 686 | the `contrib` section of the Git source code; how to use |
| 687 | link:http://git-scm.com/docs/git-p4[git p4] to do the import from |
| 688 | Perforce is described in the |
| 689 | link:http://git-scm.com/book/en/Git-and-Other-Systems-Migrating-to-Git#Perforce[ |
| 690 | Perforce migration guide]. |
| 691 | |
| 692 | To import an existing history into a Gerrit project you bypass code |
| 693 | review and push it directly to `refs/heads/<branch>`. For this you must |
| 694 | have the corresponding link:access-control.html#category_push_direct[ |
| 695 | Push] access right assigned. If the destination branch in the Gerrit |
| 696 | repository already contains a history (e.g. an initial empty commit), |
| 697 | you can overwrite it by doing a force push. In this case force push |
| 698 | must be allowed in the access controls of the project. |
| 699 | |
| 700 | Some Gerrit servers may disallow forging committers by blocking the |
| 701 | link:access-control.html#category_forge_committer[Forge Committer] |
| 702 | access right globally. In this case you must use the |
| 703 | link:https://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html[ |
| 704 | git filter-branch] command to rewrite the committer information for all |
| 705 | commits (the author information that records who was writing the code |
| 706 | stays intact; signed tags will lose their signature): |
| 707 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 708 | ---- |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 709 | $ git filter-branch --tag-name-filter cat --env-filter 'GIT_COMMITTER_NAME="John Doe"; GIT_COMMITTER_EMAIL="john.doe@example.com";' -- --all |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 710 | ---- |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 711 | |
| 712 | If a link:config-gerrit.html#receive.maxObjectSizeLimit[max object size |
| 713 | limit] is configured on the server you may need to remove large objects |
| 714 | from the history before you are able to push. To find large objects in |
Edwin Kempin | 5ba27bd | 2014-05-09 14:53:04 +0200 | [diff] [blame] | 715 | the history of your project you can use the `reposize.sh` script which |
| 716 | you can download from Gerrit: |
| 717 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 718 | ---- |
Edwin Kempin | 5ba27bd | 2014-05-09 14:53:04 +0200 | [diff] [blame] | 719 | $ curl -Lo reposize.sh http://review.example.com:8080/tools/scripts/reposize.sh |
| 720 | |
| 721 | or |
| 722 | |
| 723 | $ scp -p -P 29418 john.doe@review.example.com:scripts/reposize.sh . |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 724 | ---- |
Edwin Kempin | 5ba27bd | 2014-05-09 14:53:04 +0200 | [diff] [blame] | 725 | |
| 726 | You can then use the |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 727 | link:https://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html[ |
| 728 | git filter-branch] command to remove the large objects from the history |
| 729 | of all branches: |
| 730 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 731 | ---- |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 732 | $ git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch path/to/large-file.jar' -- --all |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 733 | ---- |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 734 | |
| 735 | Since this command rewrites all commits in the repository it's a good |
| 736 | idea to create a fresh clone from this rewritten repository before |
| 737 | pushing to Gerrit, this will ensure that the original objects which |
| 738 | have been rewritten are removed. |
| 739 | |
| 740 | [[project-deletion]] |
| 741 | === Project Deletion |
| 742 | |
| 743 | Gerrit core does not support the deletion of projects. |
| 744 | |
| 745 | If the link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/delete-project[ |
| 746 | delete-project] plugin is installed, projects can be deleted from the |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 747 | Gerrit Web UI under `Projects` > `List` > <project> > `General` by |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 748 | clicking on the `Delete` command under `Project Commands`. The `Delete` |
Edwin Kempin | 56bac94 | 2014-04-24 14:25:42 +0200 | [diff] [blame] | 749 | command is only available if you have the `Delete Projects` global |
| 750 | capability assigned, or if you own the project and you have the |
| 751 | `Delete Own Projects` global capability assigned. If neither of these |
| 752 | capabilities is granted, you need to contact a Gerrit administrator to |
| 753 | request the deletion of your project. |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 754 | |
| 755 | Instead of deleting a project you may set the |
Stefan Lay | 08ba473 | 2014-05-05 16:36:12 +0200 | [diff] [blame] | 756 | link:project-configuration.html#project-state[project state] to `ReadOnly` or |
Edwin Kempin | f2b47e2 | 2014-04-24 13:00:28 +0200 | [diff] [blame] | 757 | `Hidden`. |
| 758 | |
| 759 | [[project-rename]] |
| 760 | === Project Rename |
| 761 | |
| 762 | Gerrit core does not support the renaming of projects. |
| 763 | |
| 764 | As workaround you may |
| 765 | |
| 766 | . link:#project-creation[create a new project] with the new name |
| 767 | . link:#import-history[import the history of the old project] |
| 768 | . link:#project-deletion[delete the old project] |
| 769 | |
Edwin Kempin | ec86ca1 | 2015-04-17 10:03:30 +0200 | [diff] [blame] | 770 | Please note that a drawback of this workaround is that the whole review |
| 771 | history (changes, review comments) is lost. |
| 772 | |
| 773 | Alternatively, you can use the |
| 774 | link:https://gerrit.googlesource.com/plugins/importer/[importer] plugin |
| 775 | to copy the project _including the review history_, and then |
| 776 | link:#project-deletion[delete the old project]. |
| 777 | |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 778 | GERRIT |
| 779 | ------ |
| 780 | Part of link:index.html[Gerrit Code Review] |
| 781 | |
| 782 | SEARCHBOX |
| 783 | --------- |