Skip to content

Commit

Permalink
chore: send source url and commit sha in create Schema RPC (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: gagan.dhand <[email protected]>
  • Loading branch information
gdgagan696 and gdgagangeek authored Jul 2, 2024
1 parent 06a4a19 commit 3e0923b
Show file tree
Hide file tree
Showing 5 changed files with 556 additions and 498 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME="github.com/goto/stencil"
VERSION=$(shell git describe --always --tags 2>/dev/null)
PROTON_COMMIT := "6bc4e5b240f0fd8a2dab4696c570a9c9a6a692ec"
PROTON_COMMIT := "4fb568dd9af09c7efeac3e60fc3a999e239d419a"
EXCLUDE_FILES :=./test_utils/testutils.go
.PHONY: all build test clean dist vet proto install ui

Expand Down
8 changes: 6 additions & 2 deletions internal/api/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ func schemaToProto(s schema.Schema) *stencilv1beta1.Schema {
}

func (a *API) CreateSchema(ctx context.Context, in *stencilv1beta1.CreateSchemaRequest) (*stencilv1beta1.CreateSchemaResponse, error) {
metadata := &schema.Metadata{Format: in.GetFormat().String(), Compatibility: in.GetCompatibility().String()}
sc, err := a.schema.Create(ctx, in.NamespaceId, in.SchemaId, metadata, in.GetData(), "")
metadata := &schema.Metadata{
Format: in.GetFormat().String(),
Compatibility: in.GetCompatibility().String(),
SourceURL: in.GetSourceUrl(),
}
sc, err := a.schema.Create(ctx, in.NamespaceId, in.SchemaId, metadata, in.GetData(), in.GetCommitSha())
return &stencilv1beta1.CreateSchemaResponse{
Version: sc.Version,
Id: sc.ID,
Expand Down
8 changes: 7 additions & 1 deletion proto/gotocompany/apidocs.swagger.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"title": "gotocompany/stencil/v1beta1/stencil.proto"
"title": "gotocompany/stencil/v1beta1/stencil.proto",
"version": "0.1.4"
},
"tags": [
Expand Down Expand Up @@ -553,6 +553,9 @@
"updatedAt": {
"type": "string",
"format": "date-time"
},
"sourceUrl": {
"type": "string"
}
}
},
Expand Down Expand Up @@ -667,6 +670,9 @@
"updatedAt": {
"type": "string",
"format": "date-time"
},
"sourceUrl": {
"type": "string"
}
}
},
Expand Down
Loading

0 comments on commit 3e0923b

Please sign in to comment.