-
Notifications
You must be signed in to change notification settings - Fork 45
[DO NOT MERGE] Generate nexus service definitions #245
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
Open
spkane31
wants to merge
12
commits into
master
Choose a base branch
from
spk/sys-nexus-endpoint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8bba99f
first iteration of generating
spkane31 c4d5172
merge conflicts
spkane31 7a3c4c5
getting latest changes
spkane31 5ad0608
broke code gen
spkane31 394ec17
generate code after a fix
spkane31 c23ae09
merge conflicts
spkane31 44a4399
removing
spkane31 f85b476
updating
spkane31 91c363e
update Makefile to clone from branch, regen for json files
spkane31 3fcacd3
update from main
spkane31 4f4f3c6
comments
spkane31 dfaebea
add todo
spkane31 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,13 +40,32 @@ update-proto-submodule: | |
| printf $(COLOR) "Update proto-submodule..." | ||
| git -c protocol.file.allow=always submodule update --init --force --remote $(PROTO_ROOT) | ||
|
|
||
| ##### Compile proto files for go ##### | ||
| grpc: http-api-docs go-grpc copy-helpers | ||
| NEXUS_SCHEMA_ROOT := $(PROTO_ROOT)/nexus | ||
| NEXUS_PROTO_OUT := workflowservice/v1/workflowservicenexus | ||
| NEXUS_JSON_OUT := workflowservice/v1/workflowservicenexus/json | ||
|
|
||
| # Only install helper when its source has changed | ||
| ##### Compile proto files for go ##### | ||
| grpc: http-api-docs go-grpc copy-helpers nexus-gen | ||
|
|
||
| nexus-gen: | ||
| printf $(COLOR) "Generate nexus service definitions..." | ||
| mkdir -p $(NEXUS_PROTO_OUT) $(NEXUS_JSON_OUT) | ||
| cd $(NEXUS_SCHEMA_ROOT) && nexus-rpc-gen \ | ||
| --lang go \ | ||
| --package workflowservicenexus \ | ||
| --out-file $(CURDIR)/$(NEXUS_PROTO_OUT)/service_nexus.pb.go \ | ||
| temporal-proto-models-nexusrpc.yaml | ||
| cd $(NEXUS_SCHEMA_ROOT) && nexus-rpc-gen \ | ||
| --lang go \ | ||
| --package json \ | ||
| --temporal-nexus-payload-codec-support \ | ||
| --out-file $(CURDIR)/$(NEXUS_JSON_OUT)/service_nexus.go \ | ||
| temporal-json-schema-models-nexusrpc.yaml | ||
|
|
||
| # Only install helpers when their source has changed | ||
| HELPER_FILES = $(shell find ./cmd/protoc-gen-go-helpers) | ||
| .go-helpers-installed: $(HELPER_FILES) | ||
| printf $(COLOR) "Installing protoc plugin" | ||
| printf $(COLOR) "Installing protoc-gen-go-helpers plugin" | ||
| @go install ./cmd/protoc-gen-go-helpers | ||
| @touch $@ | ||
|
|
||
|
|
@@ -104,12 +123,24 @@ gen-proto-desc: | |
| --output-descriptor=$(PROTO_OUT)/descriptor_set.pb | ||
|
|
||
| ##### Plugins & tools ##### | ||
| grpc-install: | ||
| grpc-install: nexus-rpc-gen-install | ||
| @printf $(COLOR) "Install/update grpc and plugins..." | ||
| @go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
| @go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
| @go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
| @go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest | ||
|
|
||
| NEXUS_RPC_GEN_CACHE := $(HOME)/.cache/nexus-rpc-gen | ||
|
|
||
| .PHONY: nexus-rpc-gen-install | ||
| nexus-rpc-gen-install: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would mark this as a PHONY target |
||
| # TODO seankane: install the src from CDN | ||
| @printf $(COLOR) "Install nexus-rpc-gen from GitHub branch (tconley-go-payload-codec-support)..." | ||
| @rm -rf $(NEXUS_RPC_GEN_CACHE) | ||
| @git clone --depth 1 --branch tconley-go-payload-codec-support https://github.com/nexus-rpc/nexus-rpc-gen.git $(NEXUS_RPC_GEN_CACHE) | ||
| @cd $(NEXUS_RPC_GEN_CACHE)/src && pnpm install && pnpm run build | ||
| @chmod +x $(NEXUS_RPC_GEN_CACHE)/src/packages/nexus-rpc-gen/dist/index.js | ||
| @cd $(NEXUS_RPC_GEN_CACHE)/src/packages/nexus-rpc-gen && pnpm link --global | ||
|
|
||
| mockgen-install: | ||
| printf $(COLOR) "Install/update mockgen..." | ||
| go install -modfile=build/go.mod github.com/golang/mock/mockgen | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks for removing the whitespace. The print was okay though. It's not all GRPC plugins. You can maybe change it to protoc plugins.