-
Notifications
You must be signed in to change notification settings - Fork 24
feat(stencil): add stencil protos #36
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8aff255
feat(stencil): add stencil protos
h4rikris 9f8a2d9
refactor: change rpc method names
h4rikris 907f159
refactor(stencil): modify package name and rpc methods
h4rikris c67556d
refactor(stencil): create rules enum
h4rikris a3930a0
refactor(stencil): add checks type to have skiprules
h4rikris 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 |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| syntax = "proto3"; | ||
| package odpf.stencil.v1; | ||
|
|
||
| import "google/api/annotations.proto"; | ||
| import "google/api/field_behavior.proto"; | ||
| import "google/protobuf/descriptor.proto"; | ||
| import "protoc-gen-openapiv2/options/annotations.proto"; | ||
|
|
||
|
|
||
| option go_package = "github.com/odpf/proton/stencil/v1;stencilv1"; | ||
|
|
||
| // These annotations are used when generating the OpenAPI file. | ||
| option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { | ||
| info: { | ||
| version: "0.1.4"; | ||
| }; | ||
| schemes: HTTP; | ||
| }; | ||
|
|
||
| service StencilService { | ||
| rpc UploadDescriptor (UploadDescriptorRequest) returns (UploadDescriptorResponse) { | ||
| option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { | ||
| consumes: "multipart/form-data"; | ||
| produces: "application/json"; | ||
| }; | ||
| } | ||
| rpc DownloadDescriptor (DownloadDescriptorRequest) returns (DownloadDescriptorResponse) { | ||
| option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { | ||
| produces: "application/octet-stream"; | ||
| }; | ||
| } | ||
| rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { | ||
| option (google.api.http) = { | ||
| get: "/v1/snapshots" | ||
| }; | ||
| } | ||
| // PromoteSnapshot promotes particular snapshot version as latest | ||
| rpc PromoteSnapshot(PromoteSnapshotRequest) returns (PromoteSnapshotResponse) { | ||
| option (google.api.http) = { | ||
| patch: "/v1/snapshots/{id}/promote" | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| enum Rule { | ||
| UNKNOWN = 0; | ||
| FILE_NO_BREAKING_CHANGE = 1; | ||
| MESSAGE_NO_DELETE = 2; | ||
| FIELD_NO_BREAKING_CHANGE = 3; | ||
| ENUM_NO_BREAKING_CHANGE = 4; | ||
| } | ||
|
|
||
| message Snapshot { | ||
| int64 id = 1; | ||
| string namespace = 2 [(google.api.field_behavior) = REQUIRED]; | ||
| string name = 3; | ||
| string version = 4; | ||
| bool latest = 5; | ||
| } | ||
|
|
||
| message DownloadDescriptorRequest { | ||
| string namespace = 1 [(google.api.field_behavior) = REQUIRED]; | ||
| string name = 2 [(google.api.field_behavior) = REQUIRED]; | ||
| string version = 3 [(google.api.field_behavior) = REQUIRED]; | ||
| repeated string fullnames = 4; | ||
| } | ||
|
|
||
| message DownloadDescriptorResponse { | ||
| bytes data = 1; | ||
| } | ||
|
|
||
| message UploadDescriptorRequest { | ||
| string namespace = 1 [(google.api.field_behavior) = REQUIRED]; | ||
| string name = 2 [(google.api.field_behavior) = REQUIRED]; | ||
| string version = 3 [(google.api.field_behavior) = REQUIRED]; | ||
| bytes data = 4 [(google.api.field_behavior) = REQUIRED]; | ||
| bool latest = 5; | ||
| bool dryrun = 6; | ||
| Checks checks = 7; | ||
| } | ||
|
|
||
| message Checks { | ||
| repeated Rule except = 2; | ||
| } | ||
|
|
||
| message UploadDescriptorResponse { | ||
| bool success = 1; | ||
| bool dryrun = 2; | ||
| string errors = 3; | ||
| } | ||
|
|
||
| message ListSnapshotsResponse { | ||
| repeated Snapshot snapshots = 1; | ||
| } | ||
|
|
||
| message ListSnapshotsRequest { | ||
| string namespace = 1; | ||
| string name = 2; | ||
| string version = 3; | ||
| bool latest = 4; | ||
| } | ||
|
|
||
| message PromoteSnapshotRequest { | ||
rohilsurana marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| int64 id = 1; | ||
| } | ||
|
|
||
| message PromoteSnapshotResponse { | ||
| Snapshot snapshot = 1; | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.