Skip to content

Commit

Permalink
Merge branch 'develop' into timfish/fix/dont-overwrite-local-variables
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish authored Sep 12, 2024
2 parents 1662902 + 1664dc7 commit b3e198a
Show file tree
Hide file tree
Showing 72 changed files with 623 additions and 255 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/project-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: "Automation: Update GH Project"
on:
pull_request:
types:
- closed
- opened
- reopened
- ready_for_review
- converted_to_draft

jobs:
# Check if PR is in project
check_project:
name: Check if PR is in project
runs-on: ubuntu-latest
steps:
- name: Check if PR is in project
continue-on-error: true
id: check_project
uses: github/update-project-action@f980378bc179626af5b4e20ec05ec39c7f7a6f6d
with:
github_token: ${{ secrets.GH_PROJECT_AUTOMATION }}
organization: getsentry
project_number: 31
content_id: ${{ github.event.pull_request.node_id }}
field: Status
operation: read

- name: If project field is read, set is_in_project to 1
if: steps.check_project.outputs.field_read_value
id: is_in_project
run: echo "is_in_project=1" >> "$GITHUB_OUTPUT"

outputs:
is_in_project: ${{ steps.is_in_project.outputs.is_in_project || '0' }}

# When a PR is a draft, it should go into "In Progress"
mark_as_in_progress:
name: "Mark as In Progress"
needs: check_project
if: |
needs.check_project.outputs.is_in_project == '1'
&& (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'converted_to_draft')
&& github.event.pull_request.draft == true
runs-on: ubuntu-latest
steps:
- name: Update status to in_progress
uses: github/update-project-action@f980378bc179626af5b4e20ec05ec39c7f7a6f6d
with:
github_token: ${{ secrets.GH_PROJECT_AUTOMATION }}
organization: getsentry
project_number: 31
content_id: ${{ github.event.pull_request.node_id }}
field: Status
value: "🏗 In Progress"

# When a PR is not a draft, it should go into "In Review"
mark_as_in_review:
name: "Mark as In Review"
needs: check_project
if: |
needs.check_project.outputs.is_in_project == '1'
&& (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'ready_for_review')
&& github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Update status to in_review
id: update_status
uses: github/update-project-action@f980378bc179626af5b4e20ec05ec39c7f7a6f6d
with:
github_token: ${{ secrets.GH_PROJECT_AUTOMATION }}
organization: getsentry
project_number: 31
content_id: ${{ github.event.pull_request.node_id }}
field: Status
value: "👀 In Review"

# By default, closed PRs go into "Ready for Release"
# But if they are closed without merging, they should go into "Done"
mark_as_done:
name: "Mark as Done"
needs: check_project
if: |
needs.check_project.outputs.is_in_project == '1'
&& github.event.action == 'closed' && github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- name: Update status to done
id: update_status
uses: github/update-project-action@f980378bc179626af5b4e20ec05ec39c7f7a6f6d
with:
github_token: ${{ secrets.GH_PROJECT_AUTOMATION }}
organization: getsentry
project_number: 31
content_id: ${{ github.event.pull_request.node_id }}
field: Status
value: "✅ Done"

32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@

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

## 8.30.0

### Important Changes

