Skip to content

Commit

Permalink
Merge pull request #174 from GoogleCloudPlatform/minor-fixes-update_deps
Browse files Browse the repository at this point in the history
Minor fixes update deps
  • Loading branch information
monicacinom authored Jun 8, 2023
2 parents ec3dbaa + c69e860 commit 17dd0b4
Show file tree
Hide file tree
Showing 20 changed files with 2,531 additions and 352 deletions.
16 changes: 6 additions & 10 deletions bigquery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ import (

"cloud.google.com/go/bigquery"
"cloud.google.com/go/civil"
cbpb "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb"
"github.com/GoogleCloudPlatform/cloud-build-notifiers/lib/notifiers"
log "github.com/golang/glog"
"github.com/golang/protobuf/ptypes"
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/google"
"github.com/google/go-containerregistry/pkg/v1/remote"
cbpb "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1"
"google.golang.org/protobuf/types/known/timestamppb"
)

var tableResource = regexp.MustCompile(".*/.*/.*/(.*)/.*/(.*)")
Expand Down Expand Up @@ -194,10 +193,10 @@ func (n *bqNotifier) SetUp(ctx context.Context, cfg *notifiers.Config, bigQueryJ
}

func parsePBTime(time *timestamppb.Timestamp) (civil.DateTime, error) {
newTime, err := ptypes.Timestamp(time)
if err != nil {
return civil.DateTime{}, fmt.Errorf("error parsing timestamp: %v", err)
if time == nil {
return civil.DateTime{}, fmt.Errorf("timestamp is nil")
}
newTime := time.AsTime()
return civil.DateTimeOf(newTime), nil
}

Expand Down Expand Up @@ -243,10 +242,7 @@ func (n *bqNotifier) SendNotification(ctx context.Context, build *cbpb.Build) er
if err != nil {
return fmt.Errorf("error parsing FinishTime: %v", err)
}
unixZeroTimestamp, err := ptypes.TimestampProto(time.Unix(0, 0))
if err != nil {
return err
}
unixZeroTimestamp := timestamppb.New(time.Unix(0, 0))
for _, step := range build.GetSteps() {
st := step.GetTiming().GetStartTime()
et := step.GetTiming().GetEndTime()
Expand Down
2 changes: 1 addition & 1 deletion bigquery/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
"testing"

"cloud.google.com/go/bigquery"
cbpb "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb"
"github.com/GoogleCloudPlatform/cloud-build-notifiers/lib/notifiers"
log "github.com/golang/glog"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/types"
"google.golang.org/api/googleapi"
cbpb "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1"
"google.golang.org/protobuf/types/known/timestamppb"
)

Expand Down
2 changes: 1 addition & 1 deletion githubissues/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/GoogleCloudPlatform/cloud-build-notifiers/lib/notifiers"
log "github.com/golang/glog"

cbpb "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1"
cbpb "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion githubissues/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"
"text/template"

cbpb "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb"
"github.com/GoogleCloudPlatform/cloud-build-notifiers/lib/notifiers"
cbpb "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1"
)

const githubToken = "ghtABC="
Expand Down
41 changes: 21 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,27 @@ go 1.16
replace github.com/GoogleCloudPlatform/cloud-build-notifiers/lib/notifiers => ./lib/notifiers

require (
cloud.google.com/go v0.81.0
cloud.google.com/go/bigquery v1.16.0
cloud.google.com/go/storage v1.14.0
github.com/antlr/antlr4 v0.0.0-20210404160547-4dfacf63e228 // indirect
github.com/docker/cli v20.10.5+incompatible // indirect
github.com/docker/docker v20.10.5+incompatible // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2
cloud.google.com/go v0.110.0
cloud.google.com/go/bigquery v1.50.0
cloud.google.com/go/cloudbuild v1.9.0
cloud.google.com/go/secretmanager v1.11.0
cloud.google.com/go/storage v1.29.0
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/apache/thrift v0.18.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/glog v1.1.1
github.com/google/cel-go v0.7.3
github.com/google/go-cmp v0.5.5
github.com/google/go-containerregistry v0.4.1
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/slack-go/slack v0.8.2
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/api v0.43.0
google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda
google.golang.org/protobuf v1.27.1
github.com/google/flatbuffers v23.3.3+incompatible // indirect
github.com/google/go-cmp v0.5.9
github.com/google/go-containerregistry v0.15.2
github.com/gorilla/websocket v1.5.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/slack-go/slack v0.12.2
github.com/stoewer/go-strcase v1.3.0 // indirect
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb // indirect
google.golang.org/api v0.125.0
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.0.3 // indirect
k8s.io/client-go v0.20.5
k8s.io/client-go v0.27.1
)
Loading

0 comments on commit 17dd0b4

Please sign in to comment.