Skip to content

Commit

Permalink
Merge pull request #12976 from getsentry/prepare-release/8.19.0
Browse files Browse the repository at this point in the history
meta(changelog): Update changelog for 8.19.0
  • Loading branch information
andreiborza authored Jul 18, 2024
2 parents a2972b6 + c7ff1a9 commit ca99121
Show file tree
Hide file tree
Showing 101 changed files with 1,337 additions and 771 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ jobs:
- *shared
- 'packages/browser/**'
- 'packages/browser-utils/**'
- 'packages/replay/**'
- 'packages/replay-internal/**'
- 'packages/replay-worker/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
Expand All @@ -131,6 +132,7 @@ jobs:
- *node
- 'packages/nextjs/**'
- 'packages/react/**'
- 'packages/vercel-edge/**'
remix:
- *shared
- *browser
Expand All @@ -147,8 +149,10 @@ jobs:
- 'dev-packages/e2e-tests/test-applications/node-profiling/**'
deno:
- *shared
- *browser
- 'packages/deno/**'
bun:
- *shared
- 'packages/bun/**'
any_code:
- '!**/*.md'
Expand All @@ -166,6 +170,7 @@ jobs:
changed_profiling_node: ${{ steps.changed.outputs.profiling_node }}
changed_profiling_node_bindings: ${{ steps.changed.outputs.profiling_node_bindings }}
changed_deno: ${{ steps.changed.outputs.deno }}
changed_bun: ${{ steps.changed.outputs.bun }}
changed_browser: ${{ steps.changed.outputs.browser }}
changed_browser_integration: ${{ steps.changed.outputs.browser_integration }}
changed_any_code: ${{ steps.changed.outputs.any_code }}
Expand Down Expand Up @@ -451,6 +456,7 @@ jobs:
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_get_metadata.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-20.04
strategy:
Expand Down Expand Up @@ -1031,7 +1037,9 @@ jobs:
'generic-ts3.8',
'node-fastify',
'node-hapi',
'nestjs',
'nestjs-basic',
'nestjs-distributed-tracing',
'nestjs-with-submodules',
'node-exports-test-app',
'node-koa',
'node-connect',
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@

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

## 8.19.0

