Skip to content

Commit

Permalink
Merge pull request #8588 from getsentry/prepare-release/7.59.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 authored Jul 19, 2023
2 parents 8563e39 + ac1e6db commit e2b0dcd
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 25 deletions.
109 changes: 108 additions & 1 deletion .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,107 @@ minVersion: '0.23.1'
changelogPolicy: simple
preReleaseCommand: bash scripts/craft-pre-release.sh
targets:
# NPM Targets
## 1. Base Packages, node or browser SDKs depend on
## 1.1 Types
- name: npm
id: "@sentry/types"
includeNames: /^sentry-types-\d.*\.tgz$/
## 1.2 Utils
- name: npm
id: "@sentry/utils"
includeNames: /^sentry-utils-\d.*\.tgz$/
## 1.3 Core SDK
- name: npm
id: "@sentry/core"
includeNames: /^sentry-core-\d.*\.tgz$/
## 1.4 Tracing package
- name: npm
id: "@sentry-internal/tracing"
includeNames: /^sentry-internal-tracing-\d.*\.tgz$/
## 1.5 Replay package (browser only)
- name: npm
id: "@sentry/replay"
includeNames: /^sentry-replay-\d.*\.tgz$/

## 2. Browser & Node SDKs
- name: npm
id: "@sentry/browser"
includeNames: /^sentry-browser-\d.*\.tgz$/
- name: npm
id: "@sentry/node"
includeNames: /^sentry-node-\d.*\.tgz$/

## 3 Browser-based Packages
- name: npm
id: "@sentry/angular-ivy"
includeNames: /^sentry-angular-ivy-\d.*\.tgz$/
- name: npm
id: "@sentry/angular"
includeNames: /^sentry-angular-\d.*\.tgz$/
- name: npm
id: "@sentry/ember"
includeNames: /^sentry-ember-\d.*\.tgz$/
- name: npm
id: "@sentry/react"
includeNames: /^sentry-react-\d.*\.tgz$/
- name: npm
id: "@sentry/svelte"
includeNames: /^sentry-svelte-\d.*\.tgz$/
- name: npm
id: "@sentry/vue"
includeNames: /^sentry-vue-\d.*\.tgz$/
- name: npm
id: "@sentry/wasm"
includeNames: /^sentry-wasm-\d.*\.tgz$/
- name: npm
id: "@sentry/integrations"
includeNames: /^sentry-integrations-\d.*\.tgz$/

## 4. Node-based Packages
- name: npm
id: "@sentry/serverless"
includeNames: /^sentry-serverless-\d.*\.tgz$/
- name: npm
id: "@sentry/opentelemetry-node"
includeNames: /^sentry-opentelemetry-node-\d.*\.tgz$/

## 5. Fullstack/Meta Frameworks (depending on Node and Browser or Framework SDKs)
- name: npm
id: "@sentry/nextjs"
includeNames: /^sentry-nextjs-\d.*\.tgz$/
- name: npm
id: "@sentry/remix"
includeNames: /^sentry-remix-\d.*\.tgz$/
- name: npm
id: "@sentry/sveltekit"
includeNames: /^sentry-sveltekit-\d.*\.tgz$/
- name: npm
id: "@sentry/gatsby"
includeNames: /^sentry-gatsby-\d.*\.tgz$/

## 6. Other Packages
## 6.1
- name: npm
id: "@sentry-internal/typescript"
includeNames: /^sentry-internal-typescript-\d.*\.tgz$/
- name: npm
id: "@sentry-internal/eslint-plugin-sdk"
includeNames: /^sentry-internal-eslint-plugin-sdk-\d.*\.tgz$/
## 6.2
- name: npm
id: "@sentry-internal/eslint-config-sdk"
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/

## 7. Deprecated packages we still release (but no packages depend on them anymore)
- name: npm
id: "@sentry/hub"
includeNames: /^sentry-hub-\d.*\.tgz$/
- name: npm
id: "@sentry/tracing"
includeNames: /^sentry-tracing-\d.*\.tgz$/

# AWS Lambda Layer target
- name: aws-lambda-layer
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha)\.\d+)?\.zip$/
layerName: SentryNodeServerlessSDK
Expand All @@ -14,16 +115,22 @@ targets:
- nodejs16.x
- nodejs18.x
license: MIT

# CDN Bundle Target
- name: gcs
id: "browser-cdn-bundles"
includeNames: /.*\.js.*$/
bucket: sentry-js-sdk
paths:
- path: /{{version}}/
metadata:
cacheControl: 'public, max-age=31536000'

# Github Release Target
- name: github
includeNames: /^sentry-.*$/
- name: npm

