Skip to content

Commit c556548

Browse files
Merge branch 'main' into release-please--branches--main--components--plugins-source-datadog
2 parents 27dac23 + 8e984a8 commit c556548

17 files changed

Lines changed: 295 additions & 91 deletions

File tree

.release-please-manifest.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cli": "2.2.0",
2+
"cli": "2.3.0",
33
"cli+FILLER": "0.0.0",
44
"plugins/source/aws": "12.0.0",
55
"plugins/source/aws+FILLER": "0.0.0",
@@ -9,17 +9,17 @@
99
"plugins/source/cloudflare+FILLER": "0.0.0",
1010
"plugins/source/digitalocean": "4.1.1",
1111
"plugins/source/digitalocean+FILLER": "0.0.0",
12-
"plugins/source/gcp": "7.2.0",
12+
"plugins/source/gcp": "7.2.1",
1313
"plugins/source/gcp+FILLER": "0.0.0",
1414
"plugins/source/github": "2.1.2",
1515
"plugins/source/github+FILLER": "0.0.0",
1616
"plugins/source/heroku": "3.1.6",
1717
"plugins/source/heroku+FILLER": "0.0.0",
1818
"plugins/source/k8s": "3.0.1",
1919
"plugins/source/k8s+FILLER": "0.0.0",
20-
"plugins/source/okta": "2.1.1",
20+
"plugins/source/okta": "2.1.2",
2121
"plugins/source/okta+FILLER": "0.0.0",
22-
"plugins/source/terraform": "1.3.6",
22+
"plugins/source/terraform": "1.3.7",
2323
"plugins/source/terraform+FILLER": "0.0.0",
2424
"plugins/source/test": "1.3.29",
2525
"plugins/source/test+FILLER": "0.0.0",
@@ -45,11 +45,11 @@
4545
"plugins/source/vercel+FILLER": "0.0.0",
4646
"plugins/source/slack": "1.1.1",
4747
"plugins/source/slack+FILLER": "0.0.0",
48-
"plugins/source/crowdstrike": "1.1.1",
48+
"plugins/source/crowdstrike": "1.1.2",
4949
"plugins/source/crowdstrike+FILLER": "0.0.0",
50-
"plugins/source/pagerduty": "1.2.1",
50+
"plugins/source/pagerduty": "1.2.2",
5151
"plugins/source/pagerduty+FILLER": "0.0.0",
52-
"plugins/destination/mongodb": "1.0.6",
52+
"plugins/destination/mongodb": "1.0.7",
5353
"plugins/destination/mongodb+FILLTER": "0.0.0",
5454
"plugins/source/gitlab": "2.1.0",
5555
"plugins/source/gitlab+FILLER": "0.0.0",
@@ -61,11 +61,11 @@
6161
"plugins/source/fastly+FILLER": "0.0.0",
6262
"plugins/source/snyk": "1.1.1",
6363
"plugins/source/snyk+FILLER": "0.0.0",
64-
"plugins/destination/gcs": "1.0.5",
64+
"plugins/destination/gcs": "1.0.6",
6565
"plugins/destination/gcs+FILLER": "0.0.0",
6666
"plugins/destination/s3": "1.0.5",
6767
"plugins/destination/s3+FILLER": "0.0.0",
68-
"plugins/destination/file": "1.0.5",
68+
"plugins/destination/file": "1.0.6",
6969
"plugins/destination/file+FILLER": "0.0.0",
7070
"plugins/destination/azblob": "1.0.4",
7171
"plugins/destination/azblob+FILLER": "0.0.0",

cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to CloudQuery will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.3.0](https://github.com/cloudquery/cloudquery/compare/cli-v2.2.0...cli-v2.3.0) (2023-01-24)
9+
10+
11+
### Features
12+
13+
* **cli:** Update CLI to support source v1 protocol ([#6986](https://github.com/cloudquery/cloudquery/issues/6986)) ([fe8ff12](https://github.com/cloudquery/cloudquery/commit/fe8ff127bc0ee7f36d2004ee30745e28edf2e8d0))
14+
* Log received signal when shutting down ([#6933](https://github.com/cloudquery/cloudquery/issues/6933)) ([7d9d8cd](https://github.com/cloudquery/cloudquery/commit/7d9d8cd51ecf6d2206f4d13fada307952a0cf56c))
15+
816
## [2.2.0](https://github.com/cloudquery/cloudquery/compare/cli-v2.1.1...cli-v2.2.0) (2023-01-17)
917

1018

plugins/destination/file/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.0.6](https://github.com/cloudquery/cloudquery/compare/plugins-destination-file-v1.0.5...plugins-destination-file-v1.0.6) (2023-01-24)
4+
5+
6+
### Bug Fixes
7+
8+
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.28.0 ([#7009](https://github.com/cloudquery/cloudquery/issues/7009)) ([12ac005](https://github.com/cloudquery/cloudquery/commit/12ac005428a355d06a5939fbe06a82d49533e662))
9+
310
## [1.0.5](https://github.com/cloudquery/cloudquery/compare/plugins-destination-file-v1.0.4...plugins-destination-file-v1.0.5) (2023-01-17)
411

512

plugins/destination/gcs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.0.6](https://github.com/cloudquery/cloudquery/compare/plugins-destination-gcs-v1.0.5...plugins-destination-gcs-v1.0.6) (2023-01-24)
4+
5+
6+
### Bug Fixes
7+
8+
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.28.0 ([#7009](https://github.com/cloudquery/cloudquery/issues/7009)) ([12ac005](https://github.com/cloudquery/cloudquery/commit/12ac005428a355d06a5939fbe06a82d49533e662))
9+
310
## [1.0.5](https://github.com/cloudquery/cloudquery/compare/plugins-destination-gcs-v1.0.4...plugins-destination-gcs-v1.0.5) (2023-01-17)
411

512

plugins/destination/mongodb/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.0.7](https://github.com/cloudquery/cloudquery/compare/plugins-destination-mongodb-v1.0.6...plugins-destination-mongodb-v1.0.7) (2023-01-24)
4+
5+
6+
### Bug Fixes
7+
8+
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.28.0 ([#7009](https://github.com/cloudquery/cloudquery/issues/7009)) ([12ac005](https://github.com/cloudquery/cloudquery/commit/12ac005428a355d06a5939fbe06a82d49533e662))
9+
310
## [1.0.6](https://github.com/cloudquery/cloudquery/compare/plugins-destination-mongodb-v1.0.5...plugins-destination-mongodb-v1.0.6) (2023-01-17)
411

512

plugins/destination/sqlite/client/client_test.go

Lines changed: 64 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ func TestMigrateErrors(t *testing.T) {
6161
name: "should fail on migrate mode safe",
6262
spec: specs.Destination{Name: "cq_test_migrate", Spec: Spec{ConnectionString: ":memory:"}},
6363
wantErr: `failed to migrate schema:
64-
can't migrate table "table_1" since adding the new PK column "new_pk_column" is not supported. Try dropping this table
65-
can't migrate table "table_2" since changing the type of column "age" from "integer" to "text" is not supported. Try dropping this column for this table
66-
can't migrate table "table_2" since changing the type of column "created_at" from "text" to "timestamp" is not supported. Try dropping this column for this table
67-
68-
To force a migration add "migrate_mode: forced" to your destination spec`,
64+
can't migrate table "table_with_new_pk_column" since adding the new PK column "new_pk_column" is not supported. Try dropping this table
65+
can't migrate table "table_with_pk_addition_existing_column" since making the existing column "id" a PK is not supported. Try dropping this table
66+
can't migrate table "table_with_pk_removal" since removing an existing column "id" as a PK is not supported. Try dropping this table
67+
can't migrate table "table_with_pk_type_change" since changing the type of the PK column "id" from "integer" to "text" is not supported. Try dropping this table
68+
can't migrate table "table_with_non_pk_type_change" since changing the type of column "created_at" from "text" to "timestamp" is not supported. Try dropping this column for this table`,
6969
},
7070
{
7171
name: "should succeed on migrate mode force",
@@ -75,15 +75,39 @@ To force a migration add "migrate_mode: forced" to your destination spec`,
7575

7676
for _, tt := range tests {
7777
t.Run(tt.name, func(t *testing.T) {
78-
table := schema.Table{
79-
Name: "table_1",
80-
Columns: []schema.Column{
81-
{Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}},
82-
{Name: "name", Type: schema.TypeString},
83-
{Name: "age", Type: schema.TypeInt},
84-
{Name: "created_at", Type: schema.TypeString},
78+
cqId := schema.CqIDColumn
79+
cqIdWithPK := cqId
80+
cqIdWithPK.CreationOptions.PrimaryKey = true
81+
beforeSchema := schema.Tables{
82+
{
83+
Name: "table_with_new_column",
84+
Columns: []schema.Column{cqId, {Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}}},
85+
},
86+
{
87+
Name: "table_with_new_pk_column",
88+
// cq_id is needed for initial migrations of tables without a PK
89+
Columns: []schema.Column{cqIdWithPK},
90+
},
91+
{
92+
Name: "table_with_pk_addition_existing_column",
93+
// cq_id is needed for initial migrations of tables without a PK
94+
Columns: []schema.Column{cqIdWithPK, {Name: "id", Type: schema.TypeUUID}},
95+
},
96+
{
97+
Name: "table_with_pk_removal",
98+
Columns: []schema.Column{cqId, {Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}}},
99+
},
100+
{
101+
Name: "table_with_pk_type_change",
102+
Columns: []schema.Column{cqId, {Name: "id", Type: schema.TypeInt, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}}},
103+
},
104+
{
105+
Name: "table_with_non_pk_type_change",
106+
// cq_id is needed for initial migrations of tables without a PK
107+
Columns: []schema.Column{cqIdWithPK, {Name: "created_at", Type: schema.TypeString}},
85108
},
86109
}
110+
87111
p := destination.NewPlugin("sqlite", "development", New)
88112
ctx := context.Background()
89113

@@ -92,56 +116,44 @@ To force a migration add "migrate_mode: forced" to your destination spec`,
92116
t.Fatal(err)
93117
}
94118

95-
if err := p.Migrate(ctx, []*schema.Table{&table}); err != nil {
119+
if err := p.Migrate(ctx, schema.Tables{beforeSchema[0]}); err != nil {
96120
t.Fatal(err)
97121
}
98122

99-
tableWithMigratableChange := schema.Table{
100-
Name: "table_1",
101-
Columns: []schema.Column{
102-
{Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}},
103-
{Name: "name", Type: schema.TypeString},
104-
{Name: "age", Type: schema.TypeInt},
105-
{Name: "created_at", Type: schema.TypeString},
106-
{Name: "new_column", Type: schema.TypeString},
107-
},
108-
}
109-
newTable := schema.Table{
110-
Name: "table_2",
111-
Columns: []schema.Column{
112-
{Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}},
113-
{Name: "name", Type: schema.TypeString},
114-
{Name: "age", Type: schema.TypeInt},
115-
{Name: "created_at", Type: schema.TypeString},
116-
},
117-
}
118-
119-
if err := p.Migrate(ctx, []*schema.Table{&tableWithMigratableChange, &newTable}); err != nil {
123+
// Adding a new column to the table is the only safe migratable change in SQLite
124+
beforeSchema[0].Columns = append(beforeSchema[0].Columns, schema.Column{Name: "new_column", Type: schema.TypeString})
125+
if err := p.Migrate(ctx, beforeSchema); err != nil {
120126
t.Fatal(err)
121127
}
122128

123-
tableWithNonTableDropNeeded := schema.Table{
124-
Name: "table_1",
125-
Columns: []schema.Column{
126-
{Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}},
127-
{Name: "name", Type: schema.TypeString},
128-
{Name: "age", Type: schema.TypeInt},
129-
{Name: "new_pk_column", Type: schema.TypeString, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}},
130-
{Name: "created_at", Type: schema.TypeTimestamp},
129+
afterSchema := schema.Tables{
130+
{
131+
Name: "table_with_new_column",
132+
Columns: []schema.Column{cqId, {Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}}, {Name: "new_column", Type: schema.TypeString}},
131133
},
132-
}
133-
134-
tableWithColumnsDropNeeded := schema.Table{
135-
Name: "table_2",
136-
Columns: []schema.Column{
137-
{Name: "id", Type: schema.TypeUUID},
138-
{Name: "name", Type: schema.TypeString, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}},
139-
{Name: "age", Type: schema.TypeString},
140-
{Name: "created_at", Type: schema.TypeTimestamp},
134+
{
135+
Name: "table_with_new_pk_column",
136+
Columns: []schema.Column{cqId, {Name: "new_pk_column", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}}},
137+
},
138+
{
139+
Name: "table_with_pk_addition_existing_column",
140+
Columns: []schema.Column{cqId, {Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}}},
141+
},
142+
{
143+
Name: "table_with_pk_removal",
144+
Columns: []schema.Column{cqIdWithPK, {Name: "id", Type: schema.TypeUUID}},
145+
},
146+
{
147+
Name: "table_with_pk_type_change",
148+
Columns: []schema.Column{cqId, {Name: "id", Type: schema.TypeUUID, CreationOptions: schema.ColumnCreationOptions{PrimaryKey: true}}},
149+
},
150+
{
151+
Name: "table_with_non_pk_type_change",
152+
Columns: []schema.Column{cqIdWithPK, {Name: "created_at", Type: schema.TypeTimestamp}},
141153
},
142154
}
143155

144-
err := p.Migrate(ctx, []*schema.Table{&tableWithNonTableDropNeeded, &tableWithColumnsDropNeeded})
156+
err := p.Migrate(ctx, afterSchema)
145157
if tt.wantErr != "" {
146158
require.ErrorContains(t, err, tt.wantErr)
147159
} else {

0 commit comments

Comments
 (0)