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

Go web server: get entity #235

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Go web server: get entity #235

wants to merge 9 commits into from

Conversation

teivah
Copy link

@teivah teivah commented Jun 8, 2023

A first iteration of the Go web server that cover the get entity endpoint.

Copy link
Member

@vorburger vorburger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love where this is heading! Thank You @teivah. I've posted some inline review feedback.

Shall we try to get this PR into a state where ui-go does the equivalent of the current ui-soy?

@@ -0,0 +1,19 @@
PROTO_DIR := ../../core/lib/src/main/java/dev/enola/core
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to replace this with https://github.com/bazelbuild/rules_go and avoid having a Makefile at all?

Comment on lines 9 to 13
generate:
@echo "Generating Go code from protobuf..."
protoc --proto_path=$(PROTO_DIR) --go_out=$(GO_OUT) $(PROTO_DIR)/$(PROTO_FILE)
protoc --proto_path=$(PROTO_DIR) --go-grpc_out=$(GO_OUT) $(PROTO_DIR)/$(PROTO_FILE)
@echo "Go code generated successfully."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, what @digitalentity contributed in #227 should mean we don't need this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you should be able to just have a deps for //core/lib:core_go_proto on the go_binary in web/ui-go/BUILD

@@ -0,0 +1,502 @@
// SPDX-License-Identifier: Apache-2.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is generated code, when switching to a Bazel-based BUILD, I suspect it's possible to avoid having this in git, based on #227 ?

@@ -0,0 +1,105 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

@@ -0,0 +1,16 @@
module github.com/enola-dev/enola/ui-go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm myself not yet familiar with https://github.com/bazelbuild/rules_go, but I suspect that with a Bazel file here, a go.mod may not be required at all anymore, because the dependencies will be declared in the (new, TBD) BUILD file? @digitalentity might know more about this...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teivah explained that while the build will work without go.mod, because of repositories.bzl, but (quote) "to add a new dependency and that it's visible from the IDE for example, I have to add it to the go.mod" ... UNLESS https://plugins.jetbrains.com/plugin/8609-bazel-for-intellij (based on https://docs.enola.dev/dev/ide/) helps with that, and makes this unnecessary?

@@ -0,0 +1,20 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above - I suspect that with a Bazel BUILD this go.sum may be able to be removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants