You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`repository`| Yes |`itsdalmo/test-repository`| The repository to target. |
25
25
|`access_token`| Yes || A Github Access Token with repository access (required for setting status on commits). N.B. If you want github-pr-resource to work with a private repository. Set `repo:full` permissions on the access token you create on GitHub. If it is a public repository, `repo:status` is enough. |
26
26
|`v3_endpoint`| No |`https://api.github.com`| Endpoint to use for the V3 Github API (Restful). |
@@ -32,17 +32,18 @@ Make sure to check out [#migrating](#migrating) to learn more.
32
32
|`disable_forks`| No |`true`| Disable triggering of the resource if the pull request's fork repository is different to the configured repository. |
33
33
|`ignore_drafts`| No |`false`| Disable triggering of the resource if the pull request is in Draft status. |
34
34
|`required_review_approvals`| No |`2`| Disable triggering of the resource if the pull request does not have at least `X` approved review(s). |
35
-
|`git_crypt_key`| No |`AEdJVENSWVBUS0VZAAAAA...`| Base64 encoded git-crypt key. Setting this will unlock / decrypt the repository with git-crypt. To get the key simply execute `git-crypt export-key -- - | base64` in an encrypted repository.|
35
+
|`git_crypt_key`| No |`AEdJVENSWVBUS0VZAAAAA...`| Base64 encoded git-crypt key. Setting this will unlock / decrypt the repository with git-crypt. To get the key simply execute `git-crypt export-key -- - | base64` in an encrypted repository.|
36
36
|`base_branch`| No |`master`| Name of a branch. The pipeline will only trigger on pull requests against the specified branch. |
37
37
|`labels`| No |`["bug", "enhancement"]`| The labels on the PR. The pipeline will only trigger on pull requests having at least one of the specified labels. |
38
38
|`disable_git_lfs`| No |`true`| Disable Git LFS, skipping an attempt to convert pointers of files tracked into their corresponding objects when checked out into a working copy. |
39
39
|`states`| No |`["OPEN", "MERGED"]`| The PR states to select (`OPEN`, `MERGED` or `CLOSED`). The pipeline will only trigger on pull requests matching one of the specified states. Default is ["OPEN"]. |
40
40
41
41
Notes:
42
-
- If `v3_endpoint` is set, `v4_endpoint` must also be set (and the other way around).
43
-
- Look at the [Concourse Resources documentation](https://concourse-ci.org/resources.html#resource-webhook-token)
44
-
for webhook token configuration.
45
-
- When using `required_review_approvals`, you may also want to enable GitHub's branch protection rules to [dismiss stale pull request approvals when new commits are pushed](https://help.github.com/en/articles/enabling-required-reviews-for-pull-requests).
42
+
43
+
- If `v3_endpoint` is set, `v4_endpoint` must also be set (and the other way around).
44
+
- Look at the [Concourse Resources documentation](https://concourse-ci.org/resources.html#resource-webhook-token)
45
+
for webhook token configuration.
46
+
- When using `required_review_approvals`, you may also want to enable GitHub's branch protection rules to [dismiss stale pull request approvals when new commits are pushed](https://help.github.com/en/articles/enabling-required-reviews-for-pull-requests).
46
47
47
48
## Behaviour
48
49
@@ -62,25 +63,26 @@ If several commits are pushed to a given PR at the same time, the last commit wi
62
63
This resource does not implement any caching, so it should work well with webhooks (should be subscribed to `push` and `pull_request` events).
63
64
One thing to keep in mind however, is that pull requests that are opened from a fork and commits to said fork will not
64
65
generate notifications over the webhook. So if you have a repository with little traffic and expect pull requests from forks,
65
-
you'll need to discover those versions with `check_every: 1m` for instance. `check` in this resource is not a costly operation,
66
-
so normally you should not have to worry about the rate limit.
66
+
you'll need to discover those versions with `check_every: 1m` for instance. `check` in this resource is not a costly operation,
67
+
so normally you should not have to worry about the rate limit.
Ref the above, here are some examples of running `check` against large repositories and the cost of doing so:
195
+
194
196
- [concourse/concourse](https://github.com/concourse/concourse): 51 open pull requests at the time of testing. Cost 2.
195
197
- [torvalds/linux](https://github.com/torvalds/linux): 305 open pull requests. Cost 8.
196
198
- [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes): 1072 open pull requests. Cost: 22.
197
199
198
200
For the other two operations the costing is a bit easier:
201
+
199
202
- `get`: Fixed cost of 1. Fetches the pull request at the given commit.
200
203
- `put`: Uses the V3 API and has a min cost of 1, +1 for each of `status`, `comment` and `comment_file` etc.
201
204
202
205
## Migrating
203
206
204
-
If you are coming from [jtarchie/github-pullrequest-resource][original-resource], its important to know that this resource is inspired by *but not a drop-in replacement for* the original. Here are some important differences:
207
+
If you are coming from [jtarchie/github-pullrequest-resource][original-resource], its important to know that this resource is inspired by _but not a drop-in replacement for_ the original. Here are some important differences:
205
208
206
209
#### New parameters:
210
+
207
211
- `source`:
208
212
- `v4_endpoint`(see description above)
209
213
- `put`:
210
214
- `comment`(see description above)
211
215
212
216
#### Parameters that have been renamed:
217
+
213
218
- `source`:
214
219
- `repo`-> `repository`
215
220
- `ci_skip`-> `disable_ci_skip` (the logic has been inverted and its `true` by default)
@@ -223,6 +228,7 @@ If you are coming from [jtarchie/github-pullrequest-resource][original-resource]
223
228
- `comment`-> `comment_file` (because we added `comment`)
224
229
225
230
#### Parameters that are no longer needed:
231
+
226
232
- `src`:
227
233
- `uri`: We fetch the URI directly from the Github API instead.
228
234
- `private_key`: We clone over HTTPS using the access token for authentication.
@@ -233,6 +239,7 @@ If you are coming from [jtarchie/github-pullrequest-resource][original-resource]
233
239
- `fetch_merge`: We are opinionated and always do a fetch_merge.
234
240
235
241
#### Parameters that did not make it:
242
+
236
243
- `src`:
237
244
- `authorship_restriction`
238
245
- `label`
@@ -246,3 +253,41 @@ If you are coming from [jtarchie/github-pullrequest-resource][original-resource]
246
253
Note that if you are migrating from the original resource on a Concourse version prior to `v5.0.0`, you might
247
254
see an error `failed to unmarshal request: json: unknown field "ref"`. The solution is to rename the resource
248
255
so that the history is wiped. See [#64](https://github.com/telia-oss/github-pr-resource/issues/64) for details.
256
+
257
+
## Debugging
258
+
259
+
The following query is useful for debugging with the github
260
+
graphql explorer
261
+
262
+
```graphql
263
+
# Type queries into this side of the screen, and you will
264
+
# see intelligent typeaheads aware of the current GraphQL type schema,
265
+
# live syntax, and validation errors highlighted within the text.
266
+
267
+
# We'll get you started with a simple query showing your username!
0 commit comments