From 210de124c464a62a31cbf181051f611e68e759d3 Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Wed, 13 May 2026 17:27:18 +0900 Subject: [PATCH] chore: Clean up verdaccio leftovers --- dev-packages/e2e-tests/README.md | 53 +--- .../e2e-tests/verdaccio-config/config.yaml | 294 ------------------ docs/new-sdk-release-checklist.md | 4 - package.json | 2 - 4 files changed, 13 insertions(+), 340 deletions(-) delete mode 100644 dev-packages/e2e-tests/verdaccio-config/config.yaml diff --git a/dev-packages/e2e-tests/README.md b/dev-packages/e2e-tests/README.md index 2ff4b0665cd3..4145890ed605 100644 --- a/dev-packages/e2e-tests/README.md +++ b/dev-packages/e2e-tests/README.md @@ -15,8 +15,6 @@ current state. ## How to run -Prerequisites: Docker - - Copy `.env.example` to `.env` - OPTIONAL: Fill in auth information in `.env` for an example Sentry project - you only need this to run E2E tests that send data to Sentry. @@ -92,41 +90,27 @@ If you run `yarn test:run nextjs-pages-dir --variant 13`, it will match against ## How they work -Before running any tests we launch a fake test registry (in our case [Verdaccio](https://verdaccio.org/docs/e2e/)), we -build our packages, pack them, and publish them to the fake registry. The fake registry is hosted in a Docker container, -and the script to publish the packages is also run from within a container to ensure that the fake publishing happens -with the same Node.js and npm versions as we're using in CI. +We build our packages, pack them into tarballs (`yarn build:tarball`), and create symlinks in the `packed/` directory +that point to the versioned tarballs. When a test application is run, pnpm overrides are injected into its +`package.json` to pin all `@sentry/*` and `@sentry-internal/*` packages to those local tarballs. This means test apps +install the packages as if they were published, but from the local build output instead of a registry. -After publishing our freshly built packages to the fake registry, the E2E test script will look for `test-recipe.json` -files in test applications located in the `test-applications` folder. In this folder, we keep standalone test -applications, that use our SDKs and can be used to verify their behavior. The `test-recipe.json` recipe files contain -information on how to build the test applications and how to run tests on these applications. +The E2E test script looks for test applications in the `test-applications` folder. These are standalone apps that use +our SDKs and can be used to verify their behavior. ## How to set up a new test -Test applications are completely standalone applications that can be used to verify our SDKs. To set one up, follow -these commands: +Test applications are completely standalone applications that can be used to verify our SDKs. To set one up: ```sh cd dev-packages/e2e-tests - -# Create a new test application folder -mkdir test-applications/my-new-test-application # Name of the new folder doesn't technically matter but choose something meaningful - -# Create an npm configuration file that uses the fake test registry -cat > test-applications/my-new-test-application/.npmrc << EOF -@sentry:registry=http://127.0.0.1:4873 -@sentry-internal:registry=http://127.0.0.1:4873 -EOF +mkdir test-applications/my-new-test-application ``` Make sure to add a `test:build` and `test:assert` command to the new app's `package.json` file. -### The `.npmrc` File - -Every test application needs an `.npmrc` file (as shown above) to tell pnpm to fetch `@sentry/*` and `@sentry-internal/*` packages from the local Verdaccio registry. Without it, pnpm will install from the public npm registry and your local changes won't be tested - this is one of the most common causes of confusing test failures. - -To verify packages are being installed from Verdaccio, check the version in `node_modules/@sentry/*/package.json`. If it shows something like `0.0.0-pr.12345`, Verdaccio is working. If it shows a released version (e.g., `8.0.0`), the `.npmrc` is missing or incorrect. +Sentry packages are automatically resolved to the local build via pnpm overrides injected at test time, so no manual +registry configuration is needed. ## Troubleshooting @@ -134,20 +118,12 @@ To verify packages are being installed from Verdaccio, check the version in `nod #### Tests fail with "Cannot find module '@sentry/...'" or use wrong package version -1. Verify the test application has an `.npmrc` file (see above) -2. Rebuild tarballs: `yarn build && yarn build:tarball` +1. Rebuild tarballs: `yarn build && yarn build:tarball` +2. Re-run `yarn test:prepare` to refresh symlinks 3. Delete `node_modules` in the test application and re-run the test -#### Docker/Verdaccio issues - -- Ensure Docker daemon is running -- Check that port 4873 is not already in use: `lsof -i :4873` -- Stop any existing Verdaccio containers: `docker ps` and `docker stop ` -- Check Verdaccio logs for errors - #### Tests pass locally but fail in CI (or vice versa) -- Most likely cause: missing `.npmrc` file - Verify all `@sentry/*` dependencies use `latest || *` version specifier - Check if the test relies on environment-specific behavior @@ -206,10 +182,7 @@ For example, if something is changed in the browser package, only E2E test apps You can add additional information about the test (e.g. canary versions, optional in CI) by adding `sentryTest` in the `package.json` of a test application. -**An important thing to note:** In the context of the build/test commands the fake test registry is available at -`http://127.0.0.1:4873`. It hosts all of our packages as if they were to be published with the state of the current -branch. This means we can install the packages from this registry via the `.npmrc` configuration as seen above. If you -add Sentry dependencies to your test application, you should set the dependency versions set to `latest || *` in order +If you add Sentry dependencies to your test application, set the dependency versions to `latest || *` in order for it to work with both regular and prerelease versions: ```jsonc diff --git a/dev-packages/e2e-tests/verdaccio-config/config.yaml b/dev-packages/e2e-tests/verdaccio-config/config.yaml deleted file mode 100644 index 8878490df729..000000000000 --- a/dev-packages/e2e-tests/verdaccio-config/config.yaml +++ /dev/null @@ -1,294 +0,0 @@ -# Taken from https://github.com/babel/babel/blob/624c78d99e8f42b2543b8943ab1b62bd71cf12d8/scripts/integration-tests/verdaccio-config.yml - -# -# This is the default config file. It allows all users to do anything, -# so don't use it on production systems. -# -# Look here for more config file examples: -# https://github.com/verdaccio/verdaccio/tree/master/conf -# - -# Repo-local storage (relative to this file). Absolute /verdaccio/... matches Docker-only templates and is not writable on typical dev machines. -storage: ./storage/data - -# https://verdaccio.org/docs/configuration#authentication -auth: - htpasswd: - file: ./storage/htpasswd - -# https://verdaccio.org/docs/configuration#uplinks -# a list of other known repositories we can talk to -uplinks: - npmjs: - url: https://registry.npmjs.org/ - -# Learn how to protect your packages -# https://verdaccio.org/docs/protect-your-dependencies/ -# https://verdaccio.org/docs/configuration#packages -packages: - # To not use a proxy (e.g. npm) but instead use verdaccio for package hosting we need to define rules here without the - # `proxy` field. Sadly we can't use a wildcard like "@sentry/*" because we have some dependencies (@sentry/cli, - # @sentry/webpack-plugin) that fall under that wildcard but don't live in this repository. If we were to use that - # wildcard, we would get a 404 when attempting to install them, since they weren't uploaded to verdaccio, and also - # don't have a proxy configuration. - - '@sentry/angular': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/astro': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/browser': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/bun': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/core': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/cloudflare': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/deno': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/effect': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/elysia': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/ember': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/gatsby': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/hono': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/nestjs': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/nextjs': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/node': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/node-core': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/node-native': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/opentelemetry': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/profiling-node': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/react': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/react-router': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/remix': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/aws-serverless': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/google-cloud-serverless': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/solid': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/solidstart': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/svelte': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/sveltekit': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/tanstackstart': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/tanstackstart-react': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/types': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/vercel-edge': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/vue': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/nuxt': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/wasm': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry/nitro': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@sentry-internal/*': - access: $all - publish: $all - unpublish: $all - # proxy: npmjs # Don't proxy for E2E tests! - - '@*/*': - # scoped packages - access: $all - publish: $all - unpublish: $all - proxy: npmjs - - '**': - # allow all users (including non-authenticated users) to read and - # publish all packages - # - # you can specify usernames/groupnames (depending on your auth plugin) - # and three keywords: "$all", "$anonymous", "$authenticated" - access: $all - - # allow all known users to publish/publish packages - # (anyone can register by default, remember?) - publish: $all - unpublish: $all - proxy: npmjs - -# https://verdaccio.org/docs/configuration#server -# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections. -# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout. -# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough. -server: - keepAliveTimeout: 60 - -middlewares: - audit: - enabled: false - -# https://verdaccio.org/docs/logger -# log settings -log: { type: stdout, format: pretty, level: http } -#experiments: -# # support for npm token command -# token: false diff --git a/docs/new-sdk-release-checklist.md b/docs/new-sdk-release-checklist.md index d95ea2bf7b0f..bbe340d2ddc8 100644 --- a/docs/new-sdk-release-checklist.md +++ b/docs/new-sdk-release-checklist.md @@ -49,10 +49,6 @@ differ slightly for other SDKs depending on how they are structured and how they - **This is especially important, if you're adding new CDN bundles!** - Tarballs (\*.tgz archives) should work OOTB -- [ ] Make sure it is added to the - [Verdaccio config](https://github.com/getsentry/sentry-javascript/blob/develop/dev-packages/e2e-tests/verdaccio-config/config.yaml) - for the E2E tests - - [ ] If the package you're adding is a dependency of fullstack framework (e.g. Remix or NextJS) SDKs, make sure that your package is added to the integration test apps' `"resolutions"` field in their `package.json`s. diff --git a/package.json b/package.json index 48340d23d05b..8bbc950f0de2 100644 --- a/package.json +++ b/package.json @@ -163,8 +163,6 @@ "cliui/wrap-ansi": "7.0.0", "sucrase": "getsentry/sucrase#es2020-polyfills", "**/express/path-to-regexp": "0.1.12", - "**/@verdaccio/local-storage-legacy/lodash": "4.17.23", - "**/@verdaccio/core/minimatch": "~7.4.9", "**/nitropack/rollup-plugin-visualizer": "^6.0.3" }, "version": "0.0.0",