Skip to content

Commit

Permalink
Merge pull request #13648 from getsentry/prepare-release/8.30.0
Browse files Browse the repository at this point in the history
meta: Update CHANGELOG for 8.30.0
  • Loading branch information
AbhiPrasad authored Sep 10, 2024
2 parents 6611987 + aba68f7 commit 7750a3f
Show file tree
Hide file tree
Showing 75 changed files with 1,167 additions and 513 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ updates:
- dependency-name: "@sentry/esbuild-plugin"
- dependency-name: "@opentelemetry/*"
- dependency-name: "@prisma/instrumentation"
- dependency-name: "opentelemetry-instrumentation-fetch-node"
versioning-strategy: increase
commit-message:
prefix: feat
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ jobs:
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@1.4.0
uses: denoland/setup-deno@v1.4.1
with:
deno-version: v1.38.5
- name: Restore caches
Expand Down Expand Up @@ -1168,7 +1168,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'dev-packages/e2e-tests/package.json'
node-version: 22
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
Expand Down
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"

36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,40 @@

- "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

### Important Changes
Expand All @@ -32,7 +66,7 @@ import * as Sentry from '@sentry/node';

Sentry.init({
dsn: '__PUBLIC_DSN__',
registerEsmLoaderHooks: { onlyHookedModules: true },
registerEsmLoaderHooks: { onlyIncludeInstrumentedModules: true },
});
```

Expand Down
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);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { test } from '@playwright/test';
import { waitForTransaction } from '@sentry-internal/test-utils';

test('should create a transaction for a CJS pages router API endpoint', async ({ page }) => {
let received404Transaction = false;
waitForTransaction('nextjs-13', async transactionEvent => {
return transactionEvent.transaction === 'GET /404' || transactionEvent.transaction === 'GET /_not-found';
}).then(() => {
received404Transaction = true;
});

await page.goto('/page-that-doesnt-exist');

await new Promise<void>((resolve, reject) => {
setTimeout(() => {
if (received404Transaction) {
reject(new Error('received 404 transaction'));
} else {
resolve();
}
}, 5_000);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('Should send a transaction with a fetch span', async ({ page }) => {
expect(transactionEvent.spans).toContainEqual(
expect.objectContaining({
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.otel.node_fetch',
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Because bundlers can now predetermine a static set of binaries we need to ensure those binaries
// actually exists, else we risk a compile time error when bundling the package. This could happen
// if we added a new binary in cpu_profiler.ts, but forgot to prebuild binaries for it. Because CI
// only runs integration and unit tests, this change would be missed and could end up in a release.
// Therefor, once all binaries are precompiled in CI and tests pass, run esbuild with bundle:true
// which will copy all binaries to the outfile folder and throw if any of them are missing.
import esbuild from 'esbuild';

console.log('Running build using esbuild version', esbuild.version);

esbuild.buildSync({
platform: 'node',
entryPoints: ['./index.ts'],
outfile: './dist/index.shimmed.mjs',
target: 'esnext',
format: 'esm',
bundle: true,
loader: { '.node': 'copy' },
banner: {
js: `
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
`,
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"private": true,
"scripts": {
"typecheck": "tsc --noEmit",
"build": "node build.mjs",
"test": "npm run build && node dist/index.js",
"clean": "npx rimraf node_modules",
"build": "node build.mjs && node build.shimmed.mjs",
"test": "node dist/index.js && node --experimental-require-module dist/index.js && node dist/index.shimmed.mjs",
"clean": "npx rimraf node_modules dist",
"test:build": "npm run typecheck && npm run build",
"test:assert": "npm run test"
},
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/e2e-tests/test-applications/nuxt-3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
},
"dependencies": {
"@sentry/nuxt": "latest || *",
"nuxt": "3.12.4"
"nuxt": "3.13.1"
},
"devDependencies": {
"@nuxt/test-utils": "^3.13.1",
"@nuxt/test-utils": "^3.14.1",
"@playwright/test": "^1.44.1",
"@sentry-internal/test-utils": "link:../../../test-utils"
}
Expand Down
1 change: 1 addition & 0 deletions dev-packages/e2e-tests/test-applications/vue-3/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Sentry.init({
}),
],
tunnel: `http://localhost:3031/`, // proxy server
trackComponents: ['ComponentMainView', '<ComponentOneView>'],
});

app.use(router);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const router = createRouter({
},
],
},
{
path: '/components',
component: () => import('../views/ComponentMainView.vue'),
},
],
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script setup lang="ts">
import ComponentOneView from './ComponentOneView.vue';
import ComponentTwoView from './ComponentTwoView.vue';
</script>

<template>
<h1>Demonstrating Component Tracking</h1>
<ComponentOneView />
<ComponentTwoView />
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script setup lang="ts">
function log() {
console.log('Component One!');
}
</script>

<template>
<h1>Component One</h1>
<button id="componentOneBtn" @click="log">Click to Log</button>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script setup lang="ts">
function log() {
console.log('Component Two!');
}
</script>

<template>
<h1>Component One</h1>
<button id="componentTwoBtn" @click="log">Click to Log</button>
</template>
Loading

0 comments on commit 7750a3f

Please sign in to comment.