# Sentry Release Registry Target
- name: registry
sdks:
'npm:@sentry/browser':
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.59.3

- fix(browser): 0 is a valid index (#8581)
- fix(nextjs): Ensure Webpack plugin is available after dynamic require (#8584)
- types(browser): Add browser profiling client options (#8565)

## 7.59.2

No changes. This release was published to fix publishing issues with 7.59.0 and 7.59.1.
Expand Down
9 changes: 7 additions & 2 deletions docs/new-sdk-release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ When you’re ready to make the first release, there are a couple of steps that
- [ ] 1) If not yet done, be sure to remove the `private: true` property from your SDK’s `package.json`. Additionally, ensure that `"publishConfig": {"access": "public"}` is set.
- [ ] 2) Make sure that the new SDK is **not added** in`[craft.yml](https://github.com/getsentry/sentry-javascript/blob/master/.craft.yml)` as a target for the **Sentry release registry**\
*Once this is added, craft will try to publish an entry in the next release which does not work and caused failed release runs in the past*
- [ ] 3) Make sure the new SDK is not excluded from the github & npm targets in `.craft.yml`
- [ ] 4) Cut a new release (as usual, via GH release action and Craft)
- [ ] 3) Add an `npm` target in `craft.yml` for the new package. Make sure to insert it in the right place, after all the Sentry dependencies of your package but before packages that depend on your new package (if applicable).
```yml
- name: npm
id: npm:@sentry/[yourPackage]
includeNames: /^sentry-[yourPackage]-\d.*\.tgz$/
```
- [ ] 4) Cut a new release (as usual, see [Publishing Release](https://github.com/getsentry/sentry-javascript/blob/develop/docs/publishing-a-release.md))
### After the Release
Expand Down
5 changes: 4 additions & 1 deletion packages/browser/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Scope } from '@sentry/core';
import { BaseClient, SDK_VERSION } from '@sentry/core';
import type {
BrowserClientProfilingOptions,
BrowserClientReplayOptions,
ClientOptions,
Event,
Expand All @@ -23,7 +24,9 @@ import { createUserFeedbackEnvelope } from './userfeedback';
* Configuration options for the Sentry Browser SDK.
* @see @sentry/types Options for more information.
*/
export type BrowserOptions = Options<BrowserTransportOptions> & BrowserClientReplayOptions;
export type BrowserOptions = Options<BrowserTransportOptions> &
BrowserClientReplayOptions &
BrowserClientProfilingOptions;

/**
* Configuration options for the Sentry Browser SDK Client class
Expand Down
6 changes: 3 additions & 3 deletions packages/browser/src/profiling/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ export function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profi
if (profile.frames[stackTop.frameId] === undefined) {
profile.frames[stackTop.frameId] = {
function: frame.name,
file: frame.resourceId ? input.resources[frame.resourceId] : undefined,
line: frame.line,
column: frame.column,
abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined,
lineno: frame.line,
colno: frame.column,
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/core/test/lib/transports/offline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ describe('makeOfflineTransport', () => {
expect(getCalls()).toEqual([]);
});

// eslint-disable-next-line jest/no-disabled-tests
it.skip(
'Follows the Retry-After header',
async () => {
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-deprecation": "^1.1.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-jsdoc": "^30.0.3",
"eslint-plugin-simple-import-sort": "^5.0.3"
},
Expand Down
20 changes: 19 additions & 1 deletion packages/eslint-config-sdk/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = {
},
},
{
// Configuration for test files
// Configuration for files in test directories
env: {
jest: true,
},
Expand All @@ -186,6 +186,24 @@ module.exports = {
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
},
},
{
// Configuration only for test files (this won't apply to utils or other files in test directories)
plugins: ['jest'],
env: {
jest: true,
},
files: ['test.ts', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'],
rules: {
// Prevent permanent usage of `it.only`, `fit`, `test.only` etc
// We want to avoid debugging leftovers making their way into the codebase
'jest/no-focused-tests': 'error',

// Prevent permanent usage of `it.skip`, `xit`, `test.skip` etc
// We want to avoid debugging leftovers making their way into the codebase
// If there's a good reason to skip a test (e.g. bad flakiness), just add an ignore comment
'jest/no-disabled-tests': 'error',
},
},
{
// Configuration for config files like webpack/rollup
files: ['*.config.js'],
Expand Down
24 changes: 13 additions & 11 deletions packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* eslint-disable max-lines */
import { getSentryRelease } from '@sentry/node';
import { arrayify, dropUndefinedKeys, escapeStringForRegex, loadModule, logger } from '@sentry/utils';
import type SentryCliPlugin from '@sentry/webpack-plugin';
import * as chalk from 'chalk';
import * as fs from 'fs';
import * as path from 'path';
Expand Down Expand Up @@ -312,15 +313,16 @@ export function constructWebpackConfigFunction(
// without, the option to use `hidden-source-map` only applies to the client-side build.
newConfig.devtool = userSentryOptions.hideSourceMaps && !isServer ? 'hidden-source-map' : 'source-map';

const SentryWebpackPlugin = loadModule('@sentry/webpack-plugin');

newConfig.plugins = newConfig.plugins || [];
newConfig.plugins.push(
// @ts-expect-error - this exists, the dynamic import just doesn't know about it
new SentryWebpackPlugin(
getWebpackPluginOptions(buildContext, userSentryWebpackPluginOptions, userSentryOptions),
),
);
const SentryWebpackPlugin = loadModule<SentryCliPlugin>('@sentry/webpack-plugin');
if (SentryWebpackPlugin) {
newConfig.plugins = newConfig.plugins || [];
newConfig.plugins.push(
// @ts-expect-error - this exists, the dynamic import just doesn't know about it
new SentryWebpackPlugin(
getWebpackPluginOptions(buildContext, userSentryWebpackPluginOptions, userSentryOptions),
),
);
}
}
}

Expand Down Expand Up @@ -769,10 +771,10 @@ function shouldEnableWebpackPlugin(buildContext: BuildContext, userSentryOptions
// architecture-specific version of the `sentry-cli` binary. If `yarn install`, `npm install`, or `npm ci` are run
// with the `--ignore-scripts` option, this will be blocked and the missing binary will cause an error when users
// try to build their apps.
const SentryWebpackPlugin = loadModule('@sentry/webpack-plugin');
const SentryWebpackPlugin = loadModule<SentryCliPlugin>('@sentry/webpack-plugin');

// @ts-expect-error - this exists, the dynamic import just doesn't know it
if (!SentryWebpackPlugin.cliBinaryExists()) {
if (!SentryWebpackPlugin || !SentryWebpackPlugin.cliBinaryExists()) {
// eslint-disable-next-line no-console
console.error(
`${chalk.red('error')} - ${chalk.bold('Sentry CLI binary not found.')} Source maps will not be uploaded.\n`,
Expand Down
4 changes: 4 additions & 0 deletions packages/node/test/integrations/undici.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
});

// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
// eslint-disable-next-line jest/no-disabled-tests
it.skip('attaches the sentry trace and baggage headers if there is an active span', async () => {
expect.assertions(3);

Expand All @@ -214,6 +215,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
});

// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
// eslint-disable-next-line jest/no-disabled-tests
it.skip('attaches the sentry trace and baggage headers if there is no active span', async () => {
const scope = hub.getScope();

Expand All @@ -228,6 +230,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
});

// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
// eslint-disable-next-line jest/no-disabled-tests
it.skip('attaches headers if `shouldCreateSpanForRequest` does not create a span using propagation context', async () => {
const transaction = hub.startTransaction({ name: 'test-transaction' }) as Transaction;
const scope = hub.getScope();
Expand Down Expand Up @@ -259,6 +262,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
});

// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
// eslint-disable-next-line jest/no-disabled-tests
it.skip('uses tracePropagationTargets', async () => {
const transaction = hub.startTransaction({ name: 'test-transaction' }) as Transaction;
hub.getScope().setSpan(transaction);
Expand Down
8 changes: 8 additions & 0 deletions packages/types/src/browseroptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ export type BrowserClientReplayOptions = {
*/
replaysOnErrorSampleRate?: number;
};

export type BrowserClientProfilingOptions = {
/**
* The sample rate for profiling
* 1.0 will profile all transactions and 0 will profile none.
*/
profilesSampleRate?: number;
};
2 changes: 1 addition & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@ export type { WrappedFunction } from './wrappedfunction';
export type { Instrumenter } from './instrumenter';
export type { HandlerDataFetch, HandlerDataXhr, SentryXhrData, SentryWrappedXMLHttpRequest } from './instrument';

export type { BrowserClientReplayOptions } from './browseroptions';
export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './browseroptions';
export type { CheckIn, MonitorConfig, SerializedCheckIn } from './checkin';
5 changes: 3 additions & 2 deletions packages/types/src/profiling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ export type ThreadCpuStack = FrameId[];
export type ThreadCpuFrame = {
function: string;
file?: string;
line?: number;
column?: number;
lineno?: number;
colno?: number;
abs_path?: string;
};

export interface ThreadCpuProfile {
Expand Down
Loading

0 comments on commit e2b0dcd

Please sign in to comment.