Skip to content

Commit

Permalink
gerritstatusupdater: add logic for handling Dispatch-Trailer
Browse files Browse the repository at this point in the history
If we receive an event for a commit that contains a Dispatch-Trailer,
then decode that trailer in preference to trying to parse information
from the branch name for the event.

There is a lot going on in this CL. Ideally it would have been split
into separate CLs for easier review etc. However, we have no
unit/integration tests for gerritstatusupdater. The only way we can test
the thing is to hook it up locally using ngrok and fire some events
through it with real CI builds on GitHub. Splitting up this CL into
multiple CLs would have required doing that manual testing many times
over. So hopefully the assurance that this has been tested heavily
locally, in all three modes of GERRITSTATUSUPDATER_DISPATCH_TRAILER_MODE
is sufficient assurance.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I3a3a5a9b4e4efd3745e67b9ebd32badb950d95f5
  • Loading branch information
myitcv committed Apr 3, 2023
1 parent 14e8ce0 commit ba31dea
Show file tree
Hide file tree
Showing 5 changed files with 407 additions and 81 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/andygrunwald/go-gerrit v0.0.0-20220917070846-2e881e2fb2b5
github.com/apex/gateway v1.1.2
github.com/aws/aws-lambda-go v1.32.1
github.com/google/go-cmp v0.5.8
github.com/google/go-github/v45 v45.2.0
github.com/rogpeppe/testscript v1.1.0
golang.org/x/mod v0.6.0-dev.0.20220818022119-ed83ed61efb9
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI=
github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
Expand Down
Loading

0 comments on commit ba31dea

Please sign in to comment.