Skip to content

Commit

Permalink
refactor(api): cleanup security api autogeneration
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sanders <[email protected]>
  • Loading branch information
sandersms authored and artek-koltun committed Jan 23, 2024
1 parent 37179ae commit ab564df
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 39,843 deletions.
25 changes: 12 additions & 13 deletions security/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all:
# Build root security protos
all: buflint bufgen doc

doc:
rm -rf ./google
rm -rf ./v1/{autogen.md,gen}
mkdir -p ./v1/gen/{go,cpp,python}
rm -f ./v1/autogen.md
mkdir -p ./v1

# protoc doesn't include annotation and http googleapis, so we have to get them here
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api

docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v ${PWD}/google/api:/opt/include/google/api namely/protoc-all:1.51_2 --lint -d v1 -l go -o ./v1/gen/go/ --go-source-relative
docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v ${PWD}/google/api:/opt/include/google/api namely/protoc-all:1.51_2 --lint -d v1 -l cpp -o ./v1/gen/cpp/ --go-source-relative
docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v ${PWD}/google/api:/opt/include/google/api namely/protoc-all:1.51_2 --lint -d v1 -l python -o ./v1/gen/python/ --go-source-relative
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}"/v1/:/out -w /out -v "${PWD}":/protos pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"

rm -rf "${PWD}"/google

mv google "${PWD}"/v1/
buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint

docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}"/v1/:/out -v "${PWD}"/v1:/protos pseudomuto/protoc-gen-doc:1.5.1 --doc_opt=markdown,autogen.md
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}"/v1/:/out -w /out -v "${PWD}"/v1:/protos pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /common -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}"/v1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.63.1 -c "api-linter -I /common /out/*.proto --output-format summary"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}"/v1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.63.1 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192 --disable-rule=core::0191 --disable-rule=core::0140 --disable-rule=core::0123 --disable-rule=core::0142 --disable-rule=core::0126 --disable-rule=core::0127 --disable-rule=core::0141 --disable-rule=core::0203 --disable-rule=core::0216 --set-exit-status"
rm -rf "${PWD}"/v1/google
bufgen:
docker run --rm -v "${PWD}/..":/base -v "${PWD}":/out -w /out msandersdell/bufbuild-go-gen:1.1.0 generate --template /base/buf.gen.yaml -o v1
File renamed without changes.
468 changes: 0 additions & 468 deletions security/v1/gen/cpp/ipsec.grpc.pb.cc

This file was deleted.

1,666 changes: 0 additions & 1,666 deletions security/v1/gen/cpp/ipsec.grpc.pb.h

This file was deleted.

17,073 changes: 0 additions & 17,073 deletions security/v1/gen/cpp/ipsec.pb.cc

This file was deleted.

20,486 changes: 0 additions & 20,486 deletions security/v1/gen/cpp/ipsec.pb.h

This file was deleted.

4 changes: 2 additions & 2 deletions security/v1/gen/go/ipsec.pb.go

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

71 changes: 47 additions & 24 deletions security/v1/gen/go/ipsec_grpc.pb.go

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

223 changes: 112 additions & 111 deletions security/v1/gen/python/ipsec_pb2.py

Large diffs are not rendered by default.

0 comments on commit ab564df

Please sign in to comment.