- _feat(node): Add `kafkajs` integration (#13528)_

This release adds a new integration that instruments `kafkajs` library with spans and traces. This integration is
automatically enabled by default, but can be included with the `Sentry.kafkaIntegration()` import.

```js
Sentry.init({
integrations: [Sentry.kafkaIntegration()],
});
```

### Other Changes

- feat(core): Allow adding measurements without global client (#13612)
- feat(deps): Bump @opentelemetry/instrumentation-undici from 0.5.0 to 0.6.0 (#13622)
- feat(deps): Bump @sentry/cli from 2.33.0 to 2.35.0 (#13624)
- feat(node): Use `@opentelemetry/instrumentation-undici` for fetch tracing (#13485)
- feat(nuxt): Add server config to root folder (#13583)
- feat(otel): Upgrade @opentelemetry/semantic-conventions to 1.26.0 (#13631)
- fix(browser): check supportedEntryTypes before caling the function (#13541)
- fix(browser): Ensure Standalone CLS span timestamps are correct (#13649)
- fix(nextjs): Widen removal of 404 transactions (#13628)
- fix(node): Remove ambiguity and race conditions when matching local variables to exceptions (#13501)
- fix(node): Update OpenTelemetry instrumentation package for solidstart and opentelemetry (#13640)
- fix(node): Update OpenTelemetry instrumentation package for solidstart and opentelemetry (#13642)
- fix(vue): Ensure Vue `trackComponents` list matches components with or without `<>` (#13543)
- ref(profiling): Conditionally shim cjs globals (#13267)

Work in this release was contributed by @Zen-cronic and @odanado. Thank you for your contributions!

## 8.29.0
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "8.29.0",
"version": "8.30.0",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "^1.44.1",
"@sentry-internal/rrweb": "2.11.0",
"@sentry/browser": "8.29.0",
"@sentry/browser": "8.30.0",
"axios": "1.6.7",
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ sentryTest('should set extras from multiple consecutive calls', async ({ getLoca
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.message).toBe('consecutive_calls');
expect(eventData.extra).toMatchObject({ extra: [], Infinity: 2, null: null, obj: { foo: ['bar', 'baz', 1] } });
expect(eventData.extra).toMatchObject({
extra: [],
Infinity: 2,
null: '[Infinity]',
obj: { foo: ['bar', 'baz', 1] },
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,44 @@ sentryTest("doesn't send further CLS after the first page hide", async ({ getLoc
// a timeout or something similar.
await navigationTxnPromise;
});

sentryTest('CLS span timestamps are set correctly', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

const eventData = await getFirstSentryEnvelopeRequest<SentryEvent>(page, url);

expect(eventData.type).toBe('transaction');
expect(eventData.contexts?.trace?.op).toBe('pageload');
expect(eventData.timestamp).toBeDefined();

const pageloadEndTimestamp = eventData.timestamp!;

const spanEnvelopePromise = getMultipleSentryEnvelopeRequests<SpanEnvelope>(
page,
1,
{ envelopeType: 'span' },
properFullEnvelopeRequestParser,
);

await triggerAndWaitForLayoutShift(page);

await hidePage(page);

const spanEnvelope = (await spanEnvelopePromise)[0];
const spanEnvelopeItem = spanEnvelope[1][0][1];

expect(spanEnvelopeItem.start_timestamp).toBeDefined();
expect(spanEnvelopeItem.timestamp).toBeDefined();

const clsSpanStartTimestamp = spanEnvelopeItem.start_timestamp!;
const clsSpanEndTimestamp = spanEnvelopeItem.timestamp!;

// CLS performance entries have no duration ==> start and end timestamp should be the same
expect(clsSpanStartTimestamp).toEqual(clsSpanEndTimestamp);

// We don't really care that they are very close together but rather about the order of magnitude
// Previously, we had a bug where the timestamps would be significantly off (by multiple hours)
// so we only ensure that this bug is fixed. 60 seconds should be more than enough.
expect(clsSpanStartTimestamp - pageloadEndTimestamp).toBeLessThan(60);
expect(clsSpanStartTimestamp).toBeGreaterThan(pageloadEndTimestamp);
});
2 changes: 1 addition & 1 deletion dev-packages/bundle-analyzer-scenarios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/bundle-analyzer-scenarios",
"version": "8.29.0",
"version": "8.30.0",
"description": "Scenarios to test bundle analysis with",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/clear-cache-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/clear-cache-gh-action",
"description": "An internal Github Action to clear GitHub caches.",
"version": "8.29.0",
"version": "8.30.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/e2e-tests",
"version": "8.29.0",
"version": "8.30.0",
"license": "MIT",
"private": true,
"scripts": {
Expand All @@ -14,7 +14,7 @@
"test:prepare": "ts-node prepare.ts",
"test:validate": "run-s test:validate-configuration test:validate-test-app-setups",
"clean": "rimraf tmp node_modules pnpm-lock.yaml && yarn clean:test-applications",
"clean:test-applications": "rimraf test-applications/**/{node_modules,dist,build,.next,.sveltekit,pnpm-lock.yaml} .last-run.json && pnpm store prune"
"clean:test-applications": "rimraf --glob test-applications/**/{node_modules,dist,build,.next,.sveltekit,pnpm-lock.yaml} .last-run.json && pnpm store prune"
},
"devDependencies": {
"@types/glob": "8.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('Should emit a span for a generateMetadata() function invokation', async ({
expect(transaction.spans).toContainEqual(
expect.objectContaining({
description: 'generateMetadata /generation-functions/page',
origin: 'manual',
origin: 'auto',
parent_span_id: expect.any(String),
span_id: expect.any(String),
status: 'ok',
Expand Down Expand Up @@ -74,7 +74,7 @@ test('Should send a transaction event for a generateViewport() function invokati
expect((await transactionPromise).spans).toContainEqual(
expect.objectContaining({
description: 'generateViewport /generation-functions/page',
origin: 'manual',
origin: 'auto',
parent_span_id: expect.any(String),
span_id: expect.any(String),
status: 'ok',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Sentry.init({
dsn: useRuntimeConfig().public.sentry.dsn,
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
trackComponents: true,
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { expect, test } from '@nuxt/test-utils/playwright';
import { waitForTransaction } from '@sentry-internal/test-utils';
import type { Span } from '@sentry/nuxt';

test('sends a pageload root span with a parameterized URL', async ({ page }) => {
const transactionPromise = waitForTransaction('nuxt-3', async transactionEvent => {
return transactionEvent.transaction === '/test-param/:param()';
});

await page.goto(`/test-param/1234`);

const rootSpan = await transactionPromise;

expect(rootSpan).toMatchObject({
contexts: {
trace: {
data: {
'sentry.source': 'route',
'sentry.origin': 'auto.pageload.vue',
'sentry.op': 'pageload',
'params.param': '1234',
},
op: 'pageload',
origin: 'auto.pageload.vue',
},
},
transaction: '/test-param/:param()',
transaction_info: {
source: 'route',
},
});
});

test('sends component tracking spans when `trackComponents` is enabled', async ({ page }) => {
const transactionPromise = waitForTransaction('nuxt-3', async transactionEvent => {
return transactionEvent.transaction === '/client-error';
});

await page.goto(`/client-error`);

const rootSpan = await transactionPromise;
const errorButtonSpan = rootSpan.spans.find((span: Span) => span.description === 'Vue <ErrorButton>');

const expected = {
data: { 'sentry.origin': 'auto.ui.vue', 'sentry.op': 'ui.vue.mount' },
description: 'Vue <ErrorButton>',
op: 'ui.vue.mount',
parent_span_id: expect.any(String),
span_id: expect.any(String),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: expect.any(String),
origin: 'auto.ui.vue',
};

expect(errorButtonSpan).toMatchObject(expected);
});
2 changes: 1 addition & 1 deletion dev-packages/external-contributor-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/external-contributor-gh-action",
"description": "An internal Github Action to add external contributors to the CHANGELOG.md file.",
"version": "8.29.0",
"version": "8.30.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
10 changes: 5 additions & 5 deletions dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/node-integration-tests",
"version": "8.29.0",
"version": "8.30.0",
"license": "MIT",
"engines": {
"node": ">=14.18"
Expand Down Expand Up @@ -31,10 +31,10 @@
"@nestjs/core": "^10.3.3",
"@nestjs/platform-express": "^10.3.3",
"@prisma/client": "5.9.1",
"@sentry/aws-serverless": "8.29.0",
"@sentry/node": "8.29.0",
"@sentry/types": "8.29.0",
"@sentry/utils": "8.29.0",
"@sentry/aws-serverless": "8.30.0",
"@sentry/node": "8.30.0",
"@sentry/types": "8.30.0",
"@sentry/utils": "8.30.0",
"@types/mongodb": "^3.6.20",
"@types/mysql": "^2.15.21",
"@types/pg": "^8.6.5",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/overhead-metrics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "8.29.0",
"version": "8.30.0",
"name": "@sentry-internal/overhead-metrics",
"main": "index.js",
"author": "Sentry",
Expand Down
Loading

0 comments on commit b3e198a

Please sign in to comment.