Skip to content

Commit

Permalink
fix(shopify): Remove codegen, upgrade SDK (#6568)
Browse files Browse the repository at this point in the history
  • Loading branch information
disq committed Jan 10, 2023
1 parent c700095 commit 1c8fcad
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 1,342 deletions.
7 changes: 1 addition & 6 deletions plugins/source/shopify/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ gen-docs:
lint:
golangci-lint run --config ../../.golangci.yml

.PHONY: gen-code
gen-code:
grep -rl '// Code generated by codegen; DO NOT EDIT.' resources/services/* | xargs rm
go run codegen/main.go

# All gen targets
.PHONY: gen
gen: gen-code gen-docs
gen: gen-docs
3 changes: 2 additions & 1 deletion plugins/source/shopify/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/cloudquery/cloudquery/plugins/source/shopify/internal/shopify"
"github.com/cloudquery/plugin-sdk/plugins/source"
"github.com/cloudquery/plugin-sdk/schema"
"github.com/cloudquery/plugin-sdk/specs"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -39,7 +40,7 @@ func (c *Client) ID() string {
return c.sourceSpec.Name
}

func Configure(ctx context.Context, logger zerolog.Logger, s specs.Source) (schema.ClientMeta, error) {
func Configure(ctx context.Context, logger zerolog.Logger, s specs.Source, _ ...source.Option) (schema.ClientMeta, error) {
spSpec := &Spec{}
if err := s.UnmarshalSpec(spSpec); err != nil {
return nil, fmt.Errorf("failed to unmarshal shopify spec: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion plugins/source/shopify/client/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func MockTestHelper(t *testing.T, table *schema.Table, createServices func(*mux.
zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.StampMicro},
).Level(zerolog.DebugLevel).With().Timestamp().Logger()

newTestExecutionClient := func(ctx context.Context, logger zerolog.Logger, spec specs.Source) (schema.ClientMeta, error) {
newTestExecutionClient := func(ctx context.Context, logger zerolog.Logger, spec specs.Source, _ ...source.Option) (schema.ClientMeta, error) {
var spSpec Spec
if err := spec.UnmarshalSpec(&spSpec); err != nil {
return nil, fmt.Errorf("failed to unmarshal shopify spec: %w", err)
Expand Down
110 changes: 0 additions & 110 deletions plugins/source/shopify/codegen/main.go

This file was deleted.

16 changes: 0 additions & 16 deletions plugins/source/shopify/codegen/recipes/checkout.go

This file was deleted.

15 changes: 0 additions & 15 deletions plugins/source/shopify/codegen/recipes/customer.go

This file was deleted.

15 changes: 0 additions & 15 deletions plugins/source/shopify/codegen/recipes/order.go

This file was deleted.

21 changes: 0 additions & 21 deletions plugins/source/shopify/codegen/recipes/price_rule.go

This file was deleted.

27 changes: 0 additions & 27 deletions plugins/source/shopify/codegen/recipes/product.go

This file was deleted.

0 comments on commit 1c8fcad

Please sign in to comment.