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

meta(changelog): Update changelog for 7.89.0 #9915

Merged
merged 35 commits into from
Dec 19, 2023
Merged

Commits on Dec 14, 2023

  1. Merge pull request #9853 from getsentry/master

    [Gitflow] Merge master into develop
    github-actions[bot] committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    3324a90 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    383c816 View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2023

  1. ref: Use getCurrentScope()/hub.getScope() instead of `configureSc…

    …ope()` (#9846)
    
    In preparation for
    #9841, as we want
    to deprecate `configureScope`, refactor our own usage of this away.
    
    I used a new transformer of sentry-migr8 for this, which did most of the
    heavy lifting. I only needed to fix the block usage (which is more a
    stylistic issue than an actual problem).
    
    In some follow up, I'll also create a migr8 transform to refactor hub
    usage away, to e.g. refactor `getCurrentHub().getScope()` to
    `getCurrentScope()` etc. But for now this is OK I think.
    mydea committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    1e8d2b3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da8c9c3 View commit details
    Browse the repository at this point in the history
  3. fix(utils): Do not use Event type in worldwide (#9864)

    As that is browser only.
    
    Closes #9860
    mydea committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    30bb8b5 View commit details
    Browse the repository at this point in the history
  4. ref: Use getCurrentScope() / getClient instead of hub.xxx (#9862)

    Except for places where we are really passing a `hub` in, not using
    `getCurrentHub()`.
    mydea committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    ffc4181 View commit details
    Browse the repository at this point in the history
  5. fix(utils): Update eventFromUnknownInput to avoid scope pollution &…

    … `getCurrentHub` (#9868)
    
    Instead we can pass a client directly, and I refactored the method to
    avoid setting extra on the scope, and just set it on the event directly
    - as this is also kind of leaking right now, because the extra may also
    be applied to other events using the same scope.
    mydea committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    5bc9a38 View commit details
    Browse the repository at this point in the history
  6. ref(node): Refactor node integrations to use processEvent (#9018)

    This refactors Node integrations to use `processEvent`.
    
    Missing is the LocalVariables integration, as that is more complicated
    and may need to be refactored in a different way to properly work.
    mydea committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    72c3488 View commit details
    Browse the repository at this point in the history
  7. fix(utils): Support crypto.getRandomValues in old Chromium versions (#…

    …9251)
    
    Here is my proposal to fix `getRandomByte` function throwing an error
    due to `crypto.getRandomValues` returning `undefined` in old browser
    engines like Chromium 23.
    
    This error could be fixed as well by using a polyfill in every project
    that imports and uses Sentry but, since the change of this PR only
    involved keeping the `Uint8Array` reference in a variable, I thought it
    would be worth it to give it a try.
    jghinestrosa committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    e128936 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    53724c5 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. Configuration menu
    Copy the full SHA
    12c146b View commit details
    Browse the repository at this point in the history
  2. ref: Pass client instead of hub to isSentryRequestUrl (#9869)

    Step by step, eradicating the hub...
    
    Note: I haven't found a way to mark an attribute type of a function as
    deprecated 😬 I think it's OK here, but generally a bit
    annoying/tricky...
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    db4bef1 View commit details
    Browse the repository at this point in the history
  3. feat(core): Update withScope to return callback return value (#9866)

    To align this with OpenTelemetry and make some things possible that are
    currently not easily doable without `pushScope` / `popScope`.
    
    Noticed this because currently it's not easily possible to e.g. use
    `withScope` in places like
    [this](#9862 (comment)).
    
    
    
    This should be backwards compatible because any code that previously
    relied on this returning `void` should still work.
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    f2a4caa View commit details
    Browse the repository at this point in the history
  4. feat(core): Add type & utility for function-based integrations (#9818)

    This PR adds new types for function-based integrations, that eventually
    (in v8) should fully replace the class-based functions.
    
    This also introduces a small helper function to make writing such
    integrations easier (as we need to set an id/name etc. on the
    integration). With this, you can write an integration like this:
    
    ```ts
    const inboundFiltersIntegration = makeIntegrationFn(
      'InboundFilters', 
      (options: Partial<InboundFiltersOptions>) => {
      return {
        processEvent(event, _hint, client) {
          const clientOptions = client.getOptions();
          const mergedOptions = _mergeOptions(options, clientOptions);
          return _shouldDropEvent(event, mergedOptions) ? null : event;
        }
      }
    });
    ```
    
    And you get a fully typed integration ready to go!
    
    For backwards compatibility, and so that we can actually start
    converting integrations in v7 already, this PR also adds a small utility
    `convertIntegrationFnToClass()` to convert such an integration to the
    "current" integration class syntax.
    
    So we can actually already start porting integrations over like this:
    
    ```js
    /** Inbound filters configurable by the user */
    // eslint-disable-next-line deprecation/deprecation
    export const InboundFilters = convertIntegrationFnToClass(inboundFiltersIntegration);
    ```
    
    Then, in v8 we only have to remove all the `convertIntegrationFnToClass`
    calls, export the integration functions directly, and update the overall
    integration types which can be passed to `init()` etc.
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    01a4cc9 View commit details
    Browse the repository at this point in the history
  5. feat(node): Add Hapi Integration (#9539)

    Resolves: #9344 
    
    Adds a new node integration for Hapi framework.
    
    Also exports a Hapi plugin to capture errors when the tracing
    instrumentation from `node-experimental` is used.
    
    Can be used with `node-experimental` ([Sample Error
    Event](https://sentry-sdks.sentry.io/issues/4624554372/?project=4506162118983680&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=1h&stream_index=0))
    like:
    
    ```typescript
    const Sentry = require('@sentry/node-experimental');
    
    Sentry.init({
      dsn: '__DSN__',
      tracesSampleRate: 1.0,
    });
    
    const Hapi = require('@hapi/hapi');
    
    const init = async () => {
        const server = Hapi.server({
            port: 3000,
            host: 'localhost'
        });
    
        await server.register(Sentry.hapiErrorPlugin)
    
        server.route({
            method: 'GET',
            path: '/',
            handler: (request, h) => {
                throw new Error('My Hapi Sentry error!');
            }
        });
    
        await server.start();
    };
    ```
    
    Also can be used from `@sentry/node` with tracing ([Errored
    Transaction](https://sentry-sdks.sentry.io/performance/node-hapi:8a633340fc724472bb44aae4c7572827/?project=4506162118983680&query=&referrer=performance-transaction-summary&statsPeriod=1h&transaction=%2F&unselectedSeries=p100%28%29&unselectedSeries=avg%28%29),
    [Successful
    Transaction](https://sentry-sdks.sentry.io/performance/node-hapi:deeb79f0c6bf41c68c776833c4629e6e/?project=4506162118983680&query=&referrer=performance-transaction-summary&statsPeriod=1h&transaction=%2F&unselectedSeries=p100%28%29&unselectedSeries=avg%28%29))
    and error tracking
    ([Event](https://sentry-sdks.sentry.io/issues/4626919129/?project=4506162118983680&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=1h&stream_index=0))
    like:
    
    ```typescript
    'use strict';
    
    const Sentry = require('@sentry/node');
    const Hapi = require('@hapi/hapi');
    
    
    const init = async () => {
        const server = Hapi.server({
            port: 3000,
            host: 'localhost'
        });
    
        Sentry.init({
          dsn: '__DSN__',
          tracesSampleRate: 1.0,
          integrations: [
            new Sentry.Integrations.Hapi({server}),
          ],
          debug: true,
        });
    
        server.route({
            method: 'GET',
            path: '/',
            handler: (request, h) => {
                return 'Hello World!';
            }
        });
    
        await server.start();
    };
    ```
    onurtemizkan committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    c0c5eca View commit details
    Browse the repository at this point in the history
  6. ref: Use addBreadcrumb directly & allow to pass hint (#9867)

    Instead of using `hub.addBreadcrumb()`.
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    35906d0 View commit details
    Browse the repository at this point in the history
  7. build: Fix linting (#9888)

    Damn, merged a PR without rebasing it first, it did not have the new
    biome rules yet 😅 so develop is failing linting right now...
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    f922414 View commit details
    Browse the repository at this point in the history
  8. ref(serverless): Avoid using pushScope (#9883)

    This is the only place I've found where we use `pushScope`, and since we
    updated the `withScope` signature we can rewrite this.
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    e1d3633 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ada32b2 View commit details
    Browse the repository at this point in the history
  10. feat(core): Deprecate configureScope (#9887)

    Instead, users should directly access the current scope via
    `getCurrentScope()`.
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    0efdb21 View commit details
    Browse the repository at this point in the history
  11. feat(core): Deprecate pushScope & popScope (#9890)

    This deprecates using `pushScope` / `popScope` on the hub.
    mydea committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    b27c236 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f121585 View commit details
    Browse the repository at this point in the history
  13. feat(deno): Support Deno.CronSchedule for cron jobs (#9880)

    This PR adds support for `Deno.CronSchedule`. Since the `CronSchedule`
    type cannot be fully expressed by the Sentry `IntervalSchedule`, I
    instead copied the Deno code to convert to `CrontabSchedule`.
    
    I also added `checkinMargin: 1` since the Deno docs state that on Deno
    Deploy, crons can be up to 1 minute late.
    timfish committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    8fb1a2f View commit details
    Browse the repository at this point in the history
  14. feat(replay): Add canvas.type setting (#9877)

    Defaults to `webp` instead of `png`. This will also allow `quality` to
    work.
    
    Closes getsentry/team-replay#326
    billyvg committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    84299d0 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. feat(node-experimental): Update to new Scope APIs (#9799)

    This PR introduces the new scope APIs to node-experimental.
    
    * `getCurrentHub()` is still around, but just a mock hub that uses other
    methods under the hood.
    * Instead, there are the following new APIs:
      * `getCurrentScope()`
      * `getIsolationScope()`
      * `getGlobalScope()`  
      * `withIsolationScope()`
    
    Mostly existing tests should cover this OK. The main change here is that
    for spans, since we use the isolation scope any tags etc. added while
    the span is running are _also_ added to the resulting event.
    
    For POTEL, we automatically set an isolation scope whenever a
    http.server span is generated.
    
    Replaces #9419
    
    ---------
    
    Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
    mydea and lforst committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    605fd50 View commit details
    Browse the repository at this point in the history
  2. ref(deno): Refactor deno integration to avoid setupOnce (#9900)

    Slowly getting rid of `getCurrentHub()`...
    mydea committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    32f4bf0 View commit details
    Browse the repository at this point in the history
  3. ref(browser): Refactor browser integrations to avoid setupOnce (#9898)

    Also a small core refactor...
    mydea committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    91a6b4e View commit details
    Browse the repository at this point in the history
  4. ref(node): Refactor LocalVariables integration to avoid setupOnce (#…

    …9897)
    
    Slowly getting rid of `getCurrentHub()`...
    mydea committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    c9552a4 View commit details
    Browse the repository at this point in the history
  5. chore(sveltekit): Add SvelteKit 2.0 to peer dependencies (#9861)

    Setting the range to `1.x || 2.x` to include kit 2.0
    Lms24 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    4e0c460 View commit details
    Browse the repository at this point in the history
  6. fix(sveltekit): Add conditional exports (#9872)

    Looks like Vite 5 module resolution for `@sentry/sveltekit` only works
    with defining conditional exports. Tested this locally with a Sverdle
    kit@1, kit@2 and the syntax website.
    Lms24 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    6d32228 View commit details
    Browse the repository at this point in the history
  7. fix(remix): Do not capture thrown redirect responses. (#9909)

    Skips capturing all responses < 500 that end up in `captureRemixServerException`.
    onurtemizkan committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    a856913 View commit details
    Browse the repository at this point in the history
  8. test(sveltekit): Add SvelteKit 2.0 E2E test app (#9873)

    adds a Sveltekit 2.0 E2E test application. Currently, we only
    test building. This shows that with #9872, our SDK works in SvelteKit
    2.0. We should however add actual tests to both Kit 1.x and 2.x test
    apps.
    Lms24 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    31c769c View commit details
    Browse the repository at this point in the history
  9. ref(sveltekit): Improve SvelteKit 2.0 404 server error handling (#9901)

    Improve our logic to filter out "Not Found" errors in our
    server-side `handleError` hook wrapper:
    
    - We now use SvelteKit 2.0 - native [error
    properties](https://kit.svelte.dev/docs/migrating-to-sveltekit-2#improved-error-handling)
    (`status` ~and `message`~) to check for "Not Found" errors
    - Adjusted types for type safety and backwards compatibility with
    SvelteKit 1.x where the ~two properties~ property don't exist.
    - Updated Sveltekit to 2.0 in our dev dependency to work with latest
    types.
    Lms24 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    cef3621 View commit details
    Browse the repository at this point in the history
  10. fix(sveltekit): Avoid capturing 404 errors on client side (#9902)

    Looks like 404 errors weren't passed to the client side `handleError`
    hook in Kit 1.x but in 2.x they're now passed into the hook. This means,
    we need to filter them out.
    Lms24 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    cf773fc View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9f173e1 View commit details
    Browse the repository at this point in the history