Skip to content

Commit

Permalink
refactor(assets): update assets to version v1beta1 (#284)
Browse files Browse the repository at this point in the history
* refactor: update assets to version v1beta1 and fmt

* feat(assets): update assets to the latest

* feat(columbus): add email to columbus owner struct

* fix(tableau): fix proto version name
  • Loading branch information
mabdh authored Dec 20, 2021
1 parent 6610c15 commit 9964800
Show file tree
Hide file tree
Showing 80 changed files with 3,725 additions and 3,683 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ test-e2e:
generate-proto: ## regenerate protos
@echo " > cloning protobuf from odpf/proton"
@echo " > generating protobuf"
@buf generate --template buf.gen.yaml https://github.com/odpf/proton/archive/135a03875fc82b501e686924457a44730fd04268.zip#strip_components=1 --path odpf/assets
@buf generate --template buf.gen.yaml https://github.com/odpf/proton/archive/a0bc6dbf2ad91abfebc4bf5f70e275983109baca.zip#strip_components=1 --path odpf/assets
@echo " > protobuf compilation finished"
18 changes: 9 additions & 9 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/odpf/meteor/agent"
"github.com/odpf/meteor/models"
"github.com/odpf/meteor/models/odpf/assets"
assetsv1beta1 "github.com/odpf/meteor/models/odpf/assets/v1beta1"
"github.com/odpf/meteor/plugins"
"github.com/odpf/meteor/recipe"
"github.com/odpf/meteor/registry"
Expand Down Expand Up @@ -297,7 +297,7 @@ func TestRunnerRun(t *testing.T) {

t.Run("should return error when processing fails", func(t *testing.T) {
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}

extr := mocks.NewExtractor()
Expand Down Expand Up @@ -339,7 +339,7 @@ func TestRunnerRun(t *testing.T) {

t.Run("should return error when processing panics", func(t *testing.T) {
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}

extr := mocks.NewExtractor()
Expand Down Expand Up @@ -380,7 +380,7 @@ func TestRunnerRun(t *testing.T) {

t.Run("should not return error when sink fails", func(t *testing.T) {
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}

extr := mocks.NewExtractor()
Expand Down Expand Up @@ -423,7 +423,7 @@ func TestRunnerRun(t *testing.T) {

t.Run("should return error when sink fails if StopOnSinkError is true", func(t *testing.T) {
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}

extr := mocks.NewExtractor()
Expand Down Expand Up @@ -467,7 +467,7 @@ func TestRunnerRun(t *testing.T) {

t.Run("should return run on success", func(t *testing.T) {
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}

extr := mocks.NewExtractor()
Expand Down Expand Up @@ -511,7 +511,7 @@ func TestRunnerRun(t *testing.T) {

t.Run("should collect run metrics", func(t *testing.T) {
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}

extr := mocks.NewExtractor()
Expand Down Expand Up @@ -568,7 +568,7 @@ func TestRunnerRun(t *testing.T) {
t.Run("should retry if sink returns retry error", func(t *testing.T) {
err := errors.New("some-error")
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}

extr := mocks.NewExtractor()
Expand Down Expand Up @@ -620,7 +620,7 @@ func TestRunnerRunMultiple(t *testing.T) {
validRecipe2.Name = "sample-2"
recipeList := []recipe.Recipe{validRecipe, validRecipe2}
data := []models.Record{
models.NewRecord(&assets.Table{}),
models.NewRecord(&assetsv1beta1.Table{}),
}
extr := mocks.NewExtractor()
extr.SetEmit(data)
Expand Down
6 changes: 3 additions & 3 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1beta1
version: v1
plugins:
- name: go
out: proto
opt: paths=source_relative
out: models
opt: paths=source_relative
4 changes: 2 additions & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (

var (
// Version is the version of the binary
Version string
Version string
// BuildCommit is the commit hash of the binary
BuildCommit string
// BuildDate is the date of the build
BuildDate string
BuildDate string
)

// VersionCmd prints the version of the binary
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/reference/metadata_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,28 @@ To check their implementation please refer [here](https://github.com/odpf/proton

```golang
import(
"github.com/odpf/meteor/models/odpf/assets"
"github.com/odpf/meteor/models/odpf/assets/facets"
"github.com/odpf/meteor/models/odpf/assets/v1beta1"
"github.com/odpf/meteor/models/odpf/assets/facets/v1beta1"
)

func main(){
// result is a var of data type of assets.Table one of our metadata model
result := &assets.Table{
// result is a var of data type of assetsv1beta1.Table one of our metadata model
result := &assetsv1beta1.Table{
// assigining value to metadata model
Urn: fmt.Sprintf("%s.%s", dbName, tableName),
Name: tableName,
}

// using column facet to add metadata info of schema

var columns []*facets.Column
columns = append(columns, &facets.Column{
var columns []*facetsv1beta1.Column
columns = append(columns, &facetsv1beta1.Column{
Name: "column_name",
DataType: "varchar",
IsNullable: true,
Length: 256,
})
result.Schema = &facets.Columns{
result.Schema = &facetsv1beta1.Columns{
Columns: columns,
}
}
Expand Down
5 changes: 3 additions & 2 deletions generator/recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package generator

import (
"embed"
"github.com/odpf/meteor/registry"
"github.com/pkg/errors"
"os"
"strings"
"text/template"

"github.com/odpf/meteor/registry"
"github.com/pkg/errors"
)

//go:embed recipe.yaml
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ require (
github.com/hashicorp/go-hclog v0.16.1
github.com/hashicorp/go-plugin v1.4.2
github.com/klauspost/compress v1.13.6 // indirect
github.com/knadh/koanf v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.2
github.com/mcuadros/go-defaults v1.2.0
Expand All @@ -54,7 +53,6 @@ require (
gitlab.com/flimzy/testy v0.8.0 // indirect
go.mongodb.org/mongo-driver v1.5.3
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0
go.opentelemetry.io/otel/sdk/metric v0.24.0 // indirect
golang.org/x/net v0.0.0-20211101193420-4a448f8816b3 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect
Expand Down
Loading

0 comments on commit 9964800

Please sign in to comment.