-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: remove unnecessary field in grpc proto * docs: update docs * chore: fix docs * chore: fix docs * chore: update proto * chore: increase coverage * fix(compass): apply some suggested changes
- Loading branch information
Showing
33 changed files
with
3,043 additions
and
2,938 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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,46 @@ | ||
package asset | ||
|
||
import "testing" | ||
|
||
func TestTypeString(t *testing.T) { | ||
stringVal := TypeDashboard.String() | ||
if stringVal != "dashboard" { | ||
t.Fatalf("type dashboard converted to %s instead of 'dashboard'", stringVal) | ||
} | ||
stringVal = TypeJob.String() | ||
if stringVal != "job" { | ||
t.Fatalf("type job converted to %s instead of 'job'", stringVal) | ||
} | ||
stringVal = TypeTable.String() | ||
if stringVal != "table" { | ||
t.Fatalf("type table converted to %s instead of 'table'", stringVal) | ||
} | ||
stringVal = TypeTopic.String() | ||
if stringVal != "topic" { | ||
t.Fatalf("type topic converted to %s instead of 'topic'", stringVal) | ||
} | ||
} | ||
|
||
func TestTypeIsValid(t *testing.T) { | ||
aType := Type("dashboard") | ||
if !aType.IsValid() { | ||
t.Fatalf("type %s is not valid", aType) | ||
} | ||
aType = Type("job") | ||
if !aType.IsValid() { | ||
t.Fatalf("type %s is not valid", aType) | ||
} | ||
aType = Type("table") | ||
if !aType.IsValid() { | ||
t.Fatalf("type %s is not valid", aType) | ||
} | ||
aType = Type("topic") | ||
if !aType.IsValid() { | ||
t.Fatalf("type %s is not valid", aType) | ||
} | ||
|
||
aType = Type("random") | ||
if aType.IsValid() { | ||
t.Fatalf("type %s should not be valid", aType) | ||
} | ||
} |
This file contains 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,55 @@ | ||
package asset | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestParseVersionSemver(t *testing.T) { | ||
t.Run("parse invalid version will return non nil error", func(t *testing.T) { | ||
v := "xx" | ||
sv, err := ParseVersion(v) | ||
assert.Error(t, err) | ||
assert.Nil(t, sv) | ||
}) | ||
|
||
t.Run("parse valid version will return nil error", func(t *testing.T) { | ||
v := "1.0" | ||
sv, err := ParseVersion(v) | ||
assert.Nil(t, err) | ||
assert.Equal(t, sv.Major(), uint64(1)) | ||
assert.Equal(t, sv.Minor(), uint64(0)) | ||
}) | ||
|
||
t.Run("parse valid version with prefix 'v' will return nil error", func(t *testing.T) { | ||
v := "v1.0" | ||
sv, err := ParseVersion(v) | ||
assert.Nil(t, err) | ||
assert.Equal(t, sv.Major(), uint64(1)) | ||
assert.Equal(t, sv.Minor(), uint64(0)) | ||
}) | ||
} | ||
|
||
func TestIncreaseMinorVersion(t *testing.T) { | ||
t.Run("increase minor version of invalid version will return non nil error", func(t *testing.T) { | ||
v := "xx" | ||
sv, err := IncreaseMinorVersion(v) | ||
assert.Error(t, err) | ||
assert.Empty(t, sv) | ||
}) | ||
|
||
t.Run("increase minor version of valid version will return nil error", func(t *testing.T) { | ||
v := "1.0" | ||
sv, err := IncreaseMinorVersion(v) | ||
assert.Nil(t, err) | ||
assert.Equal(t, "1.1", sv) | ||
}) | ||
|
||
t.Run("increase minor version of valid version with prefix 'v' will return nil error", func(t *testing.T) { | ||
v := "v1.0" | ||
sv, err := IncreaseMinorVersion(v) | ||
assert.Nil(t, err) | ||
assert.Equal(t, "1.1", sv) | ||
}) | ||
} |
This file contains 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
This file contains 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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
# Architecture | ||
|
||
Compass' architecture is pretty simple. It serves HTTP server with Elasticsearch as its main persistent storage. | ||
Compass' architecture is pretty simple. It has a client-server architecture backed by PostgreSQL as a main storage and Elasticsearch as a secondary storage and provides HTTP & gRPC interface to interact with. | ||
|
||
 | ||
 | ||
|
||
## System Design | ||
### Components | ||
|
||
#### HTTP Server | ||
#### gRPC Server | ||
|
||
* HTTP server is the main and only interface to interact with Compass using RESTful pattern. | ||
* gRPC server is the main interface to interact with Compass. | ||
* The protobuf file to define the interface is centralized in [odpf/proton](https://github.com/odpf/proton/tree/main/odpf/compass/v1beta1) | ||
#### gRPC-gateway Server | ||
|
||
* gRPC-gateway server transcodes HTTP call to gRPC call and allows client to interact with Compass using RESTful HTTP request. | ||
#### PostgreSQL | ||
|
||
* Compass uses PostgreSQL as it is main storage for storing all of its metadata. | ||
#### Elasticsearch | ||
|
||
* Compass uses Elasticsearch as it is main storage for storing all of its metadata. | ||
* Compass uses Elasticsearch as it is secondary storage to power search of metadata. |
Oops, something went wrong.