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

WIP - Add firebase integration #13954

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

WIP - Add firebase integration #13954

wants to merge 16 commits into from

Conversation

obecny
Copy link
Collaborator

@obecny obecny commented Oct 11, 2024

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@obecny obecny marked this pull request as draft October 11, 2024 10:53
Copy link
Contributor

github-actions bot commented Oct 11, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.73 KB - -
@sentry/browser - with treeshaking flags 21.52 KB - -
@sentry/browser (incl. Tracing) 35.11 KB - -
@sentry/browser (incl. Tracing, Replay) 71.82 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.26 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.13 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 88.94 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 90.77 KB - -
@sentry/browser (incl. metrics) 26.98 KB - -
@sentry/browser (incl. Feedback) 39.87 KB - -
@sentry/browser (incl. sendFeedback) 27.37 KB - -
@sentry/browser (incl. FeedbackAsync) 32.17 KB - -
@sentry/react 25.48 KB - -
@sentry/react (incl. Tracing) 38.07 KB - -
@sentry/vue 26.87 KB - -
@sentry/vue (incl. Tracing) 36.99 KB - -
@sentry/svelte 22.86 KB - -
CDN Bundle 24.08 KB - -
CDN Bundle (incl. Tracing) 36.92 KB - -
CDN Bundle (incl. Tracing, Replay) 71.58 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 76.92 KB - -
CDN Bundle - uncompressed 70.62 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.61 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 222.13 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 235.35 KB - -
@sentry/nextjs (client) 38.15 KB - -
@sentry/sveltekit (client) 35.71 KB - -
@sentry/node 130.41 KB +0.63% +834 B 🔺
@sentry/node - without tracing 94.3 KB -0.01% -1 B 🔽
@sentry/aws-serverless 105.17 KB - -

View base workflow run

@Lms24 Lms24 self-requested a review October 14, 2024 13:10
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Took a first look. I think this PR is going into a good direction and I think - once we addressed the open todos - we should merge it in and build new features on top of it.

A couple of things I think are worth looking into in the future (i.e. not in this PR):

  • should we patch collection? I'm not entirely sure what the function does but it returns the ref to the document collection so maybe it's interesting?
  • I'd like us to collect more information about the query. Would be great if we could somehow build a query from the individual query composition functions
  • I think it'd be worth to look into firebase auth and file storage but these could definitely come later.

@obecny obecny marked this pull request as ready for review October 24, 2024 15:24
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

E2E test passes locally for me. I'll get back to you on the environment variables in CI.

Had some minor comments/nits but once we get the tests working in CI, I think we're ready to merge.

Comment on lines +106 to +109
expect(transactionEvent.spans![0]).toMatchObject(spanAddDoc);
expect(transactionEvent.spans![1]).toMatchObject(spanSetDocs);
expect(transactionEvent.spans![2]).toMatchObject(spanGetDocs);
expect(transactionEvent.spans![3]).toMatchObject(spanDeleteDoc);
Copy link
Member

Choose a reason for hiding this comment

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

If it turns out that this assertion becomes flaky on CI I think it's perfectly reasonable for us to ensure that all the spans are in the spans array but we don't need to rely on the specific order. We'll reconstruct the span tree in the UI anyway based on the parent/child relations and timestamps.
I think this might be flaky because I'm not sure if our Sentry<>Otel span serialization logic is order-preserving.

# Conflicts:
#	dev-packages/node-integration-tests/package.json
#	packages/node/src/index.ts
#	yarn.lock
deleteDoc,
getDocs,
setDoc,
} from '@firebase/firestore';
Copy link
Member

Choose a reason for hiding this comment

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

Before we merge, let's make sure that this doesn't end up in the .d.ts in any way.

Copy link

codecov bot commented Oct 30, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
640 1 639 31
View the top 1 failed tests by shortest run time
transactions.test.ts should add, set, get and delete document
Stack Traces | 0s run time
transactions.test.ts:93:5 should add, set, get and delete document

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants