James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 1 | :title: GitHub Driver |
| 2 | |
| 3 | GitHub |
| 4 | ====== |
| 5 | |
| 6 | The GitHub driver supports sources, triggers, and reporters. It can |
| 7 | interact with the public GitHub service as well as site-local |
| 8 | installations of GitHub enterprise. |
| 9 | |
Tristan Cacqueray | 9d83c61 | 2017-11-23 02:09:53 +0000 | [diff] [blame] | 10 | Configure GitHub |
| 11 | ---------------- |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 12 | |
Tristan Cacqueray | 9d83c61 | 2017-11-23 02:09:53 +0000 | [diff] [blame] | 13 | There are two options currently available. GitHub's project owner can either |
| 14 | manually setup web-hook or install a GitHub Application. In the first case, |
| 15 | the project's owner needs to know the zuul endpoint and the webhook secrets. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 16 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 17 | |
Tristan Cacqueray | 9d83c61 | 2017-11-23 02:09:53 +0000 | [diff] [blame] | 18 | Web-Hook |
| 19 | ........ |
| 20 | |
| 21 | To configure a project's `webhook events <https://developer.github.com/webhooks/creating/>`_: |
| 22 | |
| 23 | * Set *Payload URL* to ``http://<zuul-hostname>/connection/<connection-name>/payload``. |
| 24 | |
| 25 | * Set *Content Type* to ``application/json``. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 26 | |
| 27 | Select *Events* you are interested in. See below for the supported events. |
| 28 | |
Tristan Cacqueray | 9d83c61 | 2017-11-23 02:09:53 +0000 | [diff] [blame] | 29 | You will also need to have a GitHub user created for your zuul: |
| 30 | |
| 31 | * Zuul public key needs to be added to the GitHub account |
| 32 | |
| 33 | * A api_token needs to be created too, see this `article <See https://help.github.com/articles/creating-an-access-token-for-command-line-use/>`_ |
| 34 | |
| 35 | Then in the zuul.conf, set webhook_token and api_token. |
| 36 | |
| 37 | Application |
| 38 | ........... |
| 39 | |
| 40 | To create a `GitHub application <https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/registering-github-apps/>`_: |
| 41 | |
| 42 | * Go to your organization settings page to create the application, e.g.: https://github.com/organizations/my-org/settings/apps/new |
| 43 | |
| 44 | * Set GitHub App name to "my-org-zuul" |
| 45 | |
| 46 | * Set Setup URL to your setup documentation, when user install the application they are redirected to this url |
| 47 | |
| 48 | * Set Webhook URL to ``http://<zuul-hostname>/connection/<connection-name>/payload``. |
| 49 | |
| 50 | * Create a Webhook secret |
| 51 | |
| 52 | * Set permissions: |
| 53 | |
| 54 | * Commit statuses: Read & Write |
| 55 | |
| 56 | * Issues: Read & Write |
| 57 | |
| 58 | * Pull requests: Read & Write |
| 59 | |
| 60 | * Repository contents: Read & Write (write to let zuul merge change) |
| 61 | |
| 62 | * Set events subscription: |
| 63 | |
| 64 | * Label |
| 65 | |
| 66 | * Status |
| 67 | |
| 68 | * Issue comment |
| 69 | |
| 70 | * Issues |
| 71 | |
| 72 | * Pull request |
| 73 | |
| 74 | * Pull request review |
| 75 | |
| 76 | * Pull request review comment |
| 77 | |
| 78 | * Commit comment |
| 79 | |
| 80 | * Create |
| 81 | |
| 82 | * Push |
| 83 | |
| 84 | * Release |
| 85 | |
| 86 | * Set Where can this GitHub App be installed to "Any account" |
| 87 | |
| 88 | * Create the App |
| 89 | |
| 90 | * Generate a Private key in the app settings page |
| 91 | |
| 92 | Then in the zuul.conf, set webhook_token, app_id and app_key. |
| 93 | After restarting zuul-scheduler, verify in the 'Advanced' tab that the |
| 94 | Ping payload works (green tick and 200 response) |
| 95 | |
| 96 | Users can now install the application using its public page, e.g.: https://github.com/apps/my-org-zuul |
| 97 | |
| 98 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 99 | Connection Configuration |
| 100 | ------------------------ |
| 101 | |
Monty Taylor | ae1f03a | 2017-07-27 14:43:32 -0500 | [diff] [blame] | 102 | There are two forms of operation. Either the Zuul installation can be |
| 103 | configured as a `Github App`_ or it can be configured as a Webhook. |
| 104 | |
| 105 | If the `Github App`_ approach is taken, the config settings ``app_id`` and |
| 106 | ``app_key`` are required. If the Webhook approach is taken, the ``api_token`` |
| 107 | setting is required. |
| 108 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 109 | The supported options in ``zuul.conf`` connections are: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 110 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 111 | .. attr:: <github connection> |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 112 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 113 | .. attr:: driver |
| 114 | :required: |
Monty Taylor | ae1f03a | 2017-07-27 14:43:32 -0500 | [diff] [blame] | 115 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 116 | .. value:: github |
Monty Taylor | ae1f03a | 2017-07-27 14:43:32 -0500 | [diff] [blame] | 117 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 118 | The connection must set ``driver=github`` for GitHub connections. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 119 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 120 | .. attr:: app_id |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 121 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 122 | App ID if you are using a *GitHub App*. Can be found under the |
| 123 | **Public Link** on the right hand side labeled **ID**. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 124 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 125 | .. attr:: app_key |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 126 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 127 | Path to a file containing the secret key Zuul will use to create |
| 128 | tokens for the API interactions. In Github this is known as |
| 129 | **Private key** and must be collected when generated. |
James E. Blair | 4d5dd25 | 2017-06-23 21:40:56 +0100 | [diff] [blame] | 130 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 131 | .. attr:: api_token |
| 132 | |
| 133 | API token for accessing GitHub if Zuul is configured with |
| 134 | Webhooks. See `Creating an access token for command-line use |
| 135 | <https://help.github.com/articles/creating-an-access-token-for-command-line-use/>`_. |
| 136 | |
| 137 | .. attr:: webhook_token |
| 138 | |
| 139 | Required token for validating the webhook event payloads. In |
| 140 | the GitHub App Configuration page, this is called **Webhook |
| 141 | secret**. See `Securing your webhooks |
| 142 | <https://developer.github.com/webhooks/securing/>`_. |
| 143 | |
| 144 | .. attr:: sshkey |
| 145 | :default: ~/.ssh/id_rsa |
| 146 | |
| 147 | Path to SSH key to use when cloning github repositories. |
| 148 | |
| 149 | .. attr:: server |
| 150 | :default: github.com |
| 151 | |
| 152 | Hostname of the github install (such as a GitHub Enterprise). |
| 153 | |
| 154 | .. attr:: canonical_hostname |
| 155 | |
| 156 | The canonical hostname associated with the git repos on the |
| 157 | GitHub server. Defaults to the value of :attr:`<github |
| 158 | connection>.server`. This is used to identify projects from |
| 159 | this connection by name and in preparing repos on the filesystem |
| 160 | for use by jobs. Note that Zuul will still only communicate |
| 161 | with the GitHub server identified by **server**; this option is |
| 162 | useful if users customarily use a different hostname to clone or |
| 163 | pull git repos so that when Zuul places them in the job's |
| 164 | working directory, they appear under this directory name. |
| 165 | |
| 166 | .. attr:: verify_ssl |
| 167 | :default: true |
| 168 | |
| 169 | Enable or disable ssl verification for GitHub Enterprise. This |
| 170 | is useful for a connection to a test installation. |
Tobias Henkel | 65e0e8c | 2017-08-01 13:44:33 +0200 | [diff] [blame] | 171 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 172 | Trigger Configuration |
| 173 | --------------------- |
| 174 | GitHub webhook events can be configured as triggers. |
| 175 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 176 | A connection name with the GitHub driver can take multiple events with |
| 177 | the following options. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 178 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 179 | .. attr:: pipeline.trigger.<github source> |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 180 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 181 | The dictionary passed to the GitHub pipeline ``trigger`` attribute |
| 182 | supports the following attributes: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 183 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 184 | .. attr:: event |
| 185 | :required: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 186 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 187 | The event from github. Supported events are: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 188 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 189 | .. value:: pull_request |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 190 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 191 | .. value:: pull_request_review |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 192 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 193 | .. value:: push |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 194 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 195 | .. attr:: action |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 196 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 197 | A :value:`pipeline.trigger.<github source>.event.pull_request` |
| 198 | event will have associated action(s) to trigger from. The |
| 199 | supported actions are: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 200 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 201 | .. value:: opened |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 202 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 203 | Pull request opened. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 204 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 205 | .. value:: changed |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 206 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 207 | Pull request synchronized. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 208 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 209 | .. value:: closed |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 210 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 211 | Pull request closed. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 212 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 213 | .. value:: reopened |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 214 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 215 | Pull request reopened. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 216 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 217 | .. value:: comment |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 218 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 219 | Comment added to pull request. |
| 220 | |
| 221 | .. value:: labeled |
| 222 | |
| 223 | Label added to pull request. |
| 224 | |
| 225 | .. value:: unlabeled |
| 226 | |
| 227 | Label removed from pull request. |
| 228 | |
| 229 | .. value:: status |
| 230 | |
| 231 | Status set on commit. |
| 232 | |
| 233 | A :value:`pipeline.trigger.<github |
| 234 | source>.event.pull_request_review` event will have associated |
| 235 | action(s) to trigger from. The supported actions are: |
| 236 | |
| 237 | .. value:: submitted |
| 238 | |
| 239 | Pull request review added. |
| 240 | |
| 241 | .. value:: dismissed |
| 242 | |
| 243 | Pull request review removed. |
| 244 | |
| 245 | .. attr:: branch |
| 246 | |
| 247 | The branch associated with the event. Example: ``master``. This |
| 248 | field is treated as a regular expression, and multiple branches |
| 249 | may be listed. Used for ``pull_request`` and |
| 250 | ``pull_request_review`` events. |
| 251 | |
| 252 | .. attr:: comment |
| 253 | |
| 254 | This is only used for ``pull_request`` ``comment`` actions. It |
| 255 | accepts a list of regexes that are searched for in the comment |
| 256 | string. If any of these regexes matches a portion of the comment |
| 257 | string the trigger is matched. ``comment: retrigger`` will |
| 258 | match when comments containing 'retrigger' somewhere in the |
| 259 | comment text are added to a pull request. |
| 260 | |
| 261 | .. attr:: label |
| 262 | |
| 263 | This is only used for ``labeled`` and ``unlabeled`` |
| 264 | ``pull_request`` actions. It accepts a list of strings each of |
| 265 | which matches the label name in the event literally. ``label: |
| 266 | recheck`` will match a ``labeled`` action when pull request is |
| 267 | labeled with a ``recheck`` label. ``label: 'do not test'`` will |
| 268 | match a ``unlabeled`` action when a label with name ``do not |
| 269 | test`` is removed from the pull request. |
| 270 | |
| 271 | .. attr:: state |
| 272 | |
| 273 | This is only used for ``pull_request_review`` events. It |
| 274 | accepts a list of strings each of which is matched to the review |
| 275 | state, which can be one of ``approved``, ``comment``, or |
| 276 | ``request_changes``. |
| 277 | |
| 278 | .. attr:: status |
| 279 | |
| 280 | This is used for ``pull-request`` and ``status`` actions. It |
| 281 | accepts a list of strings each of which matches the user setting |
| 282 | the status, the status context, and the status itself in the |
| 283 | format of ``user:context:status``. For example, |
| 284 | ``zuul_github_ci_bot:check_pipeline:success``. |
| 285 | |
| 286 | .. attr:: ref |
| 287 | |
| 288 | This is only used for ``push`` events. This field is treated as |
| 289 | a regular expression and multiple refs may be listed. GitHub |
| 290 | always sends full ref name, eg. ``refs/tags/bar`` and this |
| 291 | string is matched against the regular expression. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 292 | |
| 293 | Reporter Configuration |
| 294 | ---------------------- |
| 295 | Zuul reports back to GitHub via GitHub API. Available reports include a PR |
| 296 | comment containing the build results, a commit status on start, success and |
| 297 | failure, an issue label addition/removal on the PR, and a merge of the PR |
| 298 | itself. Status name, description, and context is taken from the pipeline. |
| 299 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 300 | .. attr:: pipeline.<reporter>.<github source> |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 301 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 302 | To report to GitHub, the dictionaries passed to any of the pipeline |
| 303 | :ref:`reporter<reporters>` attributes support the following |
| 304 | attributes: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 305 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 306 | .. attr:: status |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 307 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 308 | String value (``pending``, ``success``, ``failure``) that the |
| 309 | reporter should set as the commit status on github. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 310 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 311 | .. TODO support role markup in :default: so we can xref |
| 312 | :attr:`webapp.status_url` below |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 313 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 314 | .. attr:: status-url |
| 315 | :default: webapp.status_url or the empty string |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 316 | |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 317 | String value for a link url to set in the github |
| 318 | status. Defaults to the zuul server status_url, or the empty |
| 319 | string if that is unset. |
| 320 | |
| 321 | .. attr:: comment |
| 322 | :default: true |
| 323 | |
| 324 | Boolean value that determines if the reporter should add a |
| 325 | comment to the pipeline status to the github pull request. Only |
| 326 | used for Pull Request based items. |
| 327 | |
| 328 | .. attr:: merge |
| 329 | :default: false |
| 330 | |
| 331 | Boolean value that determines if the reporter should merge the |
| 332 | pull reqeust. Only used for Pull Request based items. |
| 333 | |
| 334 | .. attr:: label |
| 335 | |
| 336 | List of strings each representing an exact label name which |
| 337 | should be added to the pull request by reporter. Only used for |
| 338 | Pull Request based items. |
| 339 | |
| 340 | .. attr:: unlabel |
| 341 | |
| 342 | List of strings each representing an exact label name which |
| 343 | should be removed from the pull request by reporter. Only used |
| 344 | for Pull Request based items. |
Monty Taylor | ae1f03a | 2017-07-27 14:43:32 -0500 | [diff] [blame] | 345 | |
| 346 | .. _Github App: https://developer.github.com/apps/ |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 347 | |
| 348 | Requirements Configuration |
| 349 | -------------------------- |
| 350 | |
James E. Blair | 32c5248 | 2017-07-29 07:49:03 -0700 | [diff] [blame] | 351 | As described in :attr:`pipeline.require` and :attr:`pipeline.reject`, |
| 352 | pipelines may specify that items meet certain conditions in order to |
| 353 | be enqueued into the pipeline. These conditions vary according to the |
| 354 | source of the project in question. To supply requirements for changes |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 355 | from a GitHub source named ``my-github``, create a congfiguration such |
James E. Blair | 32c5248 | 2017-07-29 07:49:03 -0700 | [diff] [blame] | 356 | as the following:: |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 357 | |
| 358 | pipeline: |
| 359 | require: |
| 360 | my-github: |
| 361 | review: |
| 362 | - type: approval |
| 363 | |
| 364 | This indicates that changes originating from the GitHub connection |
James E. Blair | 02157ad | 2017-08-03 17:34:22 -0700 | [diff] [blame] | 365 | named ``my-github`` must have an approved code review in order to be |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 366 | enqueued into the pipeline. |
| 367 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 368 | .. attr:: pipeline.require.<github source> |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 369 | |
| 370 | The dictionary passed to the GitHub pipeline `require` attribute |
| 371 | supports the following attributes: |
| 372 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 373 | .. attr:: review |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 374 | |
| 375 | This requires that a certain kind of code review be present for |
| 376 | the pull request (it could be added by the event in question). |
| 377 | It takes several sub-parameters, all of which are optional and |
| 378 | are combined together so that there must be a code review |
| 379 | matching all specified requirements. |
| 380 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 381 | .. attr:: username |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 382 | |
| 383 | If present, a code review from this username is required. It |
| 384 | is treated as a regular expression. |
| 385 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 386 | .. attr:: email |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 387 | |
| 388 | If present, a code review with this email address is |
| 389 | required. It is treated as a regular expression. |
| 390 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 391 | .. attr:: older-than |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 392 | |
| 393 | If present, the code review must be older than this amount of |
| 394 | time to match. Provide a time interval as a number with a |
| 395 | suffix of "w" (weeks), "d" (days), "h" (hours), "m" |
| 396 | (minutes), "s" (seconds). Example ``48h`` or ``2d``. |
| 397 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 398 | .. attr:: newer-than |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 399 | |
| 400 | If present, the code review must be newer than this amount of |
| 401 | time to match. Same format as "older-than". |
| 402 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 403 | .. attr:: type |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 404 | |
| 405 | If present, the code review must match this type (or types). |
| 406 | |
| 407 | .. TODO: what types are valid? |
| 408 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 409 | .. attr:: permission |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 410 | |
| 411 | If present, the author of the code review must have this |
| 412 | permission (or permissions). The available values are |
| 413 | ``read``, ``write``, and ``admin``. |
| 414 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 415 | .. attr:: open |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 416 | |
| 417 | A boolean value (``true`` or ``false``) that indicates whether |
| 418 | the change must be open or closed in order to be enqueued. |
| 419 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 420 | .. attr:: current-patchset |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 421 | |
| 422 | A boolean value (``true`` or ``false``) that indicates whether |
| 423 | the item must be associated with the latest commit in the pull |
| 424 | request in order to be enqueued. |
| 425 | |
| 426 | .. TODO: this could probably be expanded upon -- under what |
| 427 | circumstances might this happen with github |
| 428 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 429 | .. attr:: status |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 430 | |
| 431 | A string value that corresponds with the status of the pull |
| 432 | request. The syntax is ``user:status:value``. |
| 433 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 434 | .. attr:: label |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 435 | |
| 436 | A string value indicating that the pull request must have the |
| 437 | indicated label (or labels). |
| 438 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 439 | .. attr:: pipeline.reject.<github source> |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 440 | |
| 441 | The `reject` attribute is the mirror of the `require` attribute. It |
| 442 | also accepts a dictionary under the connection name. This |
| 443 | dictionary supports the following attributes: |
| 444 | |
James E. Blair | 9437591 | 2017-07-28 17:20:27 -0700 | [diff] [blame] | 445 | .. attr:: review |
James E. Blair | d134c6d | 2017-07-26 16:09:34 -0700 | [diff] [blame] | 446 | |
| 447 | This takes a list of code reviews. If a code review matches the |
| 448 | provided criteria the pull request can not be entered into the |
James E. Blair | 91fe483 | 2017-07-28 17:28:26 -0700 | [diff] [blame] | 449 | pipeline. It follows the same syntax as |
| 450 | :attr:`pipeline.require.<github source>.review` |