From 6514b629bb6aa94962a7bc4a4a849a611e3e0d7d Mon Sep 17 00:00:00 2001 From: Luke Brakel Date: Wed, 7 Aug 2024 11:54:45 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Deprecate=20`skip=5Fdownload`=20?= =?UTF-8?q?in=20favour=20of=20`no=5Fget`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `skip_download: true` allows us to prevent re-downloading in the implicit get step that is run after a put step. However, this has the added drawback of leaving us with an empty volume which means we need to alias the resource for updating the pull-request. We can instead use `no_get: true` on the put step to prevent the get step from running entirely, removing the need to alias the resource as the volume will be un-affected. https://concourse-ci.org/put-step.html#schema.put.no_get --- README.md | 17 +---------------- in.go | 2 ++ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 5234603..964a20a 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ generate notifications over the webhook. So if you have a repository with little | Parameter | Required | Example | Description | |----------------------|----------|----------|------------------------------------------------------------------------------------| -| `skip_download` | No | `true` | Use with `get_params` in a `put` step to do nothing on the implicit get. | +| `skip_download` | No | `true` | (deprecated) Use `no_get` on the put step instead. | | `integration_tool` | No | `rebase` | The integration tool to use, `merge`, `rebase` or `checkout`. Defaults to `merge`. | | `git_depth` | No | `1` | Shallow clone the repository using the `--depth` Git option | | `submodules` | No | `true` | Recursively clone git submodules. Defaults to false. | @@ -129,21 +129,6 @@ is available as `.git/resource/base_sha`. For a complete list of available (indi - `title`: the title of the pull request - `url`: the URL for the pull request - -When specifying `skip_download` the pull request volume mounted to subsequent tasks will be empty, which is a problem -when you set e.g. the pending status before running the actual tests. The workaround for this is to use an alias for -the `put` (see telia-oss/github-pr-resource#32 for more details). -Example here: - -```yaml -put: update-status <-- Use an alias for the pull-request resource -resource: pull-request -params: - path: pull-request - status: pending -get_params: {skip_download: true} -``` - git-crypt encrypted repositories will automatically be decrypted when the `git_crypt_key` is set in the source configuration. Note that, should you retrigger a build in the hopes of testing the last commit to a PR against a newer version of diff --git a/in.go b/in.go index 7fae440..f23e73a 100644 --- a/in.go +++ b/in.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "io/ioutil" + "log" "os" "path/filepath" "strconv" @@ -12,6 +13,7 @@ import ( // Get (business logic) func Get(request GetRequest, github Github, git Git, outputDir string) (*GetResponse, error) { if request.Params.SkipDownload { + log.Print("`skip_download` has been deprecated, use `no_get` instead to prevent this implicit get step from running.") return &GetResponse{Version: request.Version}, nil }