Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

[feature] Rotator can write CircleCI env variables #41

Merged
merged 4 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ All sinks must have the following fields in addition to any sink-specific fields

[`TRAVIS_API_AUTH_TOKEN`](https://github.com/shuheiktgw/go-travis#authentication-with-travis-api-token) should be set.

### Circle CI (`CircleCI`)
| Name | Description | Required |
|------|-------------|:-----:|
| account | The CircleCI account to write this env var to. | yes |
| repo | The CircleCI repo to write this env var to. | yes |

[`CIRCLECI_AUTH_TOKEN`](https://circleci.com/docs/2.0/managing-api-tokens/) must be set.

### AWS Systems Manager Parameter Store (`AWSParameterStore`)
| Name | Description | Required |
|------|-------------|:-----:|
Expand Down
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ module github.com/chanzuckerberg/rotator
go 1.13

require (
github.com/aws/aws-sdk-go v1.28.9
github.com/aws/aws-sdk-go v1.29.5
github.com/chanzuckerberg/go-misc v0.0.0-20191125152854-38391fa92cd1
github.com/fatih/color v1.9.0
github.com/getsentry/sentry-go v0.5.0
github.com/getsentry/sentry-go v0.5.1
github.com/google/uuid v1.1.1
github.com/hashicorp/go-multierror v1.0.0
github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c // indirect
github.com/jszwedko/go-circleci v0.3.0
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/pkg/errors v0.9.1
Expand All @@ -19,9 +20,9 @@ require (
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.4.0
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d // indirect
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 // indirect
github.com/stretchr/testify v1.5.0
golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 // indirect
golang.org/x/sys v0.0.0-20200217220822-9197077df867 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.2.8
)
23 changes: 15 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/aws/aws-lambda-go v1.12.1/go.mod h1:z4ywteZ5WwbIEzG0tXizIAUlUwkTNNknX4upd5Z5XJM=
github.com/aws/aws-sdk-go v1.23.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.28.9 h1:grIuBQc+p3dTRXerh5+2OxSuWFi0iXuxbFdTSg0jaW0=
github.com/aws/aws-sdk-go v1.28.9/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.29.5 h1:PddgnlgWgNI6x/weTnfk1fGYkhcs363gieDzK+Cf91Q=
github.com/aws/aws-sdk-go v1.29.5/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/chanzuckerberg/go-misc v0.0.0-20191125152854-38391fa92cd1 h1:op+eO8J7JrwaAcJBNW0OKk7yLxo680MrPuVXaOerq08=
Expand Down Expand Up @@ -43,8 +43,8 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
github.com/getsentry/sentry-go v0.5.0 h1:TvIiQJIm9lQj8v4CGPL3oSfN+hqc6PTfEBBbt3rrE3c=
github.com/getsentry/sentry-go v0.5.0/go.mod h1:B8H7x8TYDPkeWPRzGpIiFO97LZP6rL8A3hEt8lUItMw=
github.com/getsentry/sentry-go v0.5.1 h1:MIPe7ScHADsrK2vznqmhksIUFxq7m0JfTh+ZIMkI+VQ=
github.com/getsentry/sentry-go v0.5.1/go.mod h1:B8H7x8TYDPkeWPRzGpIiFO97LZP6rL8A3hEt8lUItMw=
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
Expand All @@ -53,6 +53,7 @@ github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
Expand Down Expand Up @@ -90,6 +91,8 @@ github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrO
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/jszwedko/go-circleci v0.3.0 h1:zmYFSb2NlSvUvXydYcJY2AF6n88LGa+5teZtCm2pmmk=
github.com/jszwedko/go-circleci v0.3.0/go.mod h1:z1630OiB7oGxZwE90het04Ld7rIu0AKvY9JCRnaBdoE=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
Expand Down Expand Up @@ -180,6 +183,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.0 h1:DMOzIV76tmoDNE9pX6RSN0aDtCYeCg5VueieJaAo1uw=
github.com/stretchr/testify v1.5.0/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
Expand All @@ -203,8 +208,8 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d h1:9FCpayM9Egr1baVnV1SX0H87m+XB0B8S0hAMi99X/3U=
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 h1:Sy5bstxEqwwbYs6n0/pBuxKENqOeZUgD45Gp3Q3pqLg=
golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All @@ -217,6 +222,8 @@ golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -232,8 +239,8 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867 h1:JoRuNIf+rpHl+VhScRQQvzbHed86tKkqwPMV34T8myw=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand Down
26 changes: 24 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ import (
"github.com/chanzuckerberg/rotator/pkg/sink"
"github.com/chanzuckerberg/rotator/pkg/source"
"github.com/hashicorp/go-multierror"
"github.com/jszwedko/go-circleci"
"github.com/pkg/errors"
"github.com/shuheiktgw/go-travis"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
)

const (
envCircleCIAuthToken = "CIRCLECI_AUTH_TOKEN"
envTravisCIAuthToken = "TRAVIS_API_AUTH_TOKEN"
)

type Config struct {
Version int `yaml:"version"`
Secrets []Secret `yaml:"secrets"`
Expand Down Expand Up @@ -156,13 +162,29 @@ func unmarshalSinks(sinksIface interface{}) (sink.Sinks, error) {

// set up Travis CI API client
client := travis.NewClient(sink.TravisBaseURL, "")
travisToken := os.Getenv("TRAVIS_API_AUTH_TOKEN")
travisToken, present := os.LookupEnv(envTravisCIAuthToken)
if !present {
return nil, errors.Errorf("missing env var: %s", envTravisCIAuthToken)
}
err := client.Authentication.UsingTravisToken(travisToken)
if err != nil {
return nil, errors.Wrap(err, "unable to authenticate travis API")
}

sinks = append(sinks, &sink.TravisCiSink{BaseSink: sink.BaseSink{KeyToName: keyToName}, RepoSlug: sinkMapStr["repo_slug"], Client: client})

case sink.KindCircleCi:
if err = validate(sinkMapStr, "account", "repo"); err != nil {
return nil, errors.Wrap(err, "missing keys in circle CI sink config")
}
circleToken, present := os.LookupEnv(envCircleCIAuthToken)
if !present {
return nil, errors.Errorf("missing env var: %s", envCircleCIAuthToken)
}
client := &circleci.Client{Token: circleToken}
sink := &sink.CircleCiSink{BaseSink: sink.BaseSink{KeyToName: keyToName}}
sink.WithCircleClient(client, sinkMapStr["account"], sinkMapStr["repo"])
sinks = append(sinks, sink)

case sink.KindAwsParamStore:
if err = validate(sinkMapStr, "role_arn", "region"); err != nil {
return nil, errors.Wrap(err, "missing keys in aws parameter store sink config")
Expand Down
46 changes: 46 additions & 0 deletions pkg/sink/circleCi.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package sink

import (
"context"
"time"

"github.com/jszwedko/go-circleci"
"github.com/pkg/errors"
)

const (
circleRetryAttempts = 5
circleRetrySleep = time.Second
)

// CircleCiSink is a circleci sink
type CircleCiSink struct {
BaseSink `yaml:",inline"`

Client *circleci.Client
Account string
Repo string
}

// WithCircleClient configures a circleci client for this sink
func (sink *CircleCiSink) WithCircleClient(client *circleci.Client, account string, repo string) *CircleCiSink {
sink.Client = client
sink.Account = account
sink.Repo = repo

return sink
}

// Write writes the value of the env var with the specified name for the given repo
func (sink *CircleCiSink) Write(ctx context.Context, name string, val string) error {
f := func(ctx context.Context) error {
_, err := sink.Client.AddEnvVar(sink.Account, sink.Repo, name, val)
return errors.Wrapf(err, "could not write %s to %s/%s", name, sink.Account, sink.Repo)
}
return retry(ctx, circleRetryAttempts, circleRetrySleep, f)
}

// Kind returns the kind of this sink
func (sink *CircleCiSink) Kind() Kind {
return KindCircleCi
}
89 changes: 89 additions & 0 deletions pkg/sink/circleCi_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package sink_test

import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"net/url"
"testing"

"github.com/chanzuckerberg/rotator/pkg/sink"
"github.com/jszwedko/go-circleci"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)

const (
circleAccount = "testo_account"
circleRepo = "testo_repo"
circleBadRepo = "bad_testo_repo"
circleEnvVar = "foo"
circleEnvVarVal = "bar"
)

type CircleTestSuite struct {
suite.Suite

ctx context.Context
client *circleci.Client
mux *http.ServeMux
teardown func()
}

func (ts *CircleTestSuite) TearDownTest() {
ts.teardown()
}

func (ts *CircleTestSuite) SetupTest() {
mux := http.NewServeMux()
apiHandler := http.NewServeMux()
apiHandler.Handle("/", mux)

server := httptest.NewServer(apiHandler)
u, _ := url.Parse(server.URL + "/")
client := &circleci.Client{BaseURL: u}

ts.ctx = context.Background()
ts.client = client
ts.mux = mux
ts.teardown = server.Close

t := ts.T()
a := assert.New(t)

mux.HandleFunc(
fmt.Sprintf("/project/%s/%s/envvar", circleAccount, circleRepo),
func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
a.Fail("invalid http method %s", r.Method)
return
}

b, err := ioutil.ReadAll(r.Body)
a.NoError(err)

want := fmt.Sprintf(`{"name":"%s","value":"%s"}`, circleEnvVar, circleEnvVarVal)
if want != string(b) {
http.Error(w, "body doesn't match", http.StatusBadRequest)
}
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, want)
return
},
)
}

func (ts *CircleTestSuite) TestWriteToCircleCiSink() {
t := ts.T()
a := assert.New(t)
sink := &sink.CircleCiSink{}
sink.WithCircleClient(ts.client, circleAccount, circleRepo)
err := sink.Write(ts.ctx, circleEnvVar, circleEnvVarVal)
a.NoError(err)
}

func TestCircleCISuite(t *testing.T) {
suite.Run(t, new(CircleTestSuite))
}
10 changes: 10 additions & 0 deletions pkg/sink/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (e Error) Error() string { return string(e) }
const (
KindBuf Kind = "Buffer"
KindTravisCi Kind = "TravisCI"
KindCircleCi = "CircleCI"
KindAwsParamStore Kind = "AWSParameterStore"
KindAwsSecretsManager Kind = "AWSSecretsManager"
KindStdout Kind = "Stdout"
Expand Down Expand Up @@ -74,6 +75,15 @@ func (sinks Sinks) MarshalYAML() (interface{}, error) {
"external_id": sink.ExternalID,
"region": sink.Region,
})
case KindCircleCi:
sink := s.(*CircleCiSink)
yamlSinks = append(yamlSinks,
map[string]interface{}{
"kind": string(KindCircleCi),
"key_to_name": sink.KeyToName,
"account": sink.Account,
"repo": sink.Repo,
})
default:
return nil, ErrUnknownKind
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/sink/travisCi.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
travisRetrySleep = time.Second
)

// TravisCiSink returns the
// TravisCiSink is a travisCi sink
type TravisCiSink struct {
BaseSink `yaml:",inline"`

Expand Down Expand Up @@ -70,7 +70,6 @@ func (sink *TravisCiSink) create(ctx context.Context, body *travis.EnvVarBody) e
}
return nil
}

return retry(ctx, travisRetryAttempts, travisRetrySleep, f)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sink/travisCi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (ts *TravisTestSuite) TearDownTest() {
func (ts *TravisTestSuite) SetupTest() {
ts.ctx = context.Background()
ts.client, ts.mux, _, ts.teardown = setup()
t := ts.T()
t := ts.T().(*testing.T)

ts.mux.HandleFunc(fmt.Sprintf("/repo/%s/env_vars", testRepoSlug), func(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodGet {
Expand Down
36 changes: 36 additions & 0 deletions vendor/github.com/jszwedko/go-circleci/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading