getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.23k stars 4.21k forks source link

ref(flags): Use SDK util functions for tracking feature flags #81159

Open billyvg opened 14 hours ago

billyvg commented 14 hours ago

This uses the util functions from the SDK beta to track feature flags in our SaaS. I do not think these will be what we ship with, but this shows what APIs are needed.

billyvg commented 14 hours ago

@cmanallen @aliu39 Thinking more and more that we should move what we can into core and out of the integrations.

codecov[bot] commented 14 hours ago

:x: 8 Tests Failed:

Tests completed Failed Passed Skipped
8245 8 8237 0
View the top 3 failed tests by shortest run time > > ```python > FeatureObserver observeOrganizationFlags should not change the functionality of `includes` > ``` > >
Stack Traces | 0.003s run time > > > > > ```python > > TypeError: inst.getFeatureFlags is not a function > > at Object. (.../app/utils/featureObserver.spec.ts:161:19) > > at Promise.then.completed (.../jest-circus/build/utils.js:298:28) > > at new Promise () > > at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10) > > at _callCircusTest (.../jest-circus/build/run.js:316:40) > > at processTicksAndRejections (node:internal/process/task_queues:105:5) > > at _runTest (.../jest-circus/build/run.js:252:3) > > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9) > > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9) > > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9) > > at run (.../jest-circus/build/run.js:71:3) > > at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) > > at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19) > > at runTestInternal (.../jest-runner/build/runTest.js:367:16) > > at runTest (.../jest-runner/build/runTest.js:444:34) > > at Object.worker (.../jest-runner/build/testWorker.js:106:12) > > ``` > >
FeatureObserver observeProjectFlags and observeOrganizationFlags should add recently evaluated org and proj flags to the flag queue
Stack Traces | 0.003s run time > > ```python > TypeError: inst.getFeatureFlags is not a function > at Object. (.../app/utils/featureObserver.spec.ts:244:19) > at Promise.then.completed (.../jest-circus/build/utils.js:298:28) > at new Promise () > at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10) > at _callCircusTest (.../jest-circus/build/run.js:316:40) > at processTicksAndRejections (node:internal/process/task_queues:105:5) > at _runTest (.../jest-circus/build/run.js:252:3) > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9) > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9) > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9) > at run (.../jest-circus/build/run.js:71:3) > at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) > at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19) > at runTestInternal (.../jest-runner/build/runTest.js:367:16) > at runTest (.../jest-runner/build/runTest.js:444:34) > at Object.worker (.../jest-runner/build/testWorker.js:106:12) > ```
FeatureObserver observeProjectFlags should add recently evaluated proj flags to the flag queue
Stack Traces | 0.003s run time > > ```python > TypeError: inst.getFeatureFlags is not a function > at Object. (.../app/utils/featureObserver.spec.ts:184:19) > at Promise.then.completed (.../jest-circus/build/utils.js:298:28) > at new Promise () > at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10) > at _callCircusTest (.../jest-circus/build/run.js:316:40) > at processTicksAndRejections (node:internal/process/task_queues:105:5) > at _runTest (.../jest-circus/build/run.js:252:3) > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9) > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9) > at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9) > at run (.../jest-circus/build/run.js:71:3) > at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) > at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19) > at runTestInternal (.../jest-runner/build/runTest.js:367:16) > at runTest (.../jest-runner/build/runTest.js:444:34) > at Object.worker (.../jest-runner/build/testWorker.js:106:12) > ```

To view more test analytics, go to the Test Analytics Dashboard Got feedback? Let us know on Github

billyvg commented 14 hours ago

Oops need to update tests