Skip to content

Commit 3b22050

Browse files
authored
feat(azuredevops)!: Migrate to Arrow native SDK (#11012)
Closes #10736 BEGIN_COMMIT_OVERRIDE feat: Update to use [Apache Arrow](https://arrow.apache.org/) type system (#11012) BREAKING-CHANGE: This release introduces an internal change to our type system to use [Apache Arrow](https://arrow.apache.org/). This should not have any visible breaking changes, however due to the size of the change we are introducing it under a major version bump to communicate that it might have some bugs that we weren't able to catch during our internal tests. If you encounter an issue during the upgrade, please submit a [bug report](https://github.com/cloudquery/cloudquery/issues/new/choose). You will also need to update destinations depending on which one you use: - Azure Blob Storage >= v3.2.0 - BigQuery >= v3.0.0 - ClickHouse >= v3.1.1 - DuckDB >= v1.1.6 - Elasticsearch >= v2.0.0 - File >= v3.2.0 - Firehose >= v2.0.2 - GCS >= v3.2.0 - Gremlin >= v2.1.10 - Kafka >= v3.0.1 - Meilisearch >= v2.0.1 - Microsoft SQL Server >= v4.2.0 - MongoDB >= v2.0.1 - MySQL >= v2.0.2 - Neo4j >= v3.0.0 - PostgreSQL >= v4.2.0 - S3 >= v4.4.0 - Snowflake >= v2.1.1 - SQLite >= v2.2.0 END_COMMIT_OVERRIDE
1 parent ed36296 commit 3b22050

File tree

10 files changed

+38
-32
lines changed

10 files changed

+38
-32
lines changed

plugins/source/azuredevops/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"fmt"
66

77
"github.com/cloudquery/plugin-pb-go/specs"
8-
"github.com/cloudquery/plugin-sdk/v2/plugins/source"
9-
"github.com/cloudquery/plugin-sdk/v2/schema"
8+
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
9+
"github.com/cloudquery/plugin-sdk/v3/schema"
1010
"github.com/microsoft/azure-devops-go-api/azuredevops/v6"
1111
"github.com/rs/zerolog"
1212
"github.com/rs/zerolog/log"

plugins/source/azuredevops/client/transformers.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ package client
33
import (
44
"reflect"
55

6-
"github.com/cloudquery/plugin-sdk/v2/schema"
7-
"github.com/cloudquery/plugin-sdk/v2/transformers"
6+
"github.com/apache/arrow/go/v13/arrow"
7+
"github.com/cloudquery/plugin-sdk/v3/schema"
8+
"github.com/cloudquery/plugin-sdk/v3/transformers"
9+
"github.com/cloudquery/plugin-sdk/v3/types"
810
"github.com/google/uuid"
911
)
1012

@@ -18,11 +20,11 @@ func isUUID(fieldType reflect.Type) bool {
1820
return fieldType == reflect.TypeOf(uuid.UUID{})
1921
}
2022

21-
func typeTransformer(field reflect.StructField) (schema.ValueType, error) {
23+
func typeTransformer(field reflect.StructField) (arrow.DataType, error) {
2224
if isUUID(field.Type) {
23-
return schema.TypeUUID, nil
25+
return types.ExtensionTypes.UUID, nil
2426
}
25-
return schema.TypeInvalid, nil
27+
return nil, nil
2628
}
2729

2830
var options = []transformers.StructTransformerOption{

plugins/source/azuredevops/go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ module github.com/cloudquery/cloudquery/plugins/source/azuredevops
33
go 1.19
44

55
require (
6+
github.com/apache/arrow/go/v13 v13.0.0-20230509040948-de6c3cd2b604
67
github.com/cloudquery/plugin-pb-go v1.0.8
7-
github.com/cloudquery/plugin-sdk/v2 v2.7.0
8+
github.com/cloudquery/plugin-sdk/v3 v3.6.4
89
github.com/google/uuid v1.3.0
910
github.com/microsoft/azure-devops-go-api/azuredevops/v6 v6.0.1
1011
github.com/rs/zerolog v1.29.0
1112
)
1213

13-
// TODO: remove once all updates are merged
14-
replace github.com/apache/arrow/go/v13 => github.com/cloudquery/arrow/go/v13 v13.0.0-20230509053643-898a79b1d3c8
14+
replace github.com/apache/arrow/go/v13 => github.com/cloudquery/arrow/go/v13 v13.0.0-20230525142029-2d32efeedad8
1515

1616
require (
1717
github.com/andybalholm/brotli v1.0.5 // indirect
18-
github.com/apache/arrow/go/v13 v13.0.0-20230509040948-de6c3cd2b604 // indirect
1918
github.com/apache/thrift v0.16.0 // indirect
19+
github.com/cloudquery/plugin-sdk/v2 v2.7.0 // indirect
2020
github.com/davecgh/go-spew v1.1.1 // indirect
2121
github.com/getsentry/sentry-go v0.20.0 // indirect
2222
github.com/ghodss/yaml v1.0.0 // indirect
@@ -34,6 +34,7 @@ require (
3434
github.com/mattn/go-isatty v0.0.18 // indirect
3535
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
3636
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
37+
github.com/pierrec/lz4/v4 v4.1.15 // indirect
3738
github.com/pmezard/go-difflib v1.0.0 // indirect
3839
github.com/spf13/cast v1.5.0 // indirect
3940
github.com/spf13/cobra v1.6.1 // indirect

plugins/source/azuredevops/go.sum

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
4444
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
4545
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
4646
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
47-
github.com/cloudquery/arrow/go/v13 v13.0.0-20230509053643-898a79b1d3c8 h1:CmgLSEGQNLHpUQ5cU4L4aF7cuJZRnc1toIIWqC1gmPg=
48-
github.com/cloudquery/arrow/go/v13 v13.0.0-20230509053643-898a79b1d3c8/go.mod h1:/XatdE3kDIBqZKhZ7OBUHwP2jaASDFZHqF4puOWM8po=
47+
github.com/cloudquery/arrow/go/v13 v13.0.0-20230525142029-2d32efeedad8 h1:/mgK+To5HNUzuZDWdVygbfn8oaPG5c7I/8qCxwwpWO8=
48+
github.com/cloudquery/arrow/go/v13 v13.0.0-20230525142029-2d32efeedad8/go.mod h1:/XatdE3kDIBqZKhZ7OBUHwP2jaASDFZHqF4puOWM8po=
4949
github.com/cloudquery/plugin-pb-go v1.0.8 h1:wn3GXhcNItcP+6wUUZuzUFbvdL59liKBO37/izMi+FQ=
5050
github.com/cloudquery/plugin-pb-go v1.0.8/go.mod h1:vAGA27psem7ZZNAY4a3S9TKuA/JDQWstjKcHPJX91Mc=
5151
github.com/cloudquery/plugin-sdk/v2 v2.7.0 h1:hRXsdEiaOxJtsn/wZMFQC9/jPfU1MeMK3KF+gPGqm7U=
5252
github.com/cloudquery/plugin-sdk/v2 v2.7.0/go.mod h1:pAX6ojIW99b/Vg4CkhnsGkRIzNaVEceYMR+Bdit73ug=
53+
github.com/cloudquery/plugin-sdk/v3 v3.6.4 h1:P4OkS5tJYkv3OqeL60DAVqXXbFQUyPKJ5YDtAgjl9b4=
54+
github.com/cloudquery/plugin-sdk/v3 v3.6.4/go.mod h1:3JrZXEULmGXpkOukVaRIzaA63d7TJr9Ukp6hemTjbtc=
5355
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
5456
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
5557
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@@ -177,6 +179,7 @@ github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8D
177179
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
178180
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
179181
github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
182+
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
180183
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
181184
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
182185
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

plugins/source/azuredevops/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"github.com/cloudquery/cloudquery/plugins/source/azuredevops/resources/plugin"
5-
"github.com/cloudquery/plugin-sdk/v2/serve"
5+
"github.com/cloudquery/plugin-sdk/v3/serve"
66
)
77

88
const sentryDSN = "https://[email protected]/4504317272915968"

plugins/source/azuredevops/resources/plugin/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package plugin
22

33
import (
44
"github.com/cloudquery/cloudquery/plugins/source/azuredevops/client"
5-
"github.com/cloudquery/plugin-sdk/v2/plugins/source"
5+
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
66
)
77

88
var (

plugins/source/azuredevops/resources/plugin/tables.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/azuredevops/resources/services/core/projects.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package core
22

33
import (
44
"github.com/cloudquery/cloudquery/plugins/source/azuredevops/client"
5-
"github.com/cloudquery/plugin-sdk/v2/schema"
5+
"github.com/cloudquery/plugin-sdk/v3/schema"
66
"github.com/microsoft/azure-devops-go-api/azuredevops/v6/core"
77
)
88

plugins/source/azuredevops/resources/services/core/projects_fetch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55

66
"github.com/cloudquery/cloudquery/plugins/source/azuredevops/client"
7-
"github.com/cloudquery/plugin-sdk/v2/schema"
7+
"github.com/cloudquery/plugin-sdk/v3/schema"
88
"github.com/microsoft/azure-devops-go-api/azuredevops/v6/core"
99
)
1010

website/tables/azuredevops/azuredevops_core_projects.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ The primary key for this table is **_cq_id**.
88

99
| Name | Type |
1010
| ------------- | ------------- |
11-
|_cq_source_name|String|
12-
|_cq_sync_time|Timestamp|
13-
|_cq_id (PK)|UUID|
14-
|_cq_parent_id|UUID|
15-
|abbreviation|String|
16-
|default_team_image_url|String|
17-
|description|String|
18-
|id|UUID|
19-
|last_update_time|JSON|
20-
|name|String|
21-
|revision|Int|
22-
|state|String|
23-
|url|String|
24-
|visibility|String|
11+
|_cq_source_name|utf8|
12+
|_cq_sync_time|timestamp[us, tz=UTC]|
13+
|_cq_id (PK)|uuid|
14+
|_cq_parent_id|uuid|
15+
|abbreviation|utf8|
16+
|default_team_image_url|utf8|
17+
|description|utf8|
18+
|id|uuid|
19+
|last_update_time|json|
20+
|name|utf8|
21+
|revision|int64|
22+
|state|utf8|
23+
|url|utf8|
24+
|visibility|utf8|

0 commit comments

Comments
 (0)