Skip to content

Commit 4f094de

Browse files
authored
Merge branch 'master' into feat/move-hub
2 parents 472f616 + 92dd0ed commit 4f094de

File tree

85 files changed

+1566
-279
lines changed

Some content is hidden

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

85 files changed

+1566
-279
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/getsentry/sentry-javascript/issues
4+
url: https://github.com/getsentry/sentry-javascript/discussions
55
about: Ask questions and discuss with other community members

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,3 +613,35 @@ jobs:
613613
run: |
614614
cd packages/remix
615615
yarn test:integration:ci
616+
617+
job_e2e_tests:
618+
name: E2E Tests
619+
needs: [job_get_metadata, job_build]
620+
runs-on: ubuntu-latest
621+
timeout-minutes: 10
622+
continue-on-error: true
623+
steps:
624+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
625+
uses: actions/checkout@v2
626+
with:
627+
ref: ${{ env.HEAD_COMMIT }}
628+
- name: Set up Node
629+
uses: actions/setup-node@v1
630+
with:
631+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
632+
- name: Check dependency cache
633+
uses: actions/cache@v2
634+
with:
635+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
636+
key: ${{ needs.job_build.outputs.dependency_cache_key }}
637+
- name: Check build cache
638+
uses: actions/cache@v2
639+
with:
640+
path: ${{ env.CACHED_BUILD_PATHS }}
641+
key: ${{ env.BUILD_CACHE_KEY }}
642+
- name: Run E2E tests
643+
env:
644+
E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION: ${{ env.DEFAULT_NODE_VERSION }}
645+
run: |
646+
cd packages/e2e-tests
647+
yarn test:e2e

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44

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

7+
## 7.14.0
8+
9+
- feat(nextjs): Add status to data-fetcher spans (#5777)
10+
- feat(nextjs): Auto-wrap API routes (#5778)
11+
- feat(nextjs): Promote option to automatically wrap data fetchers and API routes to non-experimental (#5793)
12+
- feat(utils): Modern implementation of `getGlobalObject` (#5809)
13+
- fix(gatsby): Include app-* entrypoints as they may include user source code (#5685)
14+
- fix(nextjs): Handle `pathname` being passed in object in `instrumentServer` (#5782)
15+
- fix(nextjs): Pass request in sampling context of data fetchers wrapper transaction (#5784)
16+
- fix(nextjs): Reverse order of checks for instrumenting server (#5828)
17+
- fix(nextjs): Rename `nextjs.data.server` ops (#5830)
18+
- fix(remix): Do not skip error handling if tracing is not enabled. (#5811)
19+
- fix(remix): Use import() to get `react-router-dom` in Express wrapper. (#5810)
20+
- fix(tracing): Remove `connection.downlink` measurement (#5794)
21+
- ref(browser): Use configured transport as fallback for client reports (#5797)
22+
- ref(nextjs): Use flush code from `withSentry` in all backend wrappers (#5814)
23+
- ref(nextjs): Use integration to add request data to transaction events (#5703)
24+
- ref(nextjs): Use`RequestData` integration for errors (#5729)
25+
- ref(node): Move request data functions back to `@sentry/node` (#5759)
26+
- ref(tracing): Don't track transaction sampling method (#5775)
27+
- ref(types): Use intersections instead of extend in envelope types (#5788)
28+
29+
Work in this release contributed by @Auspicus and @dagroe. Thank you for your contributions!
30+
731
## 7.13.0
832

933
- feat(browser): Use fetch `keepalive` flag (#5697)

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "3.4.0",
3-
"version": "7.13.0",
3+
"version": "7.14.0",
44
"packages": "packages/*",
55
"npmClient": "yarn",
66
"useWorkspaces": true

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"packages/angular",
3535
"packages/browser",
3636
"packages/core",
37+
"packages/e2e-tests",
3738
"packages/ember",
3839
"packages/eslint-config-sdk",
3940
"packages/eslint-plugin-sdk",
@@ -90,8 +91,8 @@
9091
"replace-in-file": "^4.0.0",
9192
"rimraf": "^3.0.2",
9293
"rollup": "^2.67.1",
94+
"rollup-plugin-cleanup": "3.2.1",
9395
"rollup-plugin-license": "^2.6.1",
94-
"rollup-plugin-re": "^1.0.7",
9596
"rollup-plugin-terser": "^7.0.2",
9697
"rollup-plugin-typescript2": "^0.31.2",
9798
"sinon": "^7.3.2",

packages/angular/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular",
3-
"version": "7.13.0",
3+
"version": "7.14.0",
44
"description": "Official Sentry SDK for Angular",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
@@ -21,9 +21,9 @@
2121
"rxjs": "^6.5.5 || ^7.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "7.13.0",
25-
"@sentry/types": "7.13.0",
26-
"@sentry/utils": "7.13.0",
24+
"@sentry/browser": "7.14.0",
25+
"@sentry/types": "7.14.0",
26+
"@sentry/utils": "7.14.0",
2727
"tslib": "^2.0.0"
2828
},
2929
"devDependencies": {

packages/browser/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "7.13.0",
3+
"version": "7.14.0",
44
"description": "Official Sentry SDK for browsers",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -16,9 +16,9 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/core": "7.13.0",
20-
"@sentry/types": "7.13.0",
21-
"@sentry/utils": "7.13.0",
19+
"@sentry/core": "7.14.0",
20+
"@sentry/types": "7.14.0",
21+
"@sentry/utils": "7.14.0",
2222
"tslib": "^1.9.3"
2323
},
2424
"devDependencies": {

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/core",
3-
"version": "7.13.0",
3+
"version": "7.14.0",
44
"description": "Base implementation for all Sentry JavaScript SDKs",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
@@ -16,8 +16,8 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/types": "7.13.0",
20-
"@sentry/utils": "7.13.0",
19+
"@sentry/types": "7.14.0",
20+
"@sentry/utils": "7.14.0",
2121
"tslib": "^1.9.3"
2222
},
2323
"scripts": {

packages/core/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SDK_VERSION = '7.13.0';
1+
export const SDK_VERSION = '7.14.0';

packages/e2e-tests/.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
},
5+
extends: ['../../.eslintrc.js'],
6+
ignorePatterns: ['test-applications/**'],
7+
parserOptions: {
8+
sourceType: 'module',
9+
},
10+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This Dockerfile exists for the purpose of using a specific node/npm version (ie. the same we use in CI) to run npm publish with
2+
ARG NODE_VERSION=16.15.1
3+
FROM node:${NODE_VERSION}
4+
5+
WORKDIR /sentry-javascript/packages/e2e-tests
6+
CMD [ "yarn", "ts-node", "publish-packages.ts" ]

packages/e2e-tests/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
MIT License
2+
3+
Copyright (c) 2022, Sentry
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/e2e-tests/README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# E2E Tests
2+
3+
E2E tests enable us to verify the behavior of the packages in this repository as if they were to be published in their
4+
current state.
5+
6+
## How to run
7+
8+
Prerequisites: Docker
9+
10+
```bash
11+
yarn test:e2e
12+
```
13+
14+
## How they work
15+
16+
Before running any tests we launch a fake test registry (in our case [Verdaccio](https://verdaccio.org/docs/e2e/)), we
17+
build our packages, pack them, and publish them to the fake registry. The fake registry is hosted in a Docker container,
18+
and the script to publish the packages is also run from within a container to ensure that the fake publishing happens
19+
with the same Node.js and npm versions as we're using in CI.
20+
21+
After publishing our freshly built packages to the fake registry, the E2E test script will look for `test-recipe.json`
22+
files in test applications located in the `test-applications` folder. In this folder, we keep standalone test
23+
applications, that use our SDKs and can be used to verify their behavior. The `test-recipe.json` recipe files contain
24+
information on how to build the test applications and how to run tests on these applications.
25+
26+
## How to set up a new test
27+
28+
Test applications are completely standalone applications that can be used to verify our SDKs. To set one up, follow
29+
these commands:
30+
31+
```sh
32+
cd packages/e2e-tests
33+
34+
# Create a new test application folder
35+
mkdir test-applications/my-new-test-application # Name of the new folder doesn't technically matter but choose something meaningful
36+
37+
# Create an npm configuration file that uses the fake test registry
38+
cat > test-applications/my-new-test-application/.npmrc << EOF
39+
@sentry:registry=http://localhost:4873
40+
@sentry-internal:registry=http://localhost:4873
41+
EOF
42+
43+
# Add a gitignore that ignores lockfiles
44+
cat > test-applications/my-new-test-application/.gitignore << EOF
45+
yarn.lock
46+
package-lock.json
47+
EOF
48+
49+
# Add a test recipe file to the test application
50+
touch test-applications/my-new-test-application/test-recipe.json
51+
```
52+
53+
To get you started with the recipe, you can copy the following into `test-recipe.json`:
54+
55+
```json
56+
{
57+
"$schema": "../../test-recipe-schema.json",
58+
"testApplicationName": "My New Test Application",
59+
"buildCommand": "yarn install --no-lockfile",
60+
"tests": [
61+
{
62+
"testName": "My new test",
63+
"testCommand": "yarn test",
64+
"timeoutSeconds": 60
65+
}
66+
]
67+
}
68+
```
69+
70+
The `test-recipe.json` files follow a schema (`e2e-tests/test-recipe-schema.json`). Here is a basic explanation of the
71+
fields:
72+
73+
- The `buildCommand` command runs only once before any of the tests and is supposed to build the test application. If
74+
this command returns a non-zero exit code, it counts as a failed test and the test application's tests are not run.
75+
- The `testCommand` command is supposed to run tests on the test application. If the configured command returns a
76+
non-zero exit code, it counts as a failed test.
77+
- A test timeout can be configured via `timeoutSeconds`, it defaults to `60`.
78+
79+
**An important thing to note:** In the context of the `buildCommand` the fake test registry is available at
80+
`http://localhost:4873`. It hosts all of our packages as if they were to be published with the state of the current
81+
branch. This means we can install the packages from this registry via the `.npmrc` configuration as seen above. If you
82+
add Sentry dependencies to your test application, you should set the dependency versions set to `*`:
83+
84+
```jsonc
85+
// package.json
86+
{
87+
"name": "my-new-test-application",
88+
"version": "1.0.0",
89+
"private": true,
90+
"scripts": {
91+
"test": "echo \"Hello world!\""
92+
},
93+
"dependencies": {
94+
"@sentry/node": "*"
95+
}
96+
}
97+
```
98+
99+
All that is left for you to do now is to create a test app and run `yarn test:e2e`.

packages/e2e-tests/package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "@sentry-internal/e2e-tests",
3+
"version": "7.14.0",
4+
"license": "MIT",
5+
"engines": {
6+
"node": ">=10"
7+
},
8+
"private": true,
9+
"scripts": {
10+
"fix": "run-s fix:eslint fix:prettier",
11+
"fix:eslint": "eslint . --format stylish --fix",
12+
"fix:prettier": "prettier --config ../../.prettierrc.json --write . ",
13+
"lint": "run-s lint:prettier lint:eslint",
14+
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
15+
"lint:prettier": "prettier --config ../../.prettierrc.json --check .",
16+
"test:e2e": "run-s test:validate-configuration test:test-app-setups test:run",
17+
"test:run": "ts-node run.ts",
18+
"test:validate-configuration": "ts-node validate-verdaccio-configuration.ts",
19+
"test:test-app-setups": "ts-node validate-test-app-setups.ts"
20+
},
21+
"devDependencies": {
22+
"@types/glob": "8.0.0",
23+
"glob": "8.0.3",
24+
"ts-node": "10.9.1",
25+
"typescript": "3.8.3",
26+
"yaml": "2.1.1"
27+
}
28+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* eslint-disable no-console */
2+
import * as childProcess from 'child_process';
3+
import * as glob from 'glob';
4+
import * as path from 'path';
5+
6+
const repositoryRoot = path.resolve(__dirname, '../..');
7+
8+
// Create tarballs
9+
childProcess.execSync('yarn build:npm', { encoding: 'utf8', cwd: repositoryRoot, stdio: 'inherit' });
10+
11+
// Get absolute paths of all the packages we want to publish to the fake registry
12+
const packageTarballPaths = glob.sync('packages/*/sentry-*.tgz', {
13+
cwd: repositoryRoot,
14+
absolute: true,
15+
});
16+
17+
// Publish built packages to the fake registry
18+
packageTarballPaths.forEach(tarballPath => {
19+
// `--userconfig` flag needs to be before `publish`
20+
childProcess.execSync(`npm --userconfig ${__dirname}/test-registry.npmrc publish ${tarballPath}`, {
21+
cwd: repositoryRoot, // Can't use __dirname here because npm would try to publish `@sentry-internal/e2e-tests`
22+
encoding: 'utf8',
23+
stdio: 'inherit',
24+
});
25+
});

0 commit comments

Comments
 (0)