Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
andream16 committed Oct 14, 2024
1 parent bfdc872 commit ca50afd
Show file tree
Hide file tree
Showing 85 changed files with 1,392 additions and 2,173 deletions.
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ARANGODB_NS=arangodb

DOCKER=docker
PROTOC=protoc
BUF_CONTAINER=buf:local

export

Expand Down Expand Up @@ -122,7 +123,6 @@ install-lint-tools:
@go install github.com/kisielk/errcheck@latest
@go install github.com/rhysd/actionlint/cmd/actionlint@latest
@go install github.com/client9/misspell/cmd/misspell@latest
@go install github.com/bufbuild/buf/cmd/[email protected]
@npm ci

install-go-test-tools:
Expand All @@ -140,10 +140,6 @@ migration-tests: cmd/draconctl/bin

test: go-tests migration-tests

fmt-proto:
@echo "Tidying up Proto files"
@buf format -w ./api/proto

install-go-fmt-tools:
@go install github.com/bufbuild/buf/cmd/[email protected]
@go install golang.org/x/tools/cmd/goimports@latest
Expand Down Expand Up @@ -315,9 +311,23 @@ dev-deploy: deploy-cluster dev-infra dev-dracon
dev-teardown:
@kind delete clusters dracon-demo

generate-protos: install-lint-tools
@echo "Generating Protos"
@buf generate
build_buf_container:
$(DOCKER) build . -t $(BUF_CONTAINER) -f containers/Dockerfile.buf

run_buf: build_buf_container
$(DOCKER) run --volume "$(shell pwd):/workspace" --workdir /workspace $(BUF_CONTAINER) $(ARGS)

fmt-proto: build_buf_container
@echo "Tidying up Proto files"
$(MAKE) run_buf ARGS="format -w"

lint-proto: build_buf_container
@echo "Linting Proto files"
$(MAKE) run_buf ARGS="lint --exclude-path vendor"

generate-proto: build_buf_container
@echo "Generating Proto files"
$(MAKE) run_buf ARGS="generate"

########################################
########### RELEASE UTILITIES ##########
Expand Down
2 changes: 1 addition & 1 deletion api/proto/v1/engine.pb.go

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

2 changes: 1 addition & 1 deletion api/proto/v1/engine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ message ScanInfo {
map<string, string> scan_tags = 3;
}

/* LaunchToolReponse consists of a response built by a producer,
/* LaunchToolResponse consists of a response built by a producer,
* to be interpreted by a consumer */
message LaunchToolResponse {
// The scan information, see above for details
Expand Down
2 changes: 1 addition & 1 deletion buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: v2
lint:
use:
- DEFAULT
- STANDARD
- COMMENTS
- UNARY_RPC
- PACKAGE_NO_IMPORT_CYCLE
Expand Down
12 changes: 12 additions & 0 deletions containers/Dockerfile.buf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:alpine AS golang
ENV GO111MODULE=on

RUN go install google.golang.org/protobuf/cmd/[email protected]

FROM bufbuild/buf:1.45.0 AS buf

FROM scratch
COPY --from=golang /go/bin/protoc-gen-go /go/bin/protoc-gen-go
COPY --from=buf /usr/local/bin/buf /usr/local/bin/buf
ENV PATH="/go/bin:${PATH}"
ENTRYPOINT ["/usr/local/bin/buf"]
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ require (
go.mongodb.org/mongo-driver v1.10.0
golang.org/x/crypto v0.18.0
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
google.golang.org/api v0.156.0
google.golang.org/protobuf v1.34.1
google.golang.org/protobuf v1.35.1
helm.sh/helm/v3 v3.14.4
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
Expand Down Expand Up @@ -77,7 +78,7 @@ require (
github.com/goccy/go-json v0.9.11 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/cel-go v0.20.0 // indirect
Expand Down Expand Up @@ -142,7 +143,6 @@ require (
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
Expand Down Expand Up @@ -1802,8 +1802,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/golang/protobuf/jsonpb/decode.go

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

1 change: 1 addition & 0 deletions vendor/github.com/golang/protobuf/jsonpb/encode.go

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

7 changes: 4 additions & 3 deletions vendor/github.com/golang/protobuf/ptypes/any.go

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

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

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

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

20 changes: 10 additions & 10 deletions vendor/google.golang.org/protobuf/internal/descopts/options.go

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

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

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

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

6 changes: 3 additions & 3 deletions vendor/google.golang.org/protobuf/internal/errors/errors.go

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

8 changes: 8 additions & 0 deletions vendor/google.golang.org/protobuf/internal/filedesc/desc.go

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

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

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

Loading

0 comments on commit ca50afd

Please sign in to comment.