Skip to content

Commit

Permalink
Handle the case of multiple versions of a status
Browse files Browse the repository at this point in the history
The GitHub API keeps old versions of a status for historical
reasons. The statuses are returned in reverse chronological
order. This patch pulls-in a version of go-scm that handles
this behaviour and only returns the latest status.

Fixes #2188

Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
(cherry picked from commit a5794f2)
  • Loading branch information
afrittoli authored and tekton-robot committed Mar 10, 2020
1 parent 0077102 commit 94469a8
Show file tree
Hide file tree
Showing 21 changed files with 474 additions and 45 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/golang-lru v0.5.3
github.com/imdario/mergo v0.3.8 // indirect
github.com/jenkins-x/go-scm v1.5.73
github.com/jenkins-x/go-scm v1.5.79
github.com/json-iterator/go v1.1.8 // indirect
github.com/markbates/inflect v1.0.4 // indirect
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jenkins-x/go-scm v1.5.73 h1:ThyFuUdrKivXDHWStSmpQ/M7tJ331l7lzHtR5k5/RhY=
github.com/jenkins-x/go-scm v1.5.73/go.mod h1:PCT338UhP/pQ0IeEeMEf/hoLTYKcH7qjGEKd7jPkeYg=
github.com/jenkins-x/go-scm v1.5.79 h1:+HIEkc/Dzdq0buJF8q0Keip2wexW40BfkrDXKx88T78=
github.com/jenkins-x/go-scm v1.5.79/go.mod h1:PCT338UhP/pQ0IeEeMEf/hoLTYKcH7qjGEKd7jPkeYg=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
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=
Expand Down
2 changes: 0 additions & 2 deletions third_party/github.com/hashicorp/errwrap/go.mod

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

2 changes: 0 additions & 2 deletions third_party/github.com/hashicorp/go-multierror/go.mod

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

5 changes: 3 additions & 2 deletions vendor/github.com/jenkins-x/go-scm/scm/client.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/jenkins-x/go-scm/scm/content.go

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

93 changes: 93 additions & 0 deletions vendor/github.com/jenkins-x/go-scm/scm/deploy.go

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

5 changes: 5 additions & 0 deletions vendor/github.com/jenkins-x/go-scm/scm/driver/fake/data.go

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

5 changes: 4 additions & 1 deletion vendor/github.com/jenkins-x/go-scm/scm/driver/fake/fake.go

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

96 changes: 66 additions & 30 deletions vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go

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

29 changes: 29 additions & 0 deletions vendor/github.com/jenkins-x/go-scm/scm/driver/fake/user.go

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

Loading

0 comments on commit 94469a8

Please sign in to comment.