Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Protobuf common.proto namespace clash #592

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ vendor: validate-go-version
@mkdir -p core/integration/ddsched/protos
@curl -s -L $(DD_PROTO) -o core/integration/ddsched/protos/ddsched.proto

@echo -e "\033[1;33mcurl common.proto\033[0m"
@echo -e "\033[1;33mcurl bkcommon.proto\033[0m"
@mkdir -p core/integration/bookkeeping/protos
@curl -s -L $(BK_COM_PROTO) -o core/integration/bookkeeping/protos/common.proto
@curl -s -L $(BK_COM_PROTO) -o core/integration/bookkeeping/protos/bkcommon.proto

@echo -e "\033[1;33mcurl environment.proto\033[0m"
@mkdir -p core/integration/bookkeeping/protos
Expand Down Expand Up @@ -247,7 +247,7 @@ vendor: validate-go-version
@perl -pi -e '$$_.="option go_package = \"github.com/AliceO2Group/Control/core/integration/ddsched/protos;ddpb\";\n" if (/^package/)' core/integration/ddsched/protos/ddsched.proto

@echo -e "\033[1;33mpatch common.proto\033[0m"
@perl -pi -e '$$_.="option go_package = \"github.com/AliceO2Group/Control/core/integration/bookkeeping/protos;bkpb\";\n" if (/^package/)' core/integration/bookkeeping/protos/common.proto
@perl -pi -e '$$_.="option go_package = \"github.com/AliceO2Group/Control/core/integration/bookkeeping/protos;bkpb\";\n" if (/^package/)' core/integration/bookkeeping/protos/bkcommon.proto

@echo -e "\033[1;33mpatch environment.proto\033[0m"
@perl -pi -e '$$_.="option go_package = \"github.com/AliceO2Group/Control/core/integration/bookkeeping/protos;bkpb\";\n" if (/^package/)' core/integration/bookkeeping/protos/environment.proto
Expand All @@ -261,17 +261,23 @@ vendor: validate-go-version
@echo -e "\033[1;33mpatch run.proto\033[0m"
@perl -pi -e '$$_.="option go_package = \"github.com/AliceO2Group/Control/core/integration/bookkeeping/protos;bkpb\";\n" if (/^package/)' core/integration/bookkeeping/protos/run.proto

@echo -e "\033[1;33mpatch lhcFill.proto\033[0m"
@perl -pi -e '$$_.="option go_package = \"github.com/AliceO2Group/Control/core/integration/bookkeeping/protos;bkpb\";\n" if (/^package/)' core/integration/bookkeeping/protos/lhcFill.proto

@echo -e "\033[1;33mpatch environment.proto\033[0m"
@perl -pi -e 's/.*/import \"protos\/common\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/environment.proto
@perl -pi -e 's/.*/import \"protos\/bkcommon\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/environment.proto

@echo -e "\033[1;33mpatch flp.proto\033[0m"
@perl -pi -e 's/.*/import \"protos\/common\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/flp.proto
@perl -pi -e 's/.*/import \"protos\/bkcommon\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/flp.proto

@echo -e "\033[1;33mpatch log.proto\033[0m"
@perl -pi -e 's/.*/import \"protos\/common\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/log.proto
@perl -pi -e 's/.*/import \"protos\/bkcommon\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/log.proto

@echo -e "\033[1;33mpatch run.proto\033[0m"
@perl -pi -e 's/.*/import \"protos\/common\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/run.proto
@perl -pi -e 's/.*/import \"protos\/bkcommon\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/run.proto

@echo -e "\033[1;33mpatch lhcFill.proto\033[0m"
@perl -pi -e 's/.*/import \"protos\/bkcommon\.proto\";/ if (/^import/)' core/integration/bookkeeping/protos/lhcFill.proto

# @echo -e "\033[1;33mdep ensure\033[0m"
# @./tools/dep ensure
Expand Down
5 changes: 1 addition & 4 deletions core/integration/bookkeeping/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

// Generate protofiles using the .protos imported from Bookkeeping in the Makefile
//go:generate protoc --go_out=. --go_opt=paths=source_relative protos/common.proto
//go:generate protoc --go_out=. --go_opt=paths=source_relative protos/bkcommon.proto
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_out=require_unimplemented_servers=false:. protos/environment.proto
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_out=require_unimplemented_servers=false:. protos/flp.proto
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_out=require_unimplemented_servers=false:. protos/log.proto
Expand Down Expand Up @@ -1218,8 +1218,6 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
return
}

createdAt := time.Now().UnixMilli()

var statusMessage = ""
envState := env.CurrentState()
if envState == "STANDBY" || envState == "DEPLOYED" {
Expand All @@ -1232,7 +1230,6 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {

inEnv := bkpb.EnvironmentCreationRequest{
Id: env.Id().String(),
CreatedAt: &createdAt,
Status: &envState,
StatusMessage: &statusMessage,
}
Expand Down
Loading
Loading