Skip to content

Commit f9e5364

Browse files
committed
fix(firestore-bigquery-export): implemented RC changes including logging keys
1 parent 743c571 commit f9e5364

File tree

12 files changed

+106
-88
lines changed

12 files changed

+106
-88
lines changed

_emulator/.firebaserc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"projects": {
33
"default": "demo-test"
4+
},
5+
"targets": {},
6+
"etags": {
7+
"dev-extensions-testing": {
8+
"extensionInstances": {
9+
"firestore-bigquery-export": "02acbd8b443b9635716d52d65758a78db1e51140191caecaaf60d932d314a62a"
10+
}
11+
}
412
}
513
}

_emulator/firebase.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
22
"extensions": {
3-
"firestore-send-email": "../firestore-send-email",
4-
"delete-user-data": "../delete-user-data",
5-
"storage-resize-images": "../storage-resize-images",
6-
"firestore-counter": "../firestore-counter",
7-
"firestore-bigquery-export": "../firestore-bigquery-export",
8-
"firestore-send-email-sendgrid": "../firestore-send-email"
3+
"firestore-bigquery-export": "../firestore-bigquery-export"
94
},
105
"storage": {
116
"rules": "storage.rules"

firestore-bigquery-export/extension.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,6 @@ params:
196196
default: posts
197197
required: true
198198

199-
- param: LOG_FAILED_EXPORTS
200-
label: Enable logging failed exports
201-
description: >-
202-
If enabled, the extension will log event exports that failed to enqueue to
203-
Cloud Logging, to mitigate data loss.
204-
type: select
205-
options:
206-
- label: Yes
207-
value: yes
208-
- label: No
209-
value: no
210-
default: yes
211-
212199
- param: WILDCARD_IDS
213200
label: Enable Wildcard Column field with Parent Firestore Document IDs
214201
description: >-

firestore-bigquery-export/functions/__tests__/__snapshots__/config.test.ts.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Object {
2121
"instanceId": undefined,
2222
"kmsKeyName": "test",
2323
"location": "us-central1",
24-
"logFailedExportData": false,
2524
"maxDispatchesPerSecond": 10,
2625
"maxEnqueueAttempts": 3,
2726
"tableId": "my_table",

firestore-bigquery-export/functions/__tests__/e2e.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { BigQuery } from "@google-cloud/bigquery";
33

44
/** Set defaults */
55
const bqProjectId = process.env.BQ_PROJECT_ID || "dev-extensions-testing";
6-
const datasetId = process.env.DATASET_ID || "firestore_export_e2e";
7-
const tableId = process.env.TABLE_ID || "posts_raw_changelog";
6+
const datasetId = process.env.DATASET_ID || "firestore_export";
7+
const tableId = process.env.TABLE_ID || "bq_e2e_test_raw_changelog";
88

99
/** Init resources */
1010
admin.initializeApp({ projectId: bqProjectId });
@@ -34,7 +34,7 @@ describe("e2e", () => {
3434

3535
/** Get the latest record from this table */
3636
const [changeLogQuery] = await bq.createQueryJob({
37-
query: `SELECT * FROM \`${bqProjectId}.${datasetId}.${tableId}\` ORDER BY timestamp DESC \ LIMIT 1`,
37+
query: `SELECT * FROM \`${bqProjectId}.${datasetId}.${tableId}\` ORDER BY timestamp DESC LIMIT 1`,
3838
});
3939

4040
const [rows] = await changeLogQuery.getQueryResults();

firestore-bigquery-export/functions/__tests__/functions.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jest.mock("firebase-admin/functions", () => ({
3737
}));
3838

3939
jest.mock("../src/logs", () => ({
40+
...jest.requireActual("../src/logs"),
4041
start: jest.fn(() =>
4142
logger.log("Started execution of extension with configuration", config)
4243
),

firestore-bigquery-export/functions/package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

firestore-bigquery-export/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Jan Wyszynski <[email protected]>",
1414
"license": "Apache-2.0",
1515
"dependencies": {
16-
"@firebaseextensions/firestore-bigquery-change-tracker": "file:firebaseextensions-firestore-bigquery-change-tracker-1.1.37.tgz",
16+
"@firebaseextensions/firestore-bigquery-change-tracker": "^1.1.38",
1717
"@google-cloud/bigquery": "^7.6.0",
1818
"@types/chai": "^4.1.6",
1919
"@types/express-serve-static-core": "4.17.30",

firestore-bigquery-export/functions/src/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function clustering(clusters: string | undefined) {
3434
}
3535

3636
export default {
37-
logFailedExportData: process.env.LOG_FAILED_EXPORTS === "yes",
3837
bqProjectId: process.env.BIGQUERY_PROJECT_ID,
3938
databaseId: "(default)",
4039
collectionPath: process.env.COLLECTION_PATH,

0 commit comments

Comments
 (0)