Skip to content

Commit 9360a68

Browse files
enhancement: added version to grpc api
1 parent 7f7e64d commit 9360a68

File tree

20 files changed

+76
-2081
lines changed

20 files changed

+76
-2081
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ To contribute code.
2727
## Regenerate the gRPC code from .proto files
2828
- Install below packages to regenerate the gRPC code.
2929
```shell
30-
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
31-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
30+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
31+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
3232
```
3333
- Update below statement in ~/.zshrc or ~/.bashrc depending on the shell you are using.
3434
```shell

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
proto:
2+
if [ -d "gen/api/v1" ]; then rm -rf gen/api/v1; fi && mkdir -p ./gen && protoc --go_out=./gen --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative --go-grpc_out=./gen api/v1/*.proto

api/v1/project.proto

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ service ProjectService {
99
}
1010

1111
message GenerateCodeRequest {
12-
string projectName = 1;
13-
string projectJSON = 2;
14-
string gitRepositoryName = 3;
15-
string gitPlatformName = 4;
16-
string gitPlatformURL = 5;
17-
string gitPlatformUserName = 6;
18-
string projectMetadata = 7;
12+
string projectVersion = 1;
13+
string projectName = 2;
14+
string projectJSON = 3;
15+
string gitRepositoryName = 4;
16+
string gitPlatformName = 5;
17+
string gitPlatformURL = 6;
18+
string gitPlatformUserName = 7;
19+
string projectMetadata = 8;
1920
}
2021

2122
message GenerateCodeResponse{

gen/api/v1/project.pb.go

Lines changed: 58 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/api/v1/project_grpc.pb.go

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module github.com/intelops/compage
33
go 1.22
44

55
require (
6-
github.com/Masterminds/semver/v3 v3.2.1
76
github.com/gertd/go-pluralize v0.2.1
87
github.com/go-git/go-git/v5 v5.11.0
98
github.com/iancoleman/strcase v0.3.0

go.sum

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
22
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
3-
github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
4-
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
53
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
64
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
75
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
@@ -161,8 +159,6 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz
161159
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
162160
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
163161
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
164-
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ=
165-
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
166162
golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw=
167163
golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
168164
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -221,12 +217,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
221217
golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw=
222218
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=
223219
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
224-
google.golang.org/genproto/googleapis/api v0.0.0-20240311173647-c811ad7063a7 h1:oqta3O3AnlWbmIE3bFnWbu4bRxZjfbWCp0cKSuZh01E=
225-
google.golang.org/genproto/googleapis/api v0.0.0-20240311173647-c811ad7063a7/go.mod h1:VQW3tUculP/D4B+xVCo+VgSq8As6wA9ZjHl//pmk+6s=
226220
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c h1:kaI7oewGK5YnVwj+Y+EJBO/YN1ht8iTL9XkFHtVZLsc=
227221
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c/go.mod h1:VQW3tUculP/D4B+xVCo+VgSq8As6wA9ZjHl//pmk+6s=
228-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 h1:8EeVk1VKMD+GD/neyEHGmz7pFblqPjHoi+PGQIlLx2s=
229-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
230222
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c h1:lfpJ/2rWPa/kJgxyyXM8PrNnfCzcmxJ265mADgwmvLI=
231223
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
232224
google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=

internal/converter/grpc/converter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func GetProject(input *project.GenerateCodeRequest) (*core.Project, error) {
2020
CompageJSON: compageJSON,
2121
Name: input.ProjectName,
2222
// latest is the tag for every ui based request
23-
Version: "latest",
23+
Version: input.ProjectVersion,
2424
GitRepositoryName: input.GitRepositoryName,
2525
GitPlatformUserName: input.GitPlatformUserName,
2626
GitPlatformURL: input.GitPlatformURL,

vendor/github.com/Masterminds/semver/v3/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

vendor/github.com/Masterminds/semver/v3/.golangci.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)