- feat(core): Align Span interface with OTEL (#12898)
- fix(angular): Remove `afterSendEvent` listener once root injector is destroyed (#12786)
- fix(browser): Fix bug causing unintentional dropping of transactions (#12933)
- fix(feedback): Add a missing call of Actor.appendToDom method when DOMContentLoaded event is triggered (#12973)

Work in this release was contributed by @jaspreet57 and @arturovt. Thank you for your contribution!

## 8.18.0

### Important Changes
Expand Down Expand Up @@ -38,7 +47,7 @@ instead. If you want to disable performance monitoring, remove the `tracesSample
- fix(tracing): Ensure you can pass `null` as `parentSpan` in `startSpan*` (#12928)
- ref(core): Small bundle size improvement (#12830)

Work in this release was contributed by @GitSquared and @mcous. Thank you for your contributions!
Work in this release was contributed by @GitSquared, @ziyadkhalil and @mcous. Thank you for your contributions!

## 8.17.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nestjs",
"name": "nestjs-basic",
"version": "0.0.1",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Controller, Get, Param } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}

@Get('test-transaction')
testTransaction() {
return this.appService.testTransaction();
}

@Get('test-exception/:id')
async testException(@Param('id') id: string) {
return this.appService.testException(id);
}

@Get('test-expected-exception/:id')
async testExpectedException(@Param('id') id: string) {
return this.appService.testExpectedException(id);
}

@Get('test-span-decorator-async')
async testSpanDecoratorAsync() {
return { result: await this.appService.testSpanDecoratorAsync() };
}

@Get('test-span-decorator-sync')
async testSpanDecoratorSync() {
return { result: await this.appService.testSpanDecoratorSync() };
}

@Get('kill-test-cron')
async killTestCron() {
this.appService.killTestCron();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';
import { ScheduleModule } from '@nestjs/schedule';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
imports: [ScheduleModule.forRoot()],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Cron, SchedulerRegistry } from '@nestjs/schedule';
import * as Sentry from '@sentry/nestjs';
import { SentryCron, SentryTraced } from '@sentry/nestjs';
import type { MonitorConfig } from '@sentry/types';
import { makeHttpRequest } from './utils';

const monitorConfig: MonitorConfig = {
schedule: {
Expand All @@ -13,53 +12,15 @@ const monitorConfig: MonitorConfig = {
};

@Injectable()
export class AppService1 {
export class AppService {
constructor(private schedulerRegistry: SchedulerRegistry) {}

testSuccess() {
return { version: 'v1' };
}

testParam(id: string) {
return {
paramWas: id,
};
}

testInboundHeaders(headers: Record<string, string>, id: string) {
return {
headers,
id,
};
}

async testOutgoingHttp(id: string) {
const data = await makeHttpRequest(`http://localhost:3030/test-inbound-headers/${id}`);

return data;
}

async testOutgoingFetch(id: string) {
const response = await fetch(`http://localhost:3030/test-inbound-headers/${id}`);
const data = await response.json();

return data;
}

testTransaction() {
Sentry.startSpan({ name: 'test-span' }, () => {
Sentry.startSpan({ name: 'child-span' }, () => {});
});
}

async testError() {
const exceptionId = Sentry.captureException(new Error('This is an error'));

await Sentry.flush(2000);

return { exceptionId };
}

testException(id: string) {
throw new Error(`This is an exception with id ${id}`);
}
Expand All @@ -68,26 +29,6 @@ export class AppService1 {
throw new HttpException(`This is an expected exception with id ${id}`, HttpStatus.FORBIDDEN);
}

async testOutgoingFetchExternalAllowed() {
const fetchResponse = await fetch('http://localhost:3040/external-allowed');

return fetchResponse.json();
}

async testOutgoingFetchExternalDisallowed() {
const fetchResponse = await fetch('http://localhost:3040/external-disallowed');

return fetchResponse.json();
}

async testOutgoingHttpExternalAllowed() {
return makeHttpRequest('http://localhost:3040/external-allowed');
}

async testOutgoingHttpExternalDisallowed() {
return makeHttpRequest('http://localhost:3040/external-disallowed');
}

@SentryTraced('wait and return a string')
async wait() {
await new Promise(resolve => setTimeout(resolve, 500));
Expand Down Expand Up @@ -124,20 +65,3 @@ export class AppService1 {
this.schedulerRegistry.deleteCronJob('test-cron-job');
}
}

@Injectable()
export class AppService2 {
externalAllowed(headers: Record<string, string>) {
return {
headers,
route: 'external-allowed',
};
}

externalDisallowed(headers: Record<string, string>) {
return {
headers,
route: 'external-disallowed',
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as Sentry from '@sentry/nestjs';

Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: process.env.E2E_TEST_DSN,
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1,
});
20 changes: 20 additions & 0 deletions dev-packages/e2e-tests/test-applications/nestjs-basic/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Import this first
import './instrument';

// Import other modules
import { BaseExceptionFilter, HttpAdapterHost, NestFactory } from '@nestjs/core';
import * as Sentry from '@sentry/nestjs';
import { AppModule } from './app.module';

const PORT = 3030;

async function bootstrap() {
const app = await NestFactory.create(AppModule);

const { httpAdapter } = app.get(HttpAdapterHost);
Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));

await app.listen(PORT);
}

bootstrap();
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,3 @@ test('Does not send expected exception to Sentry', async ({ baseURL }) => {

expect(errorEventOccurred).toBe(false);
});

test('Does not handle expected exception if exception is thrown in module', async ({ baseURL }) => {
const errorEventPromise = waitForError('nestjs', event => {
return !event.type && event.exception?.values?.[0]?.value === 'Something went wrong in the test module!';
});

const response = await fetch(`${baseURL}/test-module`);
expect(response.status).toBe(500); // should be 400

// should never arrive, but does because the exception is not handled properly
const errorEvent = await errorEventPromise;

expect(errorEvent.exception?.values).toHaveLength(1);
expect(errorEvent.exception?.values?.[0]?.value).toBe('Something went wrong in the test module!');

expect(errorEvent.request).toEqual({
method: 'GET',
cookies: {},
headers: expect.any(Object),
url: 'http://localhost:3030/test-module',
});

expect(errorEvent.transaction).toEqual('GET /test-module');

expect(errorEvent.contexts?.trace).toEqual({
trace_id: expect.any(String),
span_id: expect.any(String),
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading

0 comments on commit ca99121

Please sign in to comment.