Skip to content

Commit c4a350c

Browse files
authored
Merge branch 'develop' into jb/profiling/timestamp-seconds
2 parents b38f9b2 + a08335d commit c4a350c

File tree

343 files changed

+6100
-1624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+6100
-1624
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ jobs:
108108
- 'packages/replay-canvas/**'
109109
- 'packages/feedback/**'
110110
- 'packages/wasm/**'
111+
node: &node
112+
- *shared
113+
- 'packages/node/**'
114+
- 'packages/opentelemetry/**'
111115
browser_integration:
112116
- *shared
113117
- *browser
@@ -116,21 +120,21 @@ jobs:
116120
- *shared
117121
- *browser
118122
- 'packages/ember/**'
119-
node:
123+
node_integration:
120124
- *shared
121-
- 'packages/node/**'
125+
- *node
122126
- 'dev-packages/node-integration-tests/**'
123127
nextjs:
124128
- *shared
125129
- *browser
130+
- *node
126131
- 'packages/nextjs/**'
127-
- 'packages/node/**'
128132
- 'packages/react/**'
129133
remix:
130134
- *shared
131135
- *browser
136+
- *node
132137
- 'packages/remix/**'
133-
- 'packages/node/**'
134138
- 'packages/react/**'
135139
profiling_node:
136140
- *shared
@@ -157,6 +161,7 @@ jobs:
157161
changed_ember: ${{ steps.changed.outputs.ember }}
158162
changed_remix: ${{ steps.changed.outputs.remix }}
159163
changed_node: ${{ steps.changed.outputs.node }}
164+
changed_node_integration: ${{ steps.changed.outputs.node_integration }}
160165
changed_profiling_node: ${{ steps.changed.outputs.profiling_node }}
161166
changed_profiling_node_bindings: ${{ steps.changed.outputs.profiling_node_bindings }}
162167
changed_deno: ${{ steps.changed.outputs.deno }}
@@ -224,6 +229,44 @@ jobs:
224229
message: |
225230
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
226231
232+
job_external_contributor:
233+
name: External Contributors
234+
needs: job_install_deps
235+
runs-on: ubuntu-20.04
236+
if: |
237+
github.event_name == 'pull_request'
238+
&& (github.action == 'opened' || github.action == 'reopened')
239+
&& github.event.pull_request.author_association != 'COLLABORATOR'
240+
&& github.event.pull_request.author_association != 'MEMBER'
241+
&& github.event.pull_request.author_association != 'OWNER'
242+
steps:
243+
- uses: actions/checkout@v4
244+
with:
245+
ref: ${{ github.head_ref }}
246+
- name: Set up Node
247+
uses: actions/setup-node@v4
248+
with:
249+
node-version-file: 'package.json'
250+
- name: Check dependency cache
251+
uses: actions/cache/restore@v4
252+
with:
253+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
254+
key: ${{ needs.job_install_deps.outputs.dependency_cache_key }}
255+
fail-on-cache-miss: true
256+
257+
- name: Add external contributor to CHANGELOG.md
258+
uses: ./dev-packages/external-contributor-gh-action
259+
with:
260+
name: ${{ github.event.pull_request.user.login }}
261+
- name: Create PR with changes
262+
uses: peter-evans/create-pull-request@v6
263+
with:
264+
commit-message: "ref: Add external contributor to CHANGELOG.md"
265+
title: "ref: Add external contributor to CHANGELOG.md"
266+
branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}'
267+
delete-branch: true
268+
body: This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution.
269+
227270
job_build:
228271
name: Build
229272
needs: [job_get_metadata, job_install_deps]
@@ -824,7 +867,7 @@ jobs:
824867
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }} Integration
825868
Tests
826869
needs: [job_get_metadata, job_build]
827-
if: needs.job_get_metadata.outputs.changed_node == 'true' || github.event_name != 'pull_request'
870+
if: needs.job_get_metadata.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
828871
runs-on: ubuntu-20.04
829872
timeout-minutes: 15
830873
strategy:
@@ -853,15 +896,15 @@ jobs:
853896

854897
- name: Overwrite typescript version
855898
if: matrix.typescript
856-
run: yarn add --dev --ignore-workspace-root-check typescript@${{ matrix.typescript }}
899+
run: node ./scripts/use-ts-version.js ${{ matrix.typescript }}
900+
working-directory: dev-packages/node-integration-tests
857901

858902
- name: Run integration tests
859903
env:
860904
NODE_VERSION: ${{ matrix.node }}
861905
TS_VERSION: ${{ matrix.typescript }}
862-
run: |
863-
cd dev-packages/node-integration-tests
864-
yarn test
906+
working-directory: dev-packages/node-integration-tests
907+
run: yarn test
865908

866909
job_remix_integration_tests:
867910
name: Remix v${{ matrix.remix }} (Node ${{ matrix.node }}) Tests
@@ -874,10 +917,8 @@ jobs:
874917
matrix:
875918
node: [18, 20, 22]
876919
remix: [1, 2]
877-
# Remix v2 only supports Node 18+, so run Node 14, 16 tests separately
920+
# Remix v2 only supports Node 18+, so run 16 tests separately
878921
include:
879-
- node: 14
880-
remix: 1
881922
- node: 16
882923
remix: 1
883924
steps:
@@ -999,8 +1040,11 @@ jobs:
9991040
'create-react-app',
10001041
'create-next-app',
10011042
'create-remix-app',
1043+
'create-remix-app-legacy',
10021044
'create-remix-app-v2',
1045+
'create-remix-app-v2-legacy',
10031046
'create-remix-app-express',
1047+
'create-remix-app-express-legacy',
10041048
'create-remix-app-express-vite-dev',
10051049
'node-express-esm-loader',
10061050
'node-express-esm-preload',

dev-packages/browser-integration-tests/suites/feedback/captureFeedback/init.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7-
integrations: [Sentry.feedbackIntegration()],
7+
integrations: [
8+
Sentry.feedbackIntegration({
9+
tags: { from: 'integration init' },
10+
}),
11+
],
812
});

dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
5959
},
6060
},
6161
level: 'info',
62+
tags: {
63+
from: 'integration init',
64+
},
6265
timestamp: expect.any(Number),
6366
event_id: expect.stringMatching(/\w{32}/),
6467
environment: 'production',

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl
9595
},
9696
},
9797
level: 'info',
98+
tags: {},
9899
timestamp: expect.any(Number),
99100
event_id: expect.stringMatching(/\w{32}/),
100101
environment: 'production',

dev-packages/e2e-tests/test-applications/create-next-app/tests/client-transactions.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ test('Sends a pageload transaction to Sentry', async ({ page }) => {
1717
transaction_info: { source: 'route' },
1818
type: 'transaction',
1919
contexts: {
20+
react: {
21+
version: '18.2.0',
22+
},
2023
trace: {
2124
span_id: expect.any(String),
2225
trace_id: expect.any(String),
@@ -60,6 +63,9 @@ test('captures a navigation transcation to Sentry', async ({ page }) => {
6063
transaction_info: { source: 'route' },
6164
type: 'transaction',
6265
contexts: {
66+
react: {
67+
version: '18.2.0',
68+
},
6369
trace: {
6470
span_id: expect.any(String),
6571
trace_id: expect.any(String),
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/**
2+
* This is intended to be a basic starting point for linting in your app.
3+
* It relies on recommended configs out of the box for simplicity, but you can
4+
* and should modify this configuration to best suit your team's needs.
5+
*/
6+
7+
/** @type {import('eslint').Linter.Config} */
8+
module.exports = {
9+
root: true,
10+
parserOptions: {
11+
ecmaVersion: 'latest',
12+
sourceType: 'module',
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
},
17+
env: {
18+
browser: true,
19+
commonjs: true,
20+
es6: true,
21+
},
22+
23+
// Base config
24+
extends: ['eslint:recommended'],
25+
26+
overrides: [
27+
// React
28+
{
29+
files: ['**/*.{js,jsx,ts,tsx}'],
30+
plugins: ['react', 'jsx-a11y'],
31+
extends: [
32+
'plugin:react/recommended',
33+
'plugin:react/jsx-runtime',
34+
'plugin:react-hooks/recommended',
35+
'plugin:jsx-a11y/recommended',
36+
],
37+
settings: {
38+
react: {
39+
version: 'detect',
40+
},
41+
formComponents: ['Form'],
42+
linkComponents: [
43+
{ name: 'Link', linkAttribute: 'to' },
44+
{ name: 'NavLink', linkAttribute: 'to' },
45+
],
46+
'import/resolver': {
47+
typescript: {},
48+
},
49+
},
50+
},
51+
52+
// Typescript
53+
{
54+
files: ['**/*.{ts,tsx}'],
55+
plugins: ['@typescript-eslint', 'import'],
56+
parser: '@typescript-eslint/parser',
57+
settings: {
58+
'import/internal-regex': '^~/',
59+
'import/resolver': {
60+
node: {
61+
extensions: ['.ts', '.tsx'],
62+
},
63+
typescript: {
64+
alwaysTryTypes: true,
65+
},
66+
},
67+
},
68+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/recommended', 'plugin:import/typescript'],
69+
},
70+
71+
// Node
72+
{
73+
files: ['.eslintrc.cjs', 'server.js'],
74+
env: {
75+
node: true,
76+
},
77+
},
78+
],
79+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
3+
/.cache
4+
/build
5+
/public/build
6+
.env
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { RemixBrowser, useLocation, useMatches } from '@remix-run/react';
2+
import * as Sentry from '@sentry/remix';
3+
import { StrictMode, startTransition, useEffect } from 'react';
4+
import { hydrateRoot } from 'react-dom/client';
5+
6+
Sentry.init({
7+
environment: 'qa', // dynamic sampling bias to keep transactions
8+
dsn: window.ENV.SENTRY_DSN,
9+
integrations: [
10+
Sentry.browserTracingIntegration({
11+
useEffect,
12+
useLocation,
13+
useMatches,
14+
}),
15+
Sentry.replayIntegration(),
16+
],
17+
// Performance Monitoring
18+
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
19+
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
20+
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
21+
tunnel: 'http://localhost:3031/', // proxy server
22+
});
23+
24+
Sentry.addEventProcessor(event => {
25+
if (
26+
event.type === 'transaction' &&
27+
(event.contexts?.trace?.op === 'pageload' || event.contexts?.trace?.op === 'navigation')
28+
) {
29+
const eventId = event.event_id;
30+
if (eventId) {
31+
window.recordedTransactions = window.recordedTransactions || [];
32+
window.recordedTransactions.push(eventId);
33+
}
34+
}
35+
36+
return event;
37+
});
38+
39+
startTransition(() => {
40+
hydrateRoot(
41+
document,
42+
<StrictMode>
43+
<RemixBrowser />
44+
</StrictMode>,
45+
);
46+
});

0 commit comments

Comments
 (0)