-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
test(vue-router) sentry integration #6111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@birkskyum has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 25 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis PR adds a new end-to-end test suite for Vue Router with Sentry integration, including Playwright configuration, Vite setup, TypeScript configuration, CSS styling with Tailwind, application entry point with router and Sentry initialization, and basic test specifications. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit c1f12bd
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
e2e/vue-router/sentry-integration/index.html (1)
6-6: Consider a more descriptive title.The generic title "Vite App" could be more specific to reflect this is a Sentry integration test, improving clarity when debugging or viewing browser tabs during test runs.
- <title>Vite App</title> + <title>Vue Router Sentry Integration E2E</title>e2e/vue-router/sentry-integration/src/styles.css (1)
3-11: Redundant border color declarations.The border color is set in two places:
- Line 9: Sets
border-colorwith a CSS variable fallback in@layer base- Line 17: Uses
@applyto set border colors for the*selectorThe
@applyrule on line 17 will override the earlier declaration, making lines 3-11 partially redundant for the*selector. Consider consolidating these or clarifying the intent if both are necessary.If the intent is to provide a base fallback that Tailwind utilities can override, consider removing the duplicate on line 17:
html { color-scheme: light dark; } -* { - @apply border-gray-200 dark:border-gray-800; -}Or keep line 17 and simplify the base layer to target only pseudo-elements.
Also applies to: 16-17
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
e2e/vue-router/basepath-file-based/test-results/.last-run.json(1 hunks)e2e/vue-router/sentry-integration/.gitignore(1 hunks)e2e/vue-router/sentry-integration/index.html(1 hunks)e2e/vue-router/sentry-integration/package.json(1 hunks)e2e/vue-router/sentry-integration/playwright.config.ts(1 hunks)e2e/vue-router/sentry-integration/postcss.config.mjs(1 hunks)e2e/vue-router/sentry-integration/src/main.tsx(1 hunks)e2e/vue-router/sentry-integration/src/styles.css(1 hunks)e2e/vue-router/sentry-integration/tests/app.spec.ts(1 hunks)e2e/vue-router/sentry-integration/tsconfig.json(1 hunks)e2e/vue-router/sentry-integration/vite.config.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
e2e/vue-router/sentry-integration/tests/app.spec.tse2e/vue-router/sentry-integration/playwright.config.tse2e/vue-router/sentry-integration/src/main.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
e2e/vue-router/sentry-integration/tests/app.spec.tse2e/vue-router/sentry-integration/vite.config.jse2e/vue-router/sentry-integration/playwright.config.tse2e/vue-router/sentry-integration/src/main.tsx
**/package.json
📄 CodeRabbit inference engine (AGENTS.md)
Use workspace protocol
workspace:*for internal dependencies in package.json files
Files:
e2e/vue-router/sentry-integration/package.json
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
Applied to files:
e2e/vue-router/sentry-integration/.gitignoree2e/vue-router/sentry-integration/src/main.tsx
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Applied to files:
e2e/vue-router/sentry-integration/.gitignoree2e/vue-router/sentry-integration/tests/app.spec.tse2e/vue-router/sentry-integration/package.jsone2e/vue-router/basepath-file-based/test-results/.last-run.json
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
Applied to files:
e2e/vue-router/sentry-integration/package.jsone2e/vue-router/sentry-integration/src/main.tsxe2e/vue-router/sentry-integration/tsconfig.json
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.
Applied to files:
e2e/vue-router/sentry-integration/package.jsone2e/vue-router/sentry-integration/src/main.tsxe2e/vue-router/sentry-integration/tsconfig.json
📚 Learning: 2025-10-09T12:59:14.842Z
Learnt from: hokkyss
Repo: TanStack/router PR: 5418
File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3
Timestamp: 2025-10-09T12:59:14.842Z
Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.
Applied to files:
e2e/vue-router/sentry-integration/playwright.config.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript strict mode with extensive type safety for all code
Applied to files:
e2e/vue-router/sentry-integration/tsconfig.json
🧬 Code graph analysis (1)
e2e/vue-router/sentry-integration/src/main.tsx (2)
packages/router-core/src/ssr/tsrScript.ts (1)
p(26-28)e2e/solid-router/js-only-file-based/src/main.jsx (1)
rootElement(14-14)
🔇 Additional comments (11)
e2e/vue-router/sentry-integration/tsconfig.json (1)
1-15: LGTM! TypeScript configuration is appropriate.The configuration correctly enables strict mode as per coding guidelines, and the Vue JSX setup with Bundler module resolution is suitable for this Vite-based e2e test project.
e2e/vue-router/sentry-integration/postcss.config.mjs (1)
1-5: LGTM! Correct Tailwind CSS v4 PostCSS configuration.The configuration correctly uses the
@tailwindcss/postcssplugin for Tailwind v4 integration.e2e/vue-router/sentry-integration/.gitignore (1)
1-11: LGTM! Appropriate ignore patterns for Vite + Playwright.The gitignore correctly excludes build artifacts, test results, and Playwright reports, preventing test metadata from being committed (unlike the issue in
basepath-file-based/test-results/.last-run.json).e2e/vue-router/basepath-file-based/test-results/.last-run.json (1)
1-4: Test artifacts should not be committed to version control.This file appears to be Playwright-generated test metadata and should be excluded via .gitignore. The sibling directory
e2e/vue-router/sentry-integration/.gitignorecorrectly excludes/test-results/, but this directory (basepath-file-based) may be missing similar ignore rules.Ensure the parent directory or
e2e/vue-router/basepath-file-based/has a.gitignorethat includes:/test-results/ /playwright-report/ /blob-report/⛔ Skipped due to learnings
Learnt from: nlynzaad Repo: TanStack/router PR: 5402 File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21 Timestamp: 2025-10-08T08:11:47.088Z Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.Learnt from: hokkyss Repo: TanStack/router PR: 5418 File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3 Timestamp: 2025-10-09T12:59:14.842Z Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61 Timestamp: 2025-10-01T18:31:35.420Z Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.Learnt from: hokkyss Repo: TanStack/router PR: 5418 File: e2e/react-start/custom-identifier-prefix/src/styles/app.css:19-21 Timestamp: 2025-10-09T12:59:02.129Z Learning: In e2e test directories (paths containing `e2e/`), accessibility concerns like outline suppression patterns are less critical since the code is for testing purposes, not production use.e2e/vue-router/sentry-integration/vite.config.js (1)
7-7: Clarify sentryVitePlugin() configuration for e2e context.The Sentry Vite plugin emits warnings when no auth token is provided ("Will not create release" and "Will not upload source maps"), but the build succeeds. For this e2e test, this behavior is acceptable since source map upload isn't required. However, if source maps need to be uploaded to Sentry, add configuration with
authToken,org, andprojectoptions.e2e/vue-router/sentry-integration/package.json (1)
18-19: LGTM: Workspace protocol correctly applied.Internal dependencies correctly use the
workspace:*protocol as required by the coding guidelines.Also applies to: 27-27
e2e/vue-router/sentry-integration/playwright.config.ts (1)
1-34: LGTM: Playwright configuration follows e2e patterns.The configuration correctly:
- Uses the
getTestServerPortutility for dynamic port allocation- Passes the port to Vite via environment variables
- Configures a single worker to avoid port conflicts
- Sets up the webServer with build and preview commands
- Uses modern JSON import syntax (requires Node.js 20.10+)
e2e/vue-router/sentry-integration/src/main.tsx (4)
78-87: LGTM: Mock Sentry transport appropriate for e2e tests.The Sentry initialization correctly uses a mock transport that doesn't make network calls, which is appropriate for e2e testing. The configuration includes a DSN, trace sampling rate, and disables client reports.
72-76: LGTM: Module augmentation correctly implements type safety.The TypeScript module augmentation properly registers the router instance with the
@tanstack/vue-routermodule, enabling type-safe routing throughout the application.
89-97: LGTM: Safe mounting logic with HMR support.The mounting logic appropriately:
- Uses non-null assertion (acceptable in e2e test context)
- Checks if the root element is empty before mounting (supports HMR)
- Uses Vue 3's
createAppwith setup function returning JSX
3-4: The commented integration at line 80 is indeed present in this Sentry + TanStack Router Vue e2e test. The file confirms:
- Line 13 imports from
@tanstack/vue-router, indicating TanStack Router Vue support exists- Line 3 attempts to import
tanstackRouterBrowserTracingIntegrationfrom@sentry/vue/tanstackrouter- Line 80 shows the integration is commented out:
// integrations: [tanstackRouterBrowserTracingIntegration(router)],Given the directory name
e2e/vue-router/sentry-integrationand test structure, the integration's disabled state warrants clarification. Determine if this is intentional (e.g., pending Sentry feature availability) or should be enabled to properly test the TanStack Router + Sentry integration.
| }, | ||
| "dependencies": { | ||
| "@sentry/vue": "^10.31.0", | ||
| "@sentry/tracing": "^7.120.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n "e2e/vue-router/sentry-integration/package.json"Repository: TanStack/router
Length of output: 1219
🏁 Script executed:
find "e2e/vue-router/sentry-integration" -type f \( -name "*.ts" -o -name "*.js" -o -name "*.vue" -o -name "*.tsx" -o -name "*.jsx" \) | head -20Repository: TanStack/router
Length of output: 261
🏁 Script executed:
cat -n "e2e/vue-router/sentry-integration/src/main.tsx"Repository: TanStack/router
Length of output: 2797
🏁 Script executed:
rg "@sentry/tracing" "e2e/vue-router/sentry-integration"Repository: TanStack/router
Length of output: 140
🏁 Script executed:
rg "sentry/tracing" "e2e/vue-router/sentry-integration"Repository: TanStack/router
Length of output: 140
🏁 Script executed:
cat -n "e2e/vue-router/sentry-integration/vite.config.js" && echo "---" && cat -n "e2e/vue-router/sentry-integration/playwright.config.ts"Repository: TanStack/router
Length of output: 1442
Remove unused @sentry/tracing dependency.
The @sentry/tracing package is not imported or used anywhere in this project. The Sentry initialization in main.tsx uses @sentry/vue v10.31.0, which includes built-in tracing functionality (configured via tracesSampleRate). This dependency should be removed from package.json.
🤖 Prompt for AI Agents
In e2e/vue-router/sentry-integration/package.json around line 15, remove the
unused "@sentry/tracing": "^7.120.3" dependency entry from package.json; then
run the package manager (npm/yarn/pnpm) to update node_modules and the lockfile
(package-lock.json/yarn.lock/pnpm-lock.yaml), and ensure there are no imports or
references to @sentry/tracing anywhere in the project before committing.
| test('should load', async ({ page }) => { | ||
| await expect(page.getByRole('heading')).toContainText('Welcome Home!') | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add Sentry integration verification tests.
The test suite only verifies basic page rendering but doesn't validate the Sentry integration itself. For an e2e test titled "sentry-integration", consider adding tests that verify:
- Sentry SDK initialization
- Error capture and reporting
- Navigation breadcrumbs
- Router integration tracking
Would you like me to generate example test cases that verify Sentry's integration with Vue Router (e.g., triggering an error and checking Sentry captured it)?
🤖 Prompt for AI Agents
In e2e/vue-router/sentry-integration/tests/app.spec.ts around lines 8–10, the
suite only asserts page rendering; add focused e2e tests to verify Sentry
integration by: 1) asserting the Sentry SDK initialized on page load (e.g.,
expose a window.sentryInitialized flag or check window.Sentry exists), 2)
triggering a controlled error in the app via page.evaluate and asserting Sentry
captured it by stubbing/mocking the transport or spying on
window.Sentry.captureException (ensure the app under test uses a configurable
mock transport for tests), 3) navigating between routes and asserting breadcrumb
events are recorded (inspect window.Sentry.getCurrentHub or the mock transport
events for breadcrumb entries tied to router navigation), and 4) verifying
router integration metadata (route names/paths present in the captured event).
Implement these by adding tests that set up the mock transport before load,
trigger error/navigation via Playwright APIs, then await and assert the mock
transport received the expected envelopes/events containing the error and
breadcrumb/router info.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.