Skip to content

Commit c7396cd

Browse files
author
Ashley Gau
authored
Merge pull request #214 from firebase/next
March 3, 2020 Release
2 parents 85e6ef5 + b58d14f commit c7396cd

File tree

48 files changed

+1452
-617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1452
-617
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ README.md
99
**/functions/lib/**
1010
**/lib/**
1111
**/dist/**
12+
coverage
1213

1314
# extension install md files
1415
# - excluded as prettier escapes variables e.g. `${PROJECT_ID}` becomes `\${PROJECT_ID}`

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
language: node_js
22

3+
install:
4+
- npm install -g codecov
5+
- npm install
6+
37
node_js:
48
- 8
59
- 10
@@ -11,11 +15,10 @@ stages:
1115

1216
jobs:
1317
include:
14-
- stage: validate
15-
name: "TypeScript Compile"
16-
script: npm run clean && npm run build
1718
- stage: validate
1819
name: "Prettier Format Check"
1920
script: npm run lint
20-
- stage: test
21-
script: npm run test-coverage
21+
22+
script:
23+
- npm run test-coverage
24+
- codecov

CONTRIBUTING.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,60 @@
1-
# How to Contribute
1+
# Contributing
22

3-
We'd love to accept your patches and contributions to this project. There are
4-
just a few small guidelines you need to follow.
3+
It's great to receive contributions from the community! If you'd like to contribute to this project, make sure to review and follow the guidelines below.
54

65
## Contributor License Agreement
76

87
Contributions to this project must be accompanied by a Contributor License
98
Agreement. You (or your employer) retain the copyright to your contribution;
10-
this simply gives us permission to use and redistribute your contributions as
11-
part of the project. Head over to <https://cla.developers.google.com/> to see
9+
this agreement simply gives us permission to use and redistribute your contributions as
10+
part of the project. Head over to [https://cla.developers.google.com](https://cla.developers.google.com) to see
1211
your current agreements on file or to sign a new one.
1312

1413
You generally only need to submit a CLA once, so if you've already submitted one
1514
(even if it was for a different project), you probably don't need to do it
1615
again.
1716

18-
## Code reviews
17+
## Code and copy reviews
1918

2019
All submissions, including submissions by project members, require review. We
2120
use GitHub pull requests for this purpose. Consult
2221
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
2322
information on using pull requests.
2423

25-
## Community Guidelines
24+
## Community guidelines
2625

2726
This project follows [Google's Open Source Community
2827
Guidelines](https://opensource.google.com/conduct/).
28+
29+
## Report an issue
30+
31+
Report all issues through GitHub Issues using the [Report a Bug](https://github.com/firebase/extensions/issues/new?template=bug.md) template.
32+
33+
To help resolve your issue as quickly as possible, read the template and provide all the requested information.
34+
35+
## File a feature request
36+
37+
We welcome all feature requests, whether it's to add new functionality to an existing extension or to offer an [idea for a brand new extension](https://firebase.google.com/support/troubleshooter/report/features/).
38+
39+
Here's how to submit a feature request for an existing extension:
40+
41+
1. File your feature request through GitHub Issues using the [Feature Request template](https://github.com/firebase/extensions/issues/new?template=fr.md).
42+
43+
1. File a new [Firebase support request](https://firebase.google.com/support/troubleshooter/report/features/) via the Firebase website. Make sure to reference your feature request's GitHub Issue in the support ticket.
44+
45+
## Create a pull request
46+
47+
When making pull requests to the repository, make sure to follow these guidelines for both bug fixes and new features:
48+
49+
- Before creating a pull request, file a GitHub Issue so that maintainers and the community can discuss the problem and potential solutions before you spend time on an implementation.
50+
- In your PR's description, link to any related issues or pull requests to give reviewers the full context of your change.
51+
- For commit messages, follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.
52+
- For example, if you update documentation for a specific extension, your commit message might be: `docs(extension-name) updated installation documentation`.
53+
- For your PR to be merged:
54+
55+
- You must sign the [Google Contributor License Agreement](https://cla.developers.google.com/clas).
56+
- All tests must pass.
57+
58+
### Features
59+
60+
Before creating pull requests for new features, first file a GitHub Issue describing the reasoning and motivation for the feature. This gives maintainers and the community the opportunity to provide feedback on your idea before implementing it.

auth-mailchimp-sync/extension.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
name: auth-mailchimp-sync
1616
version: 0.1.0
1717
specVersion: v1beta
18-
displayName: Sync with Mailchimp
1918

19+
displayName: Sync with Mailchimp
2020
description:
2121
Adds new users from Firebase Authentication to a specified Mailchimp audience.
2222

2323
license: Apache-2.0
24-
billingRequired: true
24+
2525
sourceUrl: https://github.com/firebase/extensions/tree/master/auth-mailchimp-sync
2626
releaseNotesUrl: https://github.com/firebase/extensions/blob/master/auth-mailchimp-sync/CHANGELOG.md
2727

@@ -39,6 +39,8 @@ contributors:
3939
4040
url: https://github.com/ehesp
4141

42+
billingRequired: true
43+
4244
resources:
4345
- name: addUserToList
4446
type: firebaseextensions.v1beta.function
@@ -51,6 +53,7 @@ resources:
5153
eventTrigger:
5254
eventType: providers/firebase.auth/eventTypes/user.create
5355
resource: projects/${PROJECT_ID}
56+
5457
- name: removeUserFromList
5558
type: firebaseextensions.v1beta.function
5659
description:

codecov.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "40...100"
8+
9+
status:
10+
project:
11+
default: true
12+
13+
comment:
14+
layout: "reach, diff, files"
15+
behavior: once

delete-user-data/extension.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
# limitations under the License.
1414

1515
name: delete-user-data
16-
displayName: Delete User Data
17-
specVersion: v1beta
1816
version: 0.1.3
17+
specVersion: v1beta
1918

19+
displayName: Delete User Data
2020
description:
2121
Deletes data keyed on a userId from Cloud Firestore, Realtime Database, and/or
2222
Cloud Storage when a user deletes their account.
2323

2424
license: Apache-2.0
25-
billingRequired: false
25+
2626
sourceUrl: https://github.com/firebase/extensions/tree/master/delete-user-data
2727
releaseNotesUrl: https://github.com/firebase/extensions/blob/master/delete-user-data/CHANGELOG.md
2828

@@ -40,6 +40,8 @@ contributors:
4040
4141
url: https://github.com/ehesp
4242

43+
billingRequired: false
44+
4345
roles:
4446
- role: datastore.owner
4547
reason: Allows the extension to delete (user) data from Cloud Firestore.

firestore-bigquery-export/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Version 0.1.2
2+
3+
fixed - Added "IF NOT EXISTS" to safely run `fs-bq-schema-views` script multiple times (PR #193).
4+
fixed - Updated BigQuery dependency in `package.json` for the `fs-bq-import-collection` script (issue #192 and PR #197).
5+
16
## Version 0.1.1
27

38
fixed - Fixed occasional duplicate rows created in the BigQuery backup table (issue #101).

firestore-bigquery-export/extension.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
# limitations under the License.
1414

1515
name: firestore-bigquery-export
16-
displayName: Export Collections to BigQuery
16+
version: 0.1.2
1717
specVersion: v1beta
18-
version: 0.1.1
1918

19+
displayName: Export Collections to BigQuery
2020
description:
2121
Sends realtime, incremental updates from a specified Cloud Firestore collection to BigQuery.
2222

2323
license: Apache-2.0
24-
billingRequired: true
24+
2525
sourceUrl: https://github.com/firebase/extensions/tree/master/firestore-bigquery-export
2626
releaseNotesUrl: https://github.com/firebase/extensions/blob/master/firestore-bigquery-export/CHANGELOG.md
2727

@@ -34,6 +34,8 @@ contributors:
3434
3535
url: https://github.com/IanWyszynski
3636

37+
billingRequired: true
38+
3739
apis:
3840
- apiName: bigquery-json.googleapis.com
3941
reason: Mirrors data from your Cloud Firestore collection in BigQuery.

firestore-bigquery-export/firestore-bigquery-change-tracker/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"author": "Jan Wyszynski <[email protected]>",
2323
"license": "Apache-2.0",
2424
"dependencies": {
25-
"@google-cloud/bigquery": "^2.1.0",
25+
"@google-cloud/bigquery": "^4.7.0",
2626
"firebase-admin": "^7.1.1",
2727
"firebase-functions": "^2.2.1",
28-
"lodash": "^4.17.14",
29-
"sql-formatter": "^2.3.3",
3028
"generate-schema": "^2.6.0",
31-
"inquirer": "^6.4.0"
29+
"inquirer": "^6.4.0",
30+
"lodash": "^4.17.14",
31+
"sql-formatter": "^2.3.3"
3232
},
3333
"devDependencies": {
3434
"chai": "^4.2.0",

firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/index.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
FirestoreDocumentChangeEvent,
2525
} from "../tracker";
2626
import * as logs from "../logs";
27-
import { BigQuery } from "@google-cloud/bigquery";
2827

2928
export interface FirestoreBigQueryEventHistoryTrackerConfig {
3029
datasetId: string;
@@ -51,9 +50,6 @@ export class FirestoreBigQueryEventHistoryTracker
5150

5251
async record(events: FirestoreDocumentChangeEvent[]) {
5352
await this.initialize();
54-
const options = {
55-
raw: true,
56-
};
5753
const rows = events.map((event) => {
5854
return {
5955
insertId: event.eventId,
@@ -66,23 +62,23 @@ export class FirestoreBigQueryEventHistoryTracker
6662
},
6763
};
6864
});
69-
await this.insertData(rows, options);
65+
await this.insertData(rows);
7066
}
7167

7268
/**
7369
* Inserts rows of data into the BigQuery raw change log table.
7470
*/
75-
private async insertData(rows: bigquery.RowMetadata[], options: object) {
76-
const payload = {
71+
private async insertData(rows: bigquery.RowMetadata[]) {
72+
const options = {
7773
skipInvalidRows: false,
7874
ignoreUnkownValues: false,
79-
rows: rows,
75+
raw: true,
8076
};
8177
try {
8278
const dataset = this.bq.dataset(this.config.datasetId);
8379
const table = dataset.table(this.rawChangeLogTableName());
8480
logs.dataInserting(rows.length);
85-
await table.insert(payload, options);
81+
await table.insert(rows, options);
8682
logs.dataInserted(rows.length);
8783
} catch (e) {
8884
// Reinitializing in case the destintation table is modified.

0 commit comments

Comments
 (0)