Skip to content

Commit

Permalink
feat(deps): bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
odsod authored and ericwenn committed Sep 27, 2022
1 parent bae5597 commit 5cf842e
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 169 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
steps:
- name: Setup Sage
uses: einride/sage/actions/setup@master
with:
go-version: 1.19

- name: Make
run: make
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Setup Sage
uses: einride/sage/actions/setup@master
with:
go-version: 1.19

- name: Make
run: make
Expand Down
2 changes: 1 addition & 1 deletion .sage/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module sage

go 1.17

require go.einride.tech/sage v0.155.1
require go.einride.tech/sage v0.161.0
4 changes: 2 additions & 2 deletions .sage/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
go.einride.tech/sage v0.155.1 h1:OaIiIXye6dZ/M0XYbwrLDSyaM2GcrzI+qGVj2e+P1Hk=
go.einride.tech/sage v0.155.1/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ=
go.einride.tech/sage v0.161.0 h1:TwWlU6djdEtL9dVOSsG9mXbI110I4+REIpZ5CH1/7dY=
go.einride.tech/sage v0.161.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ=
9 changes: 5 additions & 4 deletions .sage/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"go.einride.tech/sage/sg"
"go.einride.tech/sage/sgtool"
"go.einride.tech/sage/tools/sgbuf"
"go.einride.tech/sage/tools/sgclangformat"
)

type Proto sg.Namespace
Expand All @@ -20,7 +19,7 @@ const (
)

func (Proto) All(ctx context.Context) error {
sg.Deps(ctx, Proto.ClangFormatProto, Proto.BufLint)
sg.Deps(ctx, Proto.BufFormat, Proto.BufLint)
sg.SerialDeps(ctx, Proto.BufGenerate, Proto.BufGenerateGoogleapis)
return nil
}
Expand All @@ -32,9 +31,11 @@ func (Proto) BufLint(ctx context.Context) error {
return cmd.Run()
}

func (Proto) ClangFormatProto(ctx context.Context) error {
func (Proto) BufFormat(ctx context.Context) error {
sg.Logger(ctx).Println("formatting proto files...")
return sgclangformat.FormatProto(ctx)
cmd := sgbuf.Command(ctx, "format", "--write")
cmd.Dir = sg.FromGitRoot("proto")
return cmd.Run()
}

func (Proto) ProtocGenGo(ctx context.Context) error {
Expand Down
4 changes: 2 additions & 2 deletions .sage/sagefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
func All(ctx context.Context) error {
sg.Deps(ctx, ConvcoCheck, FormatYAML, Proto.All)
sg.SerialDeps(ctx, ReadmeSnippet, FormatMarkdown)
sg.Deps(ctx, GolangciLint, GoReview, GoTest)
sg.Deps(ctx, GoLint, GoReview, GoTest)
sg.SerialDeps(ctx, GoModTidy, GitVerifyNoDiff)
return nil
}
Expand All @@ -54,7 +54,7 @@ func FormatMarkdown(ctx context.Context) error {
return sgmarkdownfmt.Command(ctx, "-w", ".").Run()
}

func GolangciLint(ctx context.Context) error {
func GoLint(ctx context.Context) error {
sg.Logger(ctx).Println("linting Go files...")
return sggolangcilint.Run(ctx)
}
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ sagefile := $(abspath $(cwd)/.sage/bin/sagefile)

# Setup Go.
go := $(shell command -v go 2>/dev/null)
export GOWORK ?= off
ifndef go
SAGE_GO_VERSION ?= 1.18.4
export GOROOT := $(abspath $(cwd)/.sage/tools/go/$(SAGE_GO_VERSION)/go)
Expand Down Expand Up @@ -62,6 +63,10 @@ format-yaml: $(sagefile)
git-verify-no-diff: $(sagefile)
@$(sagefile) GitVerifyNoDiff

.PHONY: go-lint
go-lint: $(sagefile)
@$(sagefile) GoLint

.PHONY: go-mod-tidy
go-mod-tidy: $(sagefile)
@$(sagefile) GoModTidy
Expand All @@ -74,10 +79,6 @@ go-review: $(sagefile)
go-test: $(sagefile)
@$(sagefile) GoTest

.PHONY: golangci-lint
golangci-lint: $(sagefile)
@$(sagefile) GolangciLint

.PHONY: readme-snippet
readme-snippet: $(sagefile)
@$(sagefile) ReadmeSnippet
Expand Down
17 changes: 11 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
module github.com/einride/protoc-gen-go-aip-test

go 1.15
go 1.19

require (
github.com/google/go-cmp v0.5.8
github.com/google/go-cmp v0.5.9
github.com/stoewer/go-strcase v1.2.0
go.einride.tech/aip v0.57.0
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb
go.einride.tech/aip v0.58.1
google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
gotest.tools/v3 v3.3.0
)

require (
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.0.0-20220926192436-02166a98028e // indirect
golang.org/x/sys v0.0.0-20220926163933-8cfa568d3c25 // indirect
golang.org/x/text v0.3.7 // indirect
)
134 changes: 14 additions & 120 deletions go.sum

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions proto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ sagefile := $(abspath $(cwd)/../.sage/bin/sagefile)

# Setup Go.
go := $(shell command -v go 2>/dev/null)
export GOWORK ?= off
ifndef go
SAGE_GO_VERSION ?= 1.18.4
export GOROOT := $(abspath $(cwd)/../.sage/tools/go/$(SAGE_GO_VERSION)/go)
Expand Down Expand Up @@ -46,6 +47,10 @@ clean-sage:
all: $(sagefile)
@$(sagefile) Proto:All

.PHONY: buf-format
buf-format: $(sagefile)
@$(sagefile) Proto:BufFormat

.PHONY: buf-generate
buf-generate: $(sagefile)
@$(sagefile) Proto:BufGenerate
Expand All @@ -58,10 +63,6 @@ buf-generate-googleapis: $(sagefile)
buf-lint: $(sagefile)
@$(sagefile) Proto:BufLint

.PHONY: clang-format-proto
clang-format-proto: $(sagefile)
@$(sagefile) Proto:ClangFormatProto

.PHONY: protoc-gen-go
protoc-gen-go: $(sagefile)
@$(sagefile) Proto:ProtocGenGo
Expand Down
3 changes: 0 additions & 3 deletions proto/buf.gen.googleapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ plugins:
- name: go
out: gen
opt: module=google.golang.org/genproto
path: ../.sage/bin/protoc-gen-go

- name: go-grpc
out: gen
opt: module=google.golang.org/genproto
path: ../.sage/bin/protoc-gen-go-grpc

- name: go-aip-test
out: gen
opt: module=google.golang.org/genproto
path: ../.sage/bin/protoc-gen-go-aip-test
3 changes: 0 additions & 3 deletions proto/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ plugins:
- name: go
out: gen
opt: module=github.com/einride/protoc-gen-go-aip-test/proto/gen
path: ../.sage/bin/protoc-gen-go

- name: go-grpc
out: gen
opt: module=github.com/einride/protoc-gen-go-aip-test/proto/gen
path: ../.sage/bin/protoc-gen-go-grpc

- name: go-aip-test
out: gen
opt: module=github.com/einride/protoc-gen-go-aip-test/proto/gen
path: ../.sage/bin/protoc-gen-go-aip-test
2 changes: 2 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version: v1
name: buf.build/einride/protoc-gen-go-aip-test

deps:
- buf.build/googleapis/googleapis

lint:
use:
- DEFAULT
Expand Down
10 changes: 5 additions & 5 deletions proto/einride/example/freight/v1/freight_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ syntax = "proto3";

package einride.example.freight.v1;

option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "FreightServiceProto";
option java_package = "tech.einride.example.freight.v1";

import "einride/example/freight/v1/shipper.proto";
import "einride/example/freight/v1/site.proto";
import "google/api/annotations.proto";
Expand All @@ -15,6 +10,11 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";

option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "FreightServiceProto";
option java_package = "tech.einride.example.freight.v1";

// This API represents a simple freight service.
//
// It defines the following resource model:
Expand Down
5 changes: 2 additions & 3 deletions proto/einride/example/freight/v1/resource_references.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ syntax = "proto3";

package einride.example.freight.v1;

import "google/api/resource.proto";

option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "ResourceDefinitionsProto";
option java_package = "tech.einride.example.freight.v1";

import "google/api/resource.proto";

option (google.api.resource_definition) = {
type: "freight-example.einride.tech/BillingAccount"
pattern: "billingAccount/{billing_account}"
Expand Down
8 changes: 4 additions & 4 deletions proto/einride/example/freight/v1/shipper.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ syntax = "proto3";

package einride.example.freight.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "ShipperProto";
option java_package = "tech.einride.example.freight.v1";

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

// A shipper is a supplier or owner of goods to be transported.
message Shipper {
option (google.api.resource) = {
Expand Down
14 changes: 6 additions & 8 deletions proto/einride/example/freight/v1/site.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ syntax = "proto3";

package einride.example.freight.v1;

option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "SiteProto";
option java_package = "tech.einride.example.freight.v1";

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/type/latlng.proto";

option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "SiteProto";
option java_package = "tech.einride.example.freight.v1";

// A site is a node in a [shipper][einride.example.freight.v1.Shipper]'s
// transport network.
message Site {
Expand Down Expand Up @@ -49,9 +49,7 @@ message Site {
message Billing {
// The billing account used by this site.
// If not specified the shippers billing accout is used.
string billing_account = 1 [
(google.api.resource_reference).type = "freight-example.einride.tech/BillingAccount"
];
string billing_account = 1 [(google.api.resource_reference).type = "freight-example.einride.tech/BillingAccount"];
}

enum Region {
Expand Down

0 comments on commit 5cf842e

Please sign in to comment.