From 66f355bd61e6f308fc567f0c327bab23a0df852a Mon Sep 17 00:00:00 2001 From: Zhenghui Wang Date: Tue, 25 Jul 2017 12:39:27 -0700 Subject: [PATCH 1/3] code complete --- backend/repository/config.go | 2 +- .../data/gateway_config_expected.json | 19 --- backend/repository/idl_registry.go | 147 ++++++++++++++++++ backend/repository/idl_registry_test.go | 113 ++++++++++++++ .../idl-registry/idl/clients/baz/base.thrift | 11 ++ .../idl-registry/idl/clients/baz/baz.thrift | 115 ++++++++++++++ .../idl/clients/googlenow/googlenow.thrift | 23 +++ .../idl-registry/idl/endpoints/baz/baz.thrift | 76 +++++++++ .../idl/endpoints/googlenow/googlenow.thrift | 23 +++ examples/idl-registry/meta.json | 29 ++++ 10 files changed, 538 insertions(+), 20 deletions(-) create mode 100644 backend/repository/idl_registry.go create mode 100644 backend/repository/idl_registry_test.go create mode 100644 examples/idl-registry/idl/clients/baz/base.thrift create mode 100644 examples/idl-registry/idl/clients/baz/baz.thrift create mode 100644 examples/idl-registry/idl/clients/googlenow/googlenow.thrift create mode 100644 examples/idl-registry/idl/endpoints/baz/baz.thrift create mode 100644 examples/idl-registry/idl/endpoints/googlenow/googlenow.thrift create mode 100644 examples/idl-registry/meta.json diff --git a/backend/repository/config.go b/backend/repository/config.go index 088efd0f3..75f988a6a 100644 --- a/backend/repository/config.go +++ b/backend/repository/config.go @@ -60,7 +60,7 @@ type EndpointConfig struct { Type ProtocolType `json:"endpointType"` HandleID string `json:"handleId"` ThriftFile string `json:"thriftFile"` - ThriftFileSha string `json:"thriftFileSha",omitempty` + ThriftFileSha string `json:"thriftFileSha,omitempty"` ThriftMethodName string `json:"thriftMethodName"` WorkflowType string `json:"workflowType"` ClientID string `json:"clientID"` diff --git a/backend/repository/data/gateway_config_expected.json b/backend/repository/data/gateway_config_expected.json index 539aba522..6e8c46e05 100755 --- a/backend/repository/data/gateway_config_expected.json +++ b/backend/repository/data/gateway_config_expected.json @@ -16,7 +16,6 @@ "endpointType": "http", "handleId": "argNotStruct", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::argNotStruct", "workflowType": "httpClient", "clientID": "bar", @@ -31,7 +30,6 @@ "endpointType": "http", "handleId": "argWithHeaders", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::argWithHeaders", "workflowType": "httpClient", "clientID": "bar", @@ -46,7 +44,6 @@ "endpointType": "http", "handleId": "argWithManyQueryParams", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::argWithManyQueryParams", "workflowType": "httpClient", "clientID": "bar", @@ -61,7 +58,6 @@ "endpointType": "http", "handleId": "argWithNestedQueryParams", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::argWithNestedQueryParams", "workflowType": "httpClient", "clientID": "bar", @@ -76,7 +72,6 @@ "endpointType": "http", "handleId": "argWithParams", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::argWithParams", "workflowType": "httpClient", "clientID": "bar", @@ -91,7 +86,6 @@ "endpointType": "http", "handleId": "argWithQueryHeader", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::argWithQueryHeader", "workflowType": "httpClient", "clientID": "bar", @@ -106,7 +100,6 @@ "endpointType": "http", "handleId": "argWithQueryParams", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::argWithQueryParams", "workflowType": "httpClient", "clientID": "bar", @@ -121,7 +114,6 @@ "endpointType": "http", "handleId": "missingArg", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::missingArg", "workflowType": "httpClient", "clientID": "bar", @@ -136,7 +128,6 @@ "endpointType": "http", "handleId": "noRequest", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::noRequest", "workflowType": "httpClient", "clientID": "bar", @@ -151,7 +142,6 @@ "endpointType": "http", "handleId": "normal", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::normal", "workflowType": "httpClient", "clientID": "bar", @@ -166,7 +156,6 @@ "endpointType": "http", "handleId": "tooManyArgs", "thriftFile": "endpoints/bar/bar.thrift", - "thriftFileSha": "", "thriftMethodName": "Bar::tooManyArgs", "workflowType": "httpClient", "clientID": "bar", @@ -181,7 +170,6 @@ "endpointType": "http", "handleId": "call", "thriftFile": "endpoints/baz/baz.thrift", - "thriftFileSha": "", "thriftMethodName": "SimpleService::call", "workflowType": "tchannelClient", "clientID": "baz", @@ -196,7 +184,6 @@ "endpointType": "http", "handleId": "compare", "thriftFile": "endpoints/baz/baz.thrift", - "thriftFileSha": "", "thriftMethodName": "SimpleService::compare", "workflowType": "tchannelClient", "clientID": "baz", @@ -211,7 +198,6 @@ "endpointType": "http", "handleId": "ping", "thriftFile": "endpoints/baz/baz.thrift", - "thriftFileSha": "", "thriftMethodName": "SimpleService::ping", "workflowType": "tchannelClient", "clientID": "baz", @@ -226,7 +212,6 @@ "endpointType": "http", "handleId": "sillyNoop", "thriftFile": "endpoints/baz/baz.thrift", - "thriftFileSha": "", "thriftMethodName": "SimpleService::sillyNoop", "workflowType": "tchannelClient", "clientID": "baz", @@ -241,7 +226,6 @@ "endpointType": "tchannel", "handleId": "call", "thriftFile": "endpoints/tchannel/baz/baz.thrift", - "thriftFileSha": "", "thriftMethodName": "SimpleService::Call", "workflowType": "custom", "clientID": "", @@ -256,7 +240,6 @@ "endpointType": "http", "handleId": "saveContacts", "thriftFile": "endpoints/contacts/contacts.thrift", - "thriftFileSha": "", "thriftMethodName": "Contacts::saveContacts", "workflowType": "custom", "clientID": "", @@ -271,7 +254,6 @@ "endpointType": "http", "handleId": "addCredentials", "thriftFile": "endpoints/googlenow/googlenow.thrift", - "thriftFileSha": "", "thriftMethodName": "GoogleNow::addCredentials", "workflowType": "httpClient", "clientID": "google-now", @@ -286,7 +268,6 @@ "endpointType": "http", "handleId": "checkCredentials", "thriftFile": "endpoints/googlenow/googlenow.thrift", - "thriftFileSha": "", "thriftMethodName": "GoogleNow::checkCredentials", "workflowType": "httpClient", "clientID": "google-now", diff --git a/backend/repository/idl_registry.go b/backend/repository/idl_registry.go new file mode 100644 index 000000000..eaa6d28ac --- /dev/null +++ b/backend/repository/idl_registry.go @@ -0,0 +1,147 @@ +// Copyright (c) 2017 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package repository + +import ( + "io/ioutil" + "path/filepath" + "sync" + + "github.com/pkg/errors" +) + +// IDLRegistry provides the content and version of a thrift file. +type IDLRegistry interface { + // RootDir returns the path of the root directory for the registry. + RootDir() string + // ThriftRootDir returns the relative path of the thrift root directory. + ThriftRootDir() string + // Updates the IDLRegistry to sync with remote source. + Update() error + // Returns the file version or content of a thrift file. + ThriftMeta(path string, needFileContent bool) (*ThriftMeta, error) +} + +type idlRegistry struct { + idlDir string + repo *Repository + // Map from thrift file to its meta, which is updated when underlying Repository being updated. + metaMap map[string]*ThriftMeta + // Lock for metaMap. + lock sync.RWMutex +} + +const metaJSONFile = "meta.json" + +// NewIDLRegistry assumes all thrift files are located under the dir of +// relative path `idlDirRel` of a single repository and there is a +// meta.json file containing all version information of thrift files. +func NewIDLRegistry(idlDirRel string, repo *Repository) (IDLRegistry, error) { + newMap, err := allFileMeta(filepath.Join(repo.LocalDir(), metaJSONFile)) + if err != nil { + return nil, err + } + return &idlRegistry{ + idlDir: idlDirRel, + repo: repo, + metaMap: newMap, + }, nil +} + +// RootDir returns the path of the root directory for the registry. +func (reg *idlRegistry) RootDir() string { + return reg.repo.LocalDir() +} + +// ThriftRootDir returns the relative path of the thrift root directory. +func (reg *idlRegistry) ThriftRootDir() string { + return reg.idlDir +} + +// IDLRegistryFile returns the content and meta data of a file in IDL-registry. +func (reg *idlRegistry) ThriftMeta(path string, needFileContent bool) (*ThriftMeta, error) { + if err := reg.Update(); err != nil { + return nil, err + } + reg.lock.RLock() + defer reg.lock.RUnlock() + meta, ok := reg.metaMap[path] + if !ok { + return nil, errors.Errorf("failed to find file %q", path) + } + if !needFileContent { + return meta, nil + } + file := filepath.Join(reg.repo.LocalDir(), reg.idlDir, path) + content, err := ioutil.ReadFile(file) + if err != nil { + return nil, errors.Wrapf(err, "faile to read thrift file content %q", path) + } + return &ThriftMeta{ + Path: path, + Version: meta.Version, + Content: string(content), + }, nil +} + +// Types used to parse meta.json file under idlRegistry repository. +type idlMetaJSON struct { + // Remote name -> Remote meta. + Remotes map[string]remoteMeta `json:"remotes"` +} + +type remoteMeta struct { + // File subpath -> SHASureg. + SHASums map[string]string `json:"shasums"` +} + +func allFileMeta(metaJSONPath string) (map[string]*ThriftMeta, error) { + var metaJSONContent idlMetaJSON + if err := readJSONFile(metaJSONPath, &metaJSONContent); err != nil { + return nil, errors.Wrap(err, "failed to read meta.json of IDL registry") + } + meta := make(map[string]*ThriftMeta, len(metaJSONContent.Remotes)) + for remote, rMeta := range metaJSONContent.Remotes { + for subpath, sha := range rMeta.SHASums { + path := filepath.Join(remote, subpath) + meta[path] = &ThriftMeta{ + Path: path, + Version: sha, + } + } + } + return meta, nil +} + +// Update updates the repository. +func (reg *idlRegistry) Update() error { + if !reg.repo.Update() { + return nil + } + newMap, err := allFileMeta(filepath.Join(reg.repo.LocalDir(), metaJSONFile)) + if err != nil { + return err + } + reg.lock.Lock() + defer reg.lock.Unlock() + reg.metaMap = newMap + return nil +} diff --git a/backend/repository/idl_registry_test.go b/backend/repository/idl_registry_test.go new file mode 100644 index 000000000..d64e1ad2b --- /dev/null +++ b/backend/repository/idl_registry_test.go @@ -0,0 +1,113 @@ +// Copyright (c) 2017 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package repository + +import ( + "io/ioutil" + "os" + "path/filepath" + "testing" + "time" + + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" +) + +const exampleRegistry = "../../examples/idl-registry" + +func TestIDLRegsitry(t *testing.T) { + reg, err := NewTempIDLRegistry() + if !assert.NoError(t, err, "Failed to create temp IDL registry.") { + return + } + assert.NotEmpty(t, reg.RootDir(), "RootDir should not be empty.") + assert.Equal(t, "idl", reg.ThriftRootDir(), "Thrift root is mismatched.") + assert.NoError(t, reg.Update(), "Update should not return error.") + + thriftPath := "clients/baz/baz.thrift" + meta, err := reg.ThriftMeta(thriftPath, true) + if !assert.NoError(t, err, "Failed to get thrift meta.") { + return + } + assert.Equal(t, "e0729d2985ec0aeb95891cba969f1fadecedb648", meta.Version, "Thrift version mismatched.") + assert.Equal(t, thriftPath, meta.Path) + assert.NotEmpty(t, meta.Content, "Thrift content should not be empty.") + + goldenFile := filepath.Join(exampleGateway, "idl", thriftPath) + b, err := ioutil.ReadFile(goldenFile) + if !assert.NoError(t, err, "Failed to read goldenFile.") { + return + } + assert.Equal(t, string(b), meta.Content, "Thrift file content mismatched.") + + thriftPath = "clients/baz/baz.thrift" + meta, err = reg.ThriftMeta(thriftPath, false) + if !assert.NoError(t, err, "Failed to get thrift meta.") { + return + } + assert.Equal(t, "e0729d2985ec0aeb95891cba969f1fadecedb648", meta.Version, "Thrift version mismatched.") + assert.Equal(t, thriftPath, meta.Path) + assert.Empty(t, meta.Content, "Thrift content should be empty.") +} + +func NewTempIDLRegistry() (IDLRegistry, error) { + rf := ®istryFetcher{ + remote: "local-idl-registry", + } + r, err := NewRepository("", rf.remote, rf, -1*time.Second) + if err != nil { + return nil, err + } + return NewIDLRegistry("idl", r) +} + +type registryFetcher struct { + remote string +} + +func (rf *registryFetcher) Clone(localRoot, remote string) (string, error) { + if remote != rf.remote { + return "", errors.Errorf("remote is expected to be %q but got %q", rf.remote, remote) + } + + tempDir, err := ioutil.TempDir(localRoot, "zanzibar") + if err != nil { + return "", err + } + tempRegistry := filepath.Join(tempDir, "examples", "idl-registry") + if err := os.MkdirAll(tempRegistry, os.ModePerm); err != nil { + return "", err + } + + err = copyDir(exampleRegistry, tempRegistry, []string{}) + if err != nil { + return "", err + } + return tempRegistry, nil +} + +func (rf *registryFetcher) Update(localDir, remote string) (bool, error) { + return true, nil +} + +func (rf *registryFetcher) Version(localDir string) (string, error) { + return time.Now().String(), nil +} diff --git a/examples/idl-registry/idl/clients/baz/base.thrift b/examples/idl-registry/idl/clients/baz/base.thrift new file mode 100644 index 000000000..2b4d31986 --- /dev/null +++ b/examples/idl-registry/idl/clients/baz/base.thrift @@ -0,0 +1,11 @@ +namespace java com.uber.zanzibar.clients.baz + +typedef string UUID + +struct BazResponse { + 1: required string message +} + +exception ServerErr { + 1: required string message +} diff --git a/examples/idl-registry/idl/clients/baz/baz.thrift b/examples/idl-registry/idl/clients/baz/baz.thrift new file mode 100644 index 000000000..d0e9b3da4 --- /dev/null +++ b/examples/idl-registry/idl/clients/baz/baz.thrift @@ -0,0 +1,115 @@ +namespace java com.uber.zanzibar.clients.baz +include "base.thrift" + +enum Fruit { + APPLE, + BANANA +} + +struct BazRequest { + 1: required bool b1 + 2: required string s2 + 3: required i32 i3 +} + +exception AuthErr { + 1: required string message +} + +exception OtherAuthErr { + 1: required string message +} + +service SimpleService { + base.BazResponse compare( + 1: required BazRequest arg1 + 2: required BazRequest arg2 + ) throws ( + 1: AuthErr authErr + 2: OtherAuthErr otherAuthErr + ) + + void call( + 1: required BazRequest arg + ) throws ( + 1: AuthErr authErr + ) ( + zanzibar.http.reqHeaders = "x-uuid,x-token" + zanzibar.http.resHeaders = "some-res-header" + ) + + base.BazResponse ping() () + + void sillyNoop() throws ( + 1: AuthErr authErr + 2: base.ServerErr serverErr + ) +} + +service SecondService { + i8 echoI8 ( + 1: required i8 arg + ) + + i16 echoI16( + 1: required i16 arg + ) + + i32 echoI32( + 1: required i32 arg + ) + + i64 echoI64( + 1: required i64 arg + ) + + double echoDouble( + 1: required double arg + ) + + bool echoBool ( + 1: required bool arg + ) + + binary echoBinary ( + 1: required binary arg + ) + + string echoString( + 1: required string arg + ) + + Fruit echoEnum ( + 1: required Fruit arg = Fruit.APPLE + ) + + base.UUID echoTypedef( + 1: required base.UUID arg + ) + + set echoStringSet( + 1: required set arg + ) + + // value is unhashable + set echoStructSet( + 1: required set arg + ) + + list echoStringList ( + 1: required list arg + ) + + list echoStructList ( + 1: required list arg + ) + + map echoStringMap ( + 1: required map arg + ) + + // key is unhashable + map echoStructMap ( + 1: required map arg + ) +} diff --git a/examples/idl-registry/idl/clients/googlenow/googlenow.thrift b/examples/idl-registry/idl/clients/googlenow/googlenow.thrift new file mode 100644 index 000000000..ac6f22479 --- /dev/null +++ b/examples/idl-registry/idl/clients/googlenow/googlenow.thrift @@ -0,0 +1,23 @@ +namespace java com.googlenow + +// Service specification for generating Google Now client. +service GoogleNowService { + void addCredentials( + 1: required string authCode + ) ( // can throws exceptions here for non 2XX response + zanzibar.http.method = "POST" + zanzibar.http.path = "/add-credentials" + zanzibar.http.status = "202" + zanzibar.http.reqHeaders = "x-uuid" + zanzibar.http.resHeaders = "x-uuid" + ) + void checkCredentials( + ) ( + zanzibar.http.method = "POST" + zanzibar.http.path = "/check-credentials" + zanzibar.http.status = "202" + // comma sparated list for required headers + zanzibar.http.reqHeaders = "x-uuid" + zanzibar.http.resHeaders = "x-uuid" + ) +} diff --git a/examples/idl-registry/idl/endpoints/baz/baz.thrift b/examples/idl-registry/idl/endpoints/baz/baz.thrift new file mode 100644 index 000000000..78acaed05 --- /dev/null +++ b/examples/idl-registry/idl/endpoints/baz/baz.thrift @@ -0,0 +1,76 @@ +namespace java com.uber.zanzibar.clients.baz + +struct BazRequest { + 1: required bool b1 + 2: required string s2 + 3: required i32 i3 +} + +struct BazResponse { + 1: required string message +} + +exception AuthErr { + 1: required string message +} + +exception OtherAuthErr { + 1: required string message +} + +exception ServerErr { + 1: required string message +} + +service SimpleService { + // have both request body and response body + BazResponse compare( + 1: required BazRequest arg1 + 2: required BazRequest arg2 + ) throws ( + 1: AuthErr authErr (zanzibar.http.status = "403") + 2: OtherAuthErr otherAuthErr (zanzibar.http.status = "403") + ) ( + zanzibar.http.status = "200" + zanzibar.http.method = "POST" + zanzibar.http.path = "/baz/compare" + zanzibar.handler = "baz.compare" + ) + + // no response body + void call( + 1: required BazRequest arg + ) throws ( + 1: AuthErr authErr (zanzibar.http.status = "403") + ) ( + zanzibar.http.status = "204" + zanzibar.http.method = "POST" + zanzibar.http.path = "/baz/call" + zanzibar.handler = "baz.call" + zanzibar.http.reqHeaders = "x-uuid,x-token" + zanzibar.http.resHeaders = "some-res-header" + ) + + // no request body + BazResponse ping() ( + zanzibar.http.status = "200" + zanzibar.http.method = "GET" + zanzibar.http.path = "/baz/ping" + zanzibar.handler = "baz.multiArgs" + ) + + // neither request body nor response body + void sillyNoop() throws ( + 1: AuthErr authErr (zanzibar.http.status = "403") + 2: ServerErr serverErr (zanzibar.http.status = "500") + ) ( + zanzibar.http.status = "204" + zanzibar.http.method = "GET" + zanzibar.http.path = "/baz/silly-noop" + zanzibar.handler = "baz.sillyNoop" + ) +} + +// service SecondService { +// string Echo(1: string arg) +// } diff --git a/examples/idl-registry/idl/endpoints/googlenow/googlenow.thrift b/examples/idl-registry/idl/endpoints/googlenow/googlenow.thrift new file mode 100644 index 000000000..3b0332ebd --- /dev/null +++ b/examples/idl-registry/idl/endpoints/googlenow/googlenow.thrift @@ -0,0 +1,23 @@ +namespace java com.uber.zanzibar.clients.googlenow + +// Service specification for generating Google Now client. +service GoogleNow { + void addCredentials( + 1: required string authCode + ) ( // can throws exceptions here for non 2XX response + zanzibar.http.method = "POST" + zanzibar.http.path = "/googlenow/add-credentials" + zanzibar.http.status = "202" + zanzibar.http.reqHeaders = "x-uuid,x-token" + zanzibar.http.resHeaders = "x-uuid" + ) + void checkCredentials( + ) ( + zanzibar.http.method = "POST" + zanzibar.http.path = "/googlenow/check-credentials" + zanzibar.http.status = "202" + // comma sparated list for required headers + zanzibar.http.reqHeaders = "x-uuid,x-token" + zanzibar.http.resHeaders = "x-uuid" + ) +} diff --git a/examples/idl-registry/meta.json b/examples/idl-registry/meta.json new file mode 100644 index 000000000..22f694f42 --- /dev/null +++ b/examples/idl-registry/meta.json @@ -0,0 +1,29 @@ +{ + "remotes": { + "clients/baz": { + "shasums": { + "bases.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648", + "baz.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648" + }, + "time": 1489436705663, + "version": 1489436705663 + }, + "clients/googlenow": { + "shasums": { + "googlenow.thrift": "815ae46357b5712b51e2499e7c1eb7c09c34d5f1" + }, + "time": 1495129645880, + "version": 1495129645880 + }, + "endpoints": { + "shasums": { + "baz/baz.thrift": "v2", + "googlenow/googlenow.thrift": "v2" + }, + "time": 1495129645880, + "version": 1495129645889 + } + }, + "time": "2017-07-22T19:08:01.377Z", + "version": 1495480081377 +} \ No newline at end of file From efddf60666a4cb80aebd2aa1d0097f88de60fe81 Mon Sep 17 00:00:00 2001 From: Zhenghui Wang Date: Tue, 25 Jul 2017 12:57:54 -0700 Subject: [PATCH 2/3] lint json --- examples/idl-registry/meta.json | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/examples/idl-registry/meta.json b/examples/idl-registry/meta.json index 22f694f42..19fc4bb16 100644 --- a/examples/idl-registry/meta.json +++ b/examples/idl-registry/meta.json @@ -1,29 +1,29 @@ { "remotes": { - "clients/baz": { - "shasums": { - "bases.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648", - "baz.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648" - }, - "time": 1489436705663, - "version": 1489436705663 - }, - "clients/googlenow": { - "shasums": { - "googlenow.thrift": "815ae46357b5712b51e2499e7c1eb7c09c34d5f1" - }, - "time": 1495129645880, - "version": 1495129645880 - }, - "endpoints": { - "shasums": { - "baz/baz.thrift": "v2", - "googlenow/googlenow.thrift": "v2" - }, - "time": 1495129645880, - "version": 1495129645889 - } - }, - "time": "2017-07-22T19:08:01.377Z", - "version": 1495480081377 -} \ No newline at end of file + "clients/baz": { + "shasums": { + "bases.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648", + "baz.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648" + }, + "time": 1489436705663, + "version": 1489436705663 + }, + "clients/googlenow": { + "shasums": { + "googlenow.thrift": "815ae46357b5712b51e2499e7c1eb7c09c34d5f1" + }, + "time": 1495129645880, + "version": 1495129645880 + }, + "endpoints": { + "shasums": { + "baz/baz.thrift": "v2", + "googlenow/googlenow.thrift": "v2" + }, + "time": 1495129645880, + "version": 1495129645889 + } + }, + "time": "2017-07-22T19:08:01.377Z", + "version": 1495480081377 +} From 4669d3b4798b233e56b60dc3afc413b1931a2780 Mon Sep 17 00:00:00 2001 From: Zhenghui Wang Date: Wed, 26 Jul 2017 11:57:58 -0700 Subject: [PATCH 3/3] fix file name --- examples/idl-registry/meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/idl-registry/meta.json b/examples/idl-registry/meta.json index 19fc4bb16..d26a377a9 100644 --- a/examples/idl-registry/meta.json +++ b/examples/idl-registry/meta.json @@ -2,7 +2,7 @@ "remotes": { "clients/baz": { "shasums": { - "bases.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648", + "base.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648", "baz.thrift": "e0729d2985ec0aeb95891cba969f1fadecedb648" }, "time": 1489436705663,