Concourse: Set pin comment through fly

Created on 13 Sep 2019  路  3Comments  路  Source: concourse/concourse

I want to be able to set a pin comment through the fly command to pin a resource version. The command will look something similar to this

fly -t <target> pin-resource-version -v <version> -c "I pinned it cause I feel like it"

You will probably need to use the feature-2702-fly-pin-version branch and work off of that. You will also probably want to add the pin comment after you pin the version (https://github.com/concourse/concourse/blob/feature-2702-fly-pin-version/fly/commands/pin_resource_version.go#L41) since the version needs to be pinned before you can add a comment.

The set pin comment endpoint already exists (https://github.com/concourse/concourse/blob/master/atc/api/resourceserver/set_pin_comment.go) so you can just use that.

Steps:

  1. Add a go-concourse method for setting a pin comment. The method should construct a request using the correct params outlined in the URL of the SetPinCommentOnResource endpoint. (https://github.com/concourse/concourse/blob/master/atc/routes.go#L49) The request should not receive a response.
  2. Edit the existing fly pin-resource-version command to also be able to take in a flag --comment for being able to add a comment alongside pinning a resource version by using the new go-concourse method for setting a pin comment
enhancement fly good first issue

Most helpful comment

With pin-resource do we still need the command pin-resource-version in #4417 ? I think we could generalize them and make it one command that supports different flags.

All 3 comments

With pin-resource do we still need the command pin-resource-version in #4417 ? I think we could generalize them and make it one command that supports different flags.

Oh I did mean have it within the same command haha I didn't know you changed the command to pin-resource-version! It should be just one command where you can pass it the flag of --comment and --version in order to pin a version with a comment.

The changes are included in PR https://github.com/concourse/concourse/pull/4417

Was this page helpful?
0 / 5 - 0 ratings