-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
?
web/ui-go/Makefile
Outdated
@@ -0,0 +1,19 @@ | |||
PROTO_DIR := ../../core/lib/src/main/java/dev/enola/core |
There was a problem hiding this comment.
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?
web/ui-go/Makefile
Outdated
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." |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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= |
There was a problem hiding this comment.
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?
A first iteration of the Go web server that cover the get entity endpoint.