Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket filtering in the functions emulator #3893

Merged
merged 10 commits into from Dec 8, 2021

Conversation

colerogers
Copy link
Contributor

@colerogers colerogers commented Nov 9, 2021

Feature change to add bucket filtering to the functions emulator from storage events. Checks if proto.data.bucket exists in the multicast handler and appends additional content to the trigger key. This change includes a set of trigger integration tests.

@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label Nov 9, 2021
Copy link
Contributor

@taeold taeold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

scripts/triggers-end-to-end-tests/functions/index.js Outdated Show resolved Hide resolved
scripts/triggers-end-to-end-tests/functions/index.js Outdated Show resolved Hide resolved
scripts/triggers-end-to-end-tests/tests.ts Outdated Show resolved Hide resolved
@colerogers colerogers marked this pull request as ready for review November 24, 2021 23:14
Copy link
Contributor

@taeold taeold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but would love to have @abeisgoat review.

expect(test.storageBucketV2MetadataTriggerCount).to.equal(1);
expect(test.storageBucketDeletedTriggerCount).to.equal(0);
expect(test.storageBucketV2DeletedTriggerCount).to.equal(0);
test.resetCounts();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aside* I'd like to see this function be called in afterEach hook, but I see that this isn't possible due to the way the test cases are structured today :/.

@abeisgoat
Copy link
Contributor

Love the comprehensive tests, looks good to me.

@colerogers colerogers merged commit ee79504 into master Dec 8, 2021
@colerogers colerogers deleted the colerogers.emulator-bucket-filter branch December 8, 2021 20:33
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
* added filtering

* change to use headers

* using data attribute instead of header & adding integration tests

* adding default-bucket into tests

* local testing keeps failing, trying again on github workflows....

* removed 'default-bucket', added reset counter to framework, and finally fixed the tests

* add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA. perf-h1-2022
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants