From e50fccc541d8cbffe09acf27a2a5f4f719af237a Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Thu, 15 Apr 2021 17:07:14 +0200 Subject: [PATCH] Fixes for release process --- .goreleaser.yml | 2 + go.mod | 2 +- go.sum | 12 +- mortems/install_morty | 2 +- .../mortemsfakes/fake_repo_file_service.go | 179 ++++++++++++++++++ 5 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 mortems/mortemsfakes/fake_repo_file_service.go diff --git a/.goreleaser.yml b/.goreleaser.yml index 655a102..3f083c7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -15,6 +15,8 @@ checksum: name_template: 'checksums.txt' snapshot: name_template: "{{ .Tag }}-next" +archives: +- format: binary changelog: sort: asc filters: diff --git a/go.mod b/go.mod index 0a89511..15e268e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/google/go-github/v32 v32.1.0 - github.com/maxbrunsfeld/counterfeiter/v6 v6.2.3 // indirect + github.com/maxbrunsfeld/counterfeiter/v6 v6.2.3 github.com/onsi/ginkgo v1.8.0 github.com/onsi/gomega v1.9.0 github.com/sethvargo/go-githubactions v0.2.0 diff --git a/go.sum b/go.sum index fe83687..87de13e 100644 --- a/go.sum +++ b/go.sum @@ -44,6 +44,7 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -71,6 +72,7 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -80,9 +82,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II= github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= @@ -104,12 +105,15 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/joefitzgerald/rainbow-reporter v0.1.0 h1:AuMG652zjdzI0YCCnXAqATtRBpGXMcAnrajcaTrSeuo= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.3 h1:z1lXirM9f9WTcdmzSZahKh/t+LCqPiiwK2/DB1kLlI4= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.3/go.mod h1:1ftk08SazyElaaNvmqAfZWGwJzshjCfBXDLoQtPAMNk= @@ -122,6 +126,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= +github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/sethvargo/go-githubactions v0.2.0 h1:CKdUfKUJvqqYz7/7l36K2DmsP5JZPycnvjfT5Ae7BVE= github.com/sethvargo/go-githubactions v0.2.0/go.mod h1:ugCoIFQjs7HxIwwYiY7ty6H9T+7Z4ey481HxqA3VRKE= @@ -320,6 +325,7 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -371,8 +377,10 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= diff --git a/mortems/install_morty b/mortems/install_morty index 361b8d2..81348be 100644 --- a/mortems/install_morty +++ b/mortems/install_morty @@ -1,4 +1,4 @@ #!/bin/sh -wget https://github.com/mentimeter/morty/releases/latest/download/morty-darwin +wget https://github.com/mentimeter/morty/releases/latest/download/morty_darwin_amd64 move morty-darwin morty diff --git a/mortems/mortemsfakes/fake_repo_file_service.go b/mortems/mortemsfakes/fake_repo_file_service.go new file mode 100644 index 0000000..d79e4f1 --- /dev/null +++ b/mortems/mortemsfakes/fake_repo_file_service.go @@ -0,0 +1,179 @@ +// Code generated by counterfeiter. DO NOT EDIT. +package mortemsfakes + +import ( + "sync" + + "github.com/mentimeter/morty/mortems" +) + +type FakeRepoFileService struct { + CommitNewFilesStub func(*mortems.RepoFiles) error + commitNewFilesMutex sync.RWMutex + commitNewFilesArgsForCall []struct { + arg1 *mortems.RepoFiles + } + commitNewFilesReturns struct { + result1 error + } + commitNewFilesReturnsOnCall map[int]struct { + result1 error + } + GetFilesStub func() (*mortems.RepoFiles, error) + getFilesMutex sync.RWMutex + getFilesArgsForCall []struct { + } + getFilesReturns struct { + result1 *mortems.RepoFiles + result2 error + } + getFilesReturnsOnCall map[int]struct { + result1 *mortems.RepoFiles + result2 error + } + invocations map[string][][]interface{} + invocationsMutex sync.RWMutex +} + +func (fake *FakeRepoFileService) CommitNewFiles(arg1 *mortems.RepoFiles) error { + fake.commitNewFilesMutex.Lock() + ret, specificReturn := fake.commitNewFilesReturnsOnCall[len(fake.commitNewFilesArgsForCall)] + fake.commitNewFilesArgsForCall = append(fake.commitNewFilesArgsForCall, struct { + arg1 *mortems.RepoFiles + }{arg1}) + fake.recordInvocation("CommitNewFiles", []interface{}{arg1}) + fake.commitNewFilesMutex.Unlock() + if fake.CommitNewFilesStub != nil { + return fake.CommitNewFilesStub(arg1) + } + if specificReturn { + return ret.result1 + } + fakeReturns := fake.commitNewFilesReturns + return fakeReturns.result1 +} + +func (fake *FakeRepoFileService) CommitNewFilesCallCount() int { + fake.commitNewFilesMutex.RLock() + defer fake.commitNewFilesMutex.RUnlock() + return len(fake.commitNewFilesArgsForCall) +} + +func (fake *FakeRepoFileService) CommitNewFilesCalls(stub func(*mortems.RepoFiles) error) { + fake.commitNewFilesMutex.Lock() + defer fake.commitNewFilesMutex.Unlock() + fake.CommitNewFilesStub = stub +} + +func (fake *FakeRepoFileService) CommitNewFilesArgsForCall(i int) *mortems.RepoFiles { + fake.commitNewFilesMutex.RLock() + defer fake.commitNewFilesMutex.RUnlock() + argsForCall := fake.commitNewFilesArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeRepoFileService) CommitNewFilesReturns(result1 error) { + fake.commitNewFilesMutex.Lock() + defer fake.commitNewFilesMutex.Unlock() + fake.CommitNewFilesStub = nil + fake.commitNewFilesReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeRepoFileService) CommitNewFilesReturnsOnCall(i int, result1 error) { + fake.commitNewFilesMutex.Lock() + defer fake.commitNewFilesMutex.Unlock() + fake.CommitNewFilesStub = nil + if fake.commitNewFilesReturnsOnCall == nil { + fake.commitNewFilesReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.commitNewFilesReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeRepoFileService) GetFiles() (*mortems.RepoFiles, error) { + fake.getFilesMutex.Lock() + ret, specificReturn := fake.getFilesReturnsOnCall[len(fake.getFilesArgsForCall)] + fake.getFilesArgsForCall = append(fake.getFilesArgsForCall, struct { + }{}) + fake.recordInvocation("GetFiles", []interface{}{}) + fake.getFilesMutex.Unlock() + if fake.GetFilesStub != nil { + return fake.GetFilesStub() + } + if specificReturn { + return ret.result1, ret.result2 + } + fakeReturns := fake.getFilesReturns + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeRepoFileService) GetFilesCallCount() int { + fake.getFilesMutex.RLock() + defer fake.getFilesMutex.RUnlock() + return len(fake.getFilesArgsForCall) +} + +func (fake *FakeRepoFileService) GetFilesCalls(stub func() (*mortems.RepoFiles, error)) { + fake.getFilesMutex.Lock() + defer fake.getFilesMutex.Unlock() + fake.GetFilesStub = stub +} + +func (fake *FakeRepoFileService) GetFilesReturns(result1 *mortems.RepoFiles, result2 error) { + fake.getFilesMutex.Lock() + defer fake.getFilesMutex.Unlock() + fake.GetFilesStub = nil + fake.getFilesReturns = struct { + result1 *mortems.RepoFiles + result2 error + }{result1, result2} +} + +func (fake *FakeRepoFileService) GetFilesReturnsOnCall(i int, result1 *mortems.RepoFiles, result2 error) { + fake.getFilesMutex.Lock() + defer fake.getFilesMutex.Unlock() + fake.GetFilesStub = nil + if fake.getFilesReturnsOnCall == nil { + fake.getFilesReturnsOnCall = make(map[int]struct { + result1 *mortems.RepoFiles + result2 error + }) + } + fake.getFilesReturnsOnCall[i] = struct { + result1 *mortems.RepoFiles + result2 error + }{result1, result2} +} + +func (fake *FakeRepoFileService) Invocations() map[string][][]interface{} { + fake.invocationsMutex.RLock() + defer fake.invocationsMutex.RUnlock() + fake.commitNewFilesMutex.RLock() + defer fake.commitNewFilesMutex.RUnlock() + fake.getFilesMutex.RLock() + defer fake.getFilesMutex.RUnlock() + copiedInvocations := map[string][][]interface{}{} + for key, value := range fake.invocations { + copiedInvocations[key] = value + } + return copiedInvocations +} + +func (fake *FakeRepoFileService) recordInvocation(key string, args []interface{}) { + fake.invocationsMutex.Lock() + defer fake.invocationsMutex.Unlock() + if fake.invocations == nil { + fake.invocations = map[string][][]interface{}{} + } + if fake.invocations[key] == nil { + fake.invocations[key] = [][]interface{}{} + } + fake.invocations[key] = append(fake.invocations[key], args) +} + +var _ mortems.RepoFileService = new(FakeRepoFileService)