Skip to content

Commit

Permalink
feat(rpc): initial prototype for the v2 environments API
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Jan 23, 2025
1 parent 79520f6 commit f756210
Show file tree
Hide file tree
Showing 45 changed files with 7,162 additions and 18,375 deletions.
37 changes: 0 additions & 37 deletions buf.gen.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Generated by buf. DO NOT EDIT.
version: v2
deps:
- name: buf.build/gnostic/gnostic
commit: 087bc8072ce44e339f213209e4d57bf0
digest: b5:c4eebcd04bc2fdd5dd0b8d695eb419682a650b600cdb56ff2ed61208a24603e0eb1b8ae0d467925c69a24bde6d322f3c4112bd2b8efdd682d8c3128384cdac9a
- name: buf.build/googleapis/googleapis
commit: 8bc2c51e08c447cd8886cdea48a73e14
digest: b5:b7e0ac9d192bd0eae88160101269550281448c51f25121cd0d51957661a350aab07001bc145fe9029a8da10b99ff000ae5b284ecaca9c75f2a99604a04d9b4ab
- name: buf.build/grpc-ecosystem/grpc-gateway
commit: a48fcebcf8f140dd9d09359b9bb185a4
digest: b5:330af8a71b579ab96c4f3ee26929d1a68a5a9e986c7cfe0a898591fc514216bb6e723dc04c74d90fdee3f3f14f9100a54b4f079eb273e6e7213f0d5baca36ff8
3 changes: 0 additions & 3 deletions buf.work.yaml

This file was deleted.

15 changes: 12 additions & 3 deletions rpc/flipt/buf.yaml → buf.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
version: v1
name: buf.build/flipt-io/flipt
version: v2
modules:
- path: rpc/flipt
name: buf.build/flipt-io/flipt
- path: rpc/v2/environments
name: buf.build/flipt-io/environments
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
- buf.build/gnostic/gnostic

lint:
use:
- DEFAULT
except:
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
- FIELD_NOT_REQUIRED
- PACKAGE_DIRECTORY_MATCH
- PACKAGE_NO_IMPORT_CYCLE
- PACKAGE_VERSION_SUFFIX
- RPC_REQUEST_RESPONSE_UNIQUE
- RPC_REQUEST_STANDARD_NAME
- RPC_RESPONSE_STANDARD_NAME
- SERVICE_SUFFIX
disallow_comment_ignores: true
breaking:
use:
- FILE
except:
- EXTENSION_NO_DELETE
- FIELD_SAME_DEFAULT
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/flatbuffers v24.3.25+incompatible // indirect
github.com/google/gnostic v0.7.0 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/s2a-go v0.1.8 // indirect
Expand All @@ -186,6 +187,7 @@ require (
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand Down
1,310 changes: 1,310 additions & 0 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ use (
./errors
./internal/cmd/protoc-gen-go-flipt-sdk
./rpc/flipt
./rpc/v2/environments
./sdk/go
)
888 changes: 888 additions & 0 deletions go.work.sum

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,19 @@ func (g Go) Lint() error {
func (g Go) Proto() error {
mg.Deps(Bootstrap)
fmt.Println("Generating proto files...")
return sh.RunV("buf", "generate")
for _, module := range []string{
"rpc/flipt",
"rpc/v2/environments",
} {
cmd := exec.Command("buf", "generate")
cmd.Dir = module
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
}
return nil
}

// Runs the Go unit tests
Expand Down
2 changes: 1 addition & 1 deletion rpc/flipt/analytics/analytics.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rpc/flipt/audit/event.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rpc/flipt/auth/auth.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions rpc/flipt/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: v2
plugins:
- local: protoc-gen-go
out: .
opt:
- paths=source_relative
strategy: all
- local: protoc-gen-go-grpc
out: .
opt: paths=source_relative
strategy: all
- local: protoc-gen-grpc-gateway
out: .
opt:
- paths=source_relative
- grpc_api_configuration=flipt.yaml
strategy: all
- local: protoc-gen-go-flipt-sdk
out: ../../sdk/go
opt:
- paths=source_relative
- grpc_api_configuration=flipt.yaml
strategy: all
18 changes: 0 additions & 18 deletions rpc/flipt/buf.lock

This file was deleted.

Loading

0 comments on commit f756210

Please sign in to comment.