-
Notifications
You must be signed in to change notification settings - Fork 484
Speed up tests #1063
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
base: dev
Are you sure you want to change the base?
Speed up tests #1063
Conversation
Preview Screenshots⏳ Preview screenshots are being captured... Workspace and dev browser links will appear here once the preview environment is ready. Generated by cmux preview system |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR systematically refactors authentication setup across 40+ e2e test files, replacing OTP-based sign-in (Auth.Otp.signIn) with fast signup (Auth.fastSignUp) and removing magic-link-enabled project configurations. Some tests transition from mailbox-based to token-based authentication context. One backend helper assertion is updated to use structural matching. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~45 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
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.
Pull request overview
This PR optimizes test execution speed by replacing the slower OTP-based authentication flow (Auth.Otp.signIn()) with a faster direct user creation and session setup approach (Auth.fastSignUp()). This eliminates the need for magic link email verification in tests.
Key changes:
- Migrated from
Auth.Otp.signIn()toAuth.fastSignUp()across all e2e tests - Removed unnecessary
magic_link_enabled: trueconfiguration flags from test project setups - Simplified user creation by eliminating redundant
bumpEmailAddress()calls sincefastSignUp()creates unique users automatically
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/e2e/tests/general/setup-wizard.test.ts | Conditionally runs test only in CI environments |
| apps/e2e/tests/backend/endpoints/api/v1/users.test.ts | Replaces OTP sign-in with fast signup; removes magic_link config |
| apps/e2e/tests/backend/endpoints/api/v1/teams.test.ts | Updates auth method and fixes test name for deletion permission test |
| apps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.ts | Migrates to fast signup authentication |
| apps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts | Updates auth and adjusts snapshots for users without email auth |
| apps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.ts | Changes from mailbox-based to userAuth-based context switching |
| apps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.ts | Migrates to fast signup with email parameters for invitation tests |
| apps/e2e/tests/backend/endpoints/api/v1/projects.test.ts | Updates all project tests to use fast signup |
| apps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.ts | Migrates permission tests to fast signup |
| apps/e2e/tests/backend/endpoints/api/v1/payments/*.test.ts | Updates payment-related tests to fast signup |
| apps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.ts | Migrates OAuth provider tests to fast signup |
| apps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.ts | Updates notification preference tests |
| apps/e2e/tests/backend/endpoints/api/v1/internal/*.test.ts | Updates internal API tests with proper context switching |
| apps/e2e/tests/backend/endpoints/api/v1/integrations/**/*.test.ts | Migrates integration tests to fast signup |
| apps/e2e/tests/backend/endpoints/api/v1/data-vault.test.ts | Updates data vault tests |
| apps/e2e/tests/backend/backend-helpers.ts | Enhances User.create() response validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| it("completes successfully", async ({ expect }) => { | ||
| // note that we run this only in CI environments | ||
| it.runIf(!!process.env.CI)("completes successfully", async ({ expect }) => { | ||
| throw new Error("Not implemented"); |
Copilot
AI
Dec 12, 2025
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.
The test is being skipped in non-CI environments but has a throw new Error("Not implemented") statement that will always execute when the test runs in CI. This will cause the test to fail in CI environments. If the test is not yet implemented, it should be marked with it.todo() instead, or the throw statement should be removed if the test body below it is the actual implementation.
| const { userId: user2Id } = await Auth.fastSignUp(); | ||
|
|
Copilot
AI
Dec 12, 2025
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.
Unused variable user2Id.
| const { userId: user2Id } = await Auth.fastSignUp(); |
|
|
||
| backendContext.set({ mailbox: createMailbox() }); | ||
| const user2 = await Auth.Otp.signIn(); | ||
| const user2 = await Auth.fastSignUp(); |
Copilot
AI
Dec 12, 2025
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.
Unused variable user2.
| const user2 = await Auth.fastSignUp(); | |
| await Auth.fastSignUp(); |
|
|
||
| it("lets users be on multiple teams", async ({ expect }) => { | ||
| const { userId: creatorUserId } = await Auth.Otp.signIn(); | ||
| const { userId: creatorUserId } = await Auth.fastSignUp(); |
Copilot
AI
Dec 12, 2025
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.
Unused variable creatorUserId.
| const { userId: creatorUserId } = await Auth.fastSignUp(); | |
| await Auth.fastSignUp(); |
| it("completes successfully", async ({ expect }) => { | ||
| // note that we run this only in CI environments | ||
| it.runIf(!!process.env.CI)("completes successfully", async ({ expect }) => { | ||
| throw new Error("Not implemented"); |
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.
Bug: Test always fails due to unconditional throw statement
The test has a throw new Error("Not implemented") statement at the beginning of its body that causes the test to always fail in CI environments. This appears to be accidentally committed debug/WIP code since the test is supposed to verify that the setup wizard "completes successfully" but will unconditionally throw before executing any test logic.
|
|
||
| backendContext.set({ mailbox: mailboxB }); | ||
| await Auth.Otp.signIn(); | ||
| await Auth.fastSignUp(); |
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.
Bug: Missing email parameter when accepting team invitation
The Auth.fastSignUp() call is missing the email parameter. The test sends a team invitation to mailboxB.emailAddress (line 357) but then creates a user without that email. The original Auth.Otp.signIn() would use the mailbox email from the backend context, and similar tests in team-invitations.test.ts correctly pass { primary_email: mailboxB.emailAddress, primary_email_verified: true } to fastSignUp() when accepting invitations. This inconsistency may cause the test to fail if invitation acceptance validates that the user's email matches the invited email.
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: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
apps/e2e/tests/general/setup-wizard.test.ts (1)
9-14: Remove unreachable code.Lines 9-14 are unreachable due to the throw on line 8. If the test is truly disabled, remove the dead code. If the test should be active, remove the throw on line 8 instead.
Apply this diff if the test is permanently/temporarily disabled:
- const [error, stdout, stderr] = await new Promise<[Error | null, string, string]>((resolve) => { - exec("pnpm -C packages/init-stack run test-run", (error, stdout, stderr) => { - resolve([error, stdout, stderr]); - }); - }); - expect(error, `Expected no error to be thrown!\n\n\n\nstdout: ${stdout}\n\n\n\nstderr: ${stderr}`).toBeNull();apps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.ts (1)
91-91: Removemagic_link_enabled: trueto align with PR objective.The PR aims to remove magic-link-enabled configurations for test speedup. This test doesn't validate magic link functionality—it focuses on permission creation and granting. The flag should be removed.
Apply this diff:
- const { adminAccessToken } = await Project.createAndGetAdminToken({ config: { magic_link_enabled: true } }); + const { adminAccessToken } = await Project.createAndGetAdminToken();apps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.ts (1)
493-503: Guard againstcodeextraction returningundefined(flaky wrong-error failure)If the regex match fails, you’ll send
code: undefinedand likely get a schema/validation error instead ofITEM_QUANTITY_INSUFFICIENT_AMOUNT. Add a precondition assertion.backendContext.set({ mailbox: mailboxB }); await Auth.fastSignUp({ primary_email: mailboxB.emailAddress, primary_email_verified: true }); const invitationMessages = await mailboxB.waitForMessagesWithSubject("join"); + const code = + invitationMessages + .findLast((m) => m.subject.includes("join")) + ?.body?.text + .match(/http:\/\/localhost:12345\/some-callback-url\?code=([a-zA-Z0-9]+)/) + ?.[1]; + expect(code).toBeTruthy(); const acceptResponse = await niceBackendFetch("/api/v1/team-invitations/accept", { method: "POST", accessType: "client", body: { - code: invitationMessages.findLast((m) => m.subject.includes("join"))?.body?.text.match(/http:\/\/localhost:12345\/some-callback-url\?code=([a-zA-Z0-9]+)/)?.[1], + code, }, });apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts (1)
100-109: Test name mismatch: “invalid customer_id” vs actual assertion (“customer type mismatch”).This test asserts
PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH(team vs user product), not an invalidcustomer_id. Consider renaming the test to reflect what it’s actually validating (or change the request to truly represent an invalidcustomer_idscenario).apps/e2e/tests/backend/endpoints/api/v1/users.test.ts (1)
520-531: Remove unusedsecretlocal in the “valid base64” test.
It’s currently dead code.it("should be able to update totp_secret_base64 to valid base64", async ({ expect }) => { await Auth.fastSignUp(); - const secret = generateSecureRandomString(32); const response = await niceBackendFetch("/api/v1/users/me", { accessType: "client", method: "PATCH", body: { totp_secret_base64: "ZXhhbXBsZSB2YWx1ZQ==", }, }); expect(response.status).toEqual(200); });apps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.ts (1)
303-330: Multi-user flow likely depends onAuth.fastSignUp()switching the active auth context—make that dependency explicit (or document it).Right now team2 creation occurs after signing up user2, but you don’t explicitly set
backendContext.userAuthto user2. IffastSignUp()ever stops switching context, team2 may be created as user1 and weaken the “not a member” assertion.One option is to capture user2 tokens + set context before creating team2:
- const { userId: user2Id } = await Auth.fastSignUp(); + const { userId: user2Id, accessToken: user2AccessToken, refreshToken: user2RefreshToken } = await Auth.fastSignUp(); + backendContext.set({ userAuth: { accessToken: user2AccessToken, refreshToken: user2RefreshToken } });(or add a short comment that
fastSignUp()switchesbackendContext.userAuthas a contract).
🧹 Nitpick comments (10)
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.ts (1)
55-58: Consider consolidating repeated signup setup (if isolation permits)Doing
await Auth.fastSignUp();in each test is fine for isolation, but iffastSignUpis expensive and safe to share, consider abeforeEach/beforeAllhelper for the suite to reduce overhead.apps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.ts (1)
4-18: Remove unnecessarymagic_link_enabled: truefrom project configuration.Since
Auth.fastSignUp()doesn't depend on or usemagic_link_enabled, this configuration flag can be removed from thecreateAndSwitchToOAuthEnabledProject()helper function to keep test setup minimal.apps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.ts (1)
249-263: Permission tests look consistent after auth migration; same caution about project/session couplingIf any of these
accessType: "client"calls rely on an implicit current project, consider consistently callingProject.createAndSwitch()at the top of such tests to avoid hidden dependencies.apps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.ts (1)
92-114: Auth.fastSignUp() swap is good; consider making the Stripe URL assertion less brittle if this ever flakes.
E.g., assertstatus+urlorigin/path prefix (instead of the full URL string).apps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.ts (1)
303-310: Auth.fastSignUp() usage is clean here; optionally re-check ifmagic_link_enabled: trueis still required.Also applies to: 440-450
apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.ts (1)
303-309: Auth.fastSignUp() swap looks correct; optionally confirmmagic_link_enabledcan be dropped for more speed.apps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.ts (1)
5-14: Make thefastSignUp → backendContext.userAuthdependency explicit (and store a stable copy).
This avoids “mystery” failures ifAuth.fastSignUp()ever stops populatingbackendContext.value.userAuth.async function signInAndCreateTeam() { const { userId: userId1 } = await Auth.fastSignUp(); - const userAuth = backendContext.value.userAuth; + const userAuth = backendContext.value.userAuth; + expect(userAuth).not.toBeNull(); + const userAuth1 = { ...userAuth! }; await bumpEmailAddress(); const { userId: userId2 } = await Auth.fastSignUp(); await bumpEmailAddress(); const { userId: userId3 } = await Auth.fastSignUp(); @@ // Sign back in as user 1 backendContext.set({ - userAuth: userAuth, + userAuth: userAuth1, }); const currentUser = await User.getCurrent(); expect(currentUser.id).toBe(userId1);Also applies to: 54-60
apps/e2e/tests/backend/endpoints/api/v1/users.test.ts (1)
593-621: Avoid redundant sign-up right before clearinguserAuth(saves time).
If the test only needs “no user auth”, you can skipAuth.fastSignUp()here.it("should not be able to read a user", async ({ expect }) => { - await Auth.fastSignUp(); backendContext.set({ userAuth: null, }); const response = await niceBackendFetch("/api/v1/users/123", { accessType: "client", }); expect(response).toMatchInlineSnapshot(` NiceResponse { "status": 401, "body": { "code": "INSUFFICIENT_ACCESS_TYPE", "details": { "actual_access_type": "client", "allowed_access_types": [ "server", "admin", ], }, "error": "The x-stack-access-type header must be 'server' or 'admin', but was 'client'.", }, "headers": Headers { "x-stack-known-error": "INSUFFICIENT_ACCESS_TYPE", <some fields may have been hidden>, }, } `); });apps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts (1)
782-796: Consider replacing fixedwait(5000)with polling for webhook delivery.
This is often a bigger win for “speed up tests” (and reduces flakiness).apps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.ts (1)
2-2: Context switching looks intentional; consider scoping it to avoid cross-test leakage.
If available, preferbackendContext.with({ projectKeys: ... }, async () => { ... })overbackendContext.set(...)for temporary key changes.Also applies to: 46-67, 109-123, 400-403
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (33)
apps/e2e/tests/backend/backend-helpers.ts(1 hunks)apps/e2e/tests/backend/endpoints/api/v1/data-vault.test.ts(6 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.ts(5 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts(3 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.ts(6 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.ts(1 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.ts(6 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.ts(5 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts(3 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.ts(3 hunks)apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.ts(6 hunks)apps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.ts(1 hunks)apps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.ts(2 hunks)apps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.ts(2 hunks)apps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.ts(5 hunks)apps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.ts(7 hunks)apps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.ts(3 hunks)apps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.ts(20 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.ts(3 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.ts(1 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts(4 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/items.test.ts(2 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/products.test.ts(1 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.ts(2 hunks)apps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.ts(7 hunks)apps/e2e/tests/backend/endpoints/api/v1/projects.test.ts(14 hunks)apps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.ts(17 hunks)apps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.ts(2 hunks)apps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts(26 hunks)apps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.ts(7 hunks)apps/e2e/tests/backend/endpoints/api/v1/teams.test.ts(21 hunks)apps/e2e/tests/backend/endpoints/api/v1/users.test.ts(16 hunks)apps/e2e/tests/general/setup-wizard.test.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Always add new E2E tests when changing the API or SDK interface
For blocking alerts and errors, never use toast; use alerts instead as they are less easily missed by the user
NEVER try-catch-all, NEVER void a promise, and NEVER .catch(console.error); use loading indicators and async callbacks instead, or use runAsynchronously/runAsynchronouslyWithAlert for error handling
Use ES6 maps instead of records wherever you can
Files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/backend-helpers.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Prefer .toMatchInlineSnapshot over other selectors in tests when possible; check snapshot-serializer.ts for formatting details
Files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
**/*.{ts,tsx,css}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,css}: Keep hover/click transitions snappy and fast; avoid fade-in delays on hover. Apply transitions after action completion instead, like smooth fade-out when hover ends
Use hover-exit transitions instead of hover-enter transitions; for example, use 'transition-colors hover:transition-none' instead of fade-in on hover
Files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/backend-helpers.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
apps/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
NEVER use Next.js dynamic functions if you can avoid them; prefer using client components and hooks like usePathname instead of await params to keep pages static
Files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/backend-helpers.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
{.env*,**/*.{ts,tsx,js}}
📄 CodeRabbit inference engine (AGENTS.md)
Prefix environment variables with STACK_ (or NEXT_PUBLIC_STACK_ if public) so changes are picked up by Turborepo and improves readability
Files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/backend-helpers.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
apps/e2e/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Always add new E2E tests when changing API or SDK interface; err on the side of creating too many tests due to the critical nature of the industry
Files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/backend-helpers.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
🧠 Learnings (5)
📚 Learning: 2025-12-04T18:03:49.984Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-04T18:03:49.984Z
Learning: Applies to apps/e2e/**/*.{ts,tsx} : Always add new E2E tests when changing API or SDK interface; err on the side of creating too many tests due to the critical nature of the industry
Applied to files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/backend-helpers.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
📚 Learning: 2025-12-04T18:03:49.984Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-04T18:03:49.984Z
Learning: Applies to **/*.{ts,tsx} : Always add new E2E tests when changing the API or SDK interface
Applied to files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/products.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/teams.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.tsapps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.tsapps/e2e/tests/backend/backend-helpers.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.tsapps/e2e/tests/general/setup-wizard.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.tsapps/e2e/tests/backend/endpoints/api/v1/users.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.tsapps/e2e/tests/backend/endpoints/api/v1/data-vault.test.tsapps/e2e/tests/backend/endpoints/api/v1/internal/payments/setup.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.tsapps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/items.test.tsapps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts
📚 Learning: 2025-12-03T07:19:44.433Z
Learnt from: madster456
Repo: stack-auth/stack-auth PR: 1040
File: packages/stack-shared/src/interface/crud/oauth-providers.ts:62-87
Timestamp: 2025-12-03T07:19:44.433Z
Learning: In packages/stack-shared/src/interface/crud/oauth-providers.ts and similar CRUD files, the tag "Oauth" (not "OAuth") is the correct capitalization format as it's used by the documentation generation system and follows OpenAPI conventions.
Applied to files:
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.tsapps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.tsapps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.ts
📚 Learning: 2025-12-04T18:03:49.984Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-04T18:03:49.984Z
Learning: Run typecheck, lint, and test to ensure changes are working. You can save time by only linting and testing changed files and related E2E tests
Applied to files:
apps/e2e/tests/general/setup-wizard.test.ts
📚 Learning: 2025-12-04T18:03:49.984Z
Learnt from: CR
Repo: stack-auth/stack-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-04T18:03:49.984Z
Learning: Applies to **/*.test.{ts,tsx} : Prefer .toMatchInlineSnapshot over other selectors in tests when possible; check snapshot-serializer.ts for formatting details
Applied to files:
apps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.ts
🧬 Code graph analysis (14)
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.ts (2)
packages/template/src/lib/stack-app/index.ts (1)
Auth(96-96)packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)
apps/e2e/tests/backend/endpoints/api/v1/projects.test.ts (2)
packages/template/src/lib/stack-app/index.ts (1)
Auth(96-96)packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)
apps/e2e/tests/backend/endpoints/api/v1/teams.test.ts (5)
packages/template/src/lib/stack-app/index.ts (3)
Auth(96-96)Project(76-76)Team(87-87)packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)packages/template/src/lib/stack-app/projects/index.ts (1)
Project(9-13)packages/template/src/lib/stack-app/teams/index.ts (1)
Team(36-50)apps/e2e/tests/helpers.ts (1)
it(12-12)
apps/e2e/tests/backend/endpoints/api/v1/payments/purchase-session.test.ts (1)
packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)
apps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.ts (1)
apps/e2e/tests/backend/backend-helpers.ts (1)
backendContext(35-57)
apps/e2e/tests/general/setup-wizard.test.ts (1)
apps/e2e/tests/helpers.ts (1)
it(12-12)
apps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.ts (2)
packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)packages/template/src/lib/stack-app/projects/index.ts (1)
Project(9-13)
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.ts (4)
packages/template/src/lib/stack-app/index.ts (1)
Auth(96-96)packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)apps/e2e/tests/backend/backend-helpers.ts (1)
niceBackendFetch(109-173)apps/e2e/tests/helpers.ts (1)
it(12-12)
apps/e2e/tests/backend/endpoints/api/v1/internal/projects.test.ts (2)
packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)apps/e2e/tests/backend/backend-helpers.ts (2)
backendContext(35-57)InternalProjectKeys(77-82)
apps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.ts (2)
packages/template/src/lib/stack-app/index.ts (1)
Auth(96-96)packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)
apps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.ts (2)
packages/template/src/lib/stack-app/index.ts (1)
Auth(96-96)packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)
apps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.ts (1)
apps/e2e/tests/backend/backend-helpers.ts (2)
backendContext(35-57)bumpEmailAddress(179-187)
apps/e2e/tests/backend/endpoints/api/v1/payments/items.test.ts (1)
packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)
apps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts (4)
packages/template/src/lib/stack-app/index.ts (3)
Auth(96-96)Team(87-87)Project(76-76)packages/template/src/lib/stack-app/users/index.ts (1)
Auth(71-77)packages/template/src/lib/stack-app/teams/index.ts (1)
Team(36-50)apps/e2e/tests/backend/backend-helpers.ts (1)
backendContext(35-57)
🪛 Biome (2.1.2)
apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts
[error] 160-160: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts
[error] 160-160: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: Agent
- GitHub Check: CodeQL analysis (javascript-typescript)
- GitHub Check: Vercel Agent Review
- GitHub Check: Cursor Bugbot
- GitHub Check: lint_and_build (latest)
- GitHub Check: all-good
- GitHub Check: check_prisma_migrations (22.x)
- GitHub Check: build (22.x)
- GitHub Check: setup-tests
- GitHub Check: build (22.x)
- GitHub Check: restart-dev-and-test
- GitHub Check: docker
- GitHub Check: restart-dev-and-test-with-custom-base-port
- GitHub Check: build (22.x)
🔇 Additional comments (49)
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/current.test.ts (2)
5-7: VerifyAuth.fastSignUp()provides the expected auth context forProject.createAndGetAdminToken()If
Project.createAndGetAdminToken()depends on an existing authenticated session/user, confirmAuth.fastSignUp()establishes that deterministically (and doesn’t introduce cross-test state that could make this test flaky).
112-115: Double-check user/project coupling assumptions with fast signupThis test mutates project config; verify
Auth.fastSignUp()doesn’t accidentally reuse a shared user/project (or cached identity) that could cause order-dependent failures when tests run in parallel or are retried.apps/e2e/tests/backend/endpoints/api/v1/internal/email-templates.test.ts (2)
5-9: VerifyAuth.fastSignUp()actually establishes the admin/auth context needed byProject.createAndGetAdminToken().If
Project.createAndGetAdminToken()doesn’t depend on the current auth session,Auth.fastSignUp()here may be redundant; if it does, this change is correct but should be explicit in helper docs/usages to avoid future flakiness. (Based on learnings, apps/e2e tests are critical.)
48-63: No action needed — both tests properly establish admin access. Test 2'sProject.createAndSwitch()automatically setsadminAccessTokenin the project context, whichniceBackendFetch()includes in request headers whenaccessType: "admin"is specified. The approaches differ by design (explicit vs. context-based), but both are correct and consistent with the test helper architecture.apps/e2e/tests/backend/endpoints/api/v1/payments/items.test.ts (2)
340-340: LGTM! Authentication method updated to speed up tests.The replacement of OTP-based sign-in with
fastSignUpaligns with the PR objective to speed up test execution while maintaining the same test coverage.
374-374: LGTM! Consistent authentication method change.The replacement maintains test integrity while improving execution speed. The subsequent invitation acceptance flow remains properly tested.
apps/e2e/tests/backend/endpoints/api/v1/project-permissions.test.ts (7)
5-5: LGTM: Auth flow optimized for speed.The change from OTP-based sign-in to
fastSignUp()appropriately speeds up test setup while maintaining the same authentication context needed for this test.
21-21: LGTM: Auth flow optimized for speed.The change to
fastSignUp()appropriately obtains theuserIdneeded for testing permission grants while improving test performance.
45-46: LGTM: Test setup optimized.The addition of
Project.createAndSwitch()ensures test isolation, and the change tofastSignUp()speeds up authentication setup while maintaining necessary context for permission scope validation.
180-180: LGTM: Initial auth setup optimized.The change to
fastSignUp()speeds up the initial test setup. The subsequent use ofAuth.Password.signUpWithEmailon line 253 is appropriate for testing default permission assignment to a newly created user.
279-279: LGTM: Auth flow optimized for speed.The change to
fastSignUp()appropriately obtains theuserIdneeded for testing permission grants and webhook triggers while improving test performance.
318-318: LGTM: Auth flow optimized for speed.The change to
fastSignUp()speeds up the test setup for validating permission revocation and webhook events.
364-364: LGTM: Auth flow optimized for speed.The change to
fastSignUp()appropriately speeds up authentication setup for testing duplicate permission ID validation.apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--create-purchase-url.test.ts (3)
257-280: LGTM for server path; consider adding a minimal assertion that the URL is tied to the signed-up user only if that’s a contract.
Current assertions validate 200 + URL shape; that’s probably sufficient for this endpoint test, andfastSignUp()is a clean speedup.
100-109: ConfirmAuth.fastSignUp()establishes client auth context (not just a user record).
This test’s client request expects a 400 (customer/product type mismatch). IfAuth.fastSignUp()doesn’t also authenticate the client (cookies/session), this could start failing with 401/403 and mask the intended assertion.Search in stack-auth repo docs/usage for `Auth.fastSignUp` in e2e tests: does it authenticate the session/cookies for subsequent client fetches, or only create a user?
177-199: Looks good; the test correctly validates the client-access restriction.Using
fastSignUp()to establish a session with valid tokens is correct here. TheniceBackendFetchwithaccessType: "client"receives the access token frombackendContext.userAuth(set byfastSignUp) and includes it in request headers. The "Cannot specify product_inline when calling from client" error is triggered by the backend validating the access type restriction, not by missing authentication. Note thatuserIdis used in the request body ascustomer_id, so no unused variables here.apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/transfer.test.ts (6)
29-41: Auth swap looks correct for transfer confirmation flow (initiate → sign up → confirm).
This keeps the “Neon initiates” step independent while still ensuring the confirm runs under an authenticated client context.
70-73: Good: useAuth.fastSignUp()beforeProject.create()to avoid OTP latency.
126-138: Potential flake vector: ensureAuth.fastSignUp()produces the expected client auth context for repeated confirms.
IfAuth.fastSignUp()relies on shared/global state (cookie jar) across tests, parallel runs can get noisy—worth confirming this file passes under the CI’s parallelization settings.
165-177: LGTM: auth setup moved to fast path without changing assertions/coverage.
247-259: LGTM: fast signup before confirm/check keeps the test intent unchanged.
268-287: LGTM: fast signup before confirm preserves the “already used” check semantics.apps/e2e/tests/backend/endpoints/api/v1/payments/products.test.ts (1)
367-367: LGTM! Auth method change aligns with PR objectives.The switch from
Auth.Otp.signIn()toAuth.fastSignUp()appropriately supports the "speed up tests" objective while maintaining test correctness. The test only requires a validuserId, so the authentication method doesn't affect the inline product granting functionality being tested.apps/e2e/tests/backend/endpoints/api/v1/oauth-providers.test.ts (1)
22-22: LGTM! Systematic refactoring to speed up tests.The replacement of
Auth.Otp.signIn()withAuth.fastSignUp()across all test cases is consistent and well-executed. The change:
- Maintains all test assertions and expected behavior
- Properly preserves return values where needed for multi-user scenarios
- Aligns with the PR objective to speed up test execution
- Only modifies test infrastructure without changing the API surface being tested
Also applies to: 60-60, 104-104, 154-154, 199-199, 247-247, 298-298, 316-316, 337-337, 355-355, 374-374, 475-475, 496-496, 622-622, 694-694, 722-722, 749-749, 815-815, 935-935, 956-956
apps/e2e/tests/backend/endpoints/api/v1/team-invitations.test.ts (10)
26-28: Potential test coupling:Auth.fastSignUp()without an explicit project switch before client callsThis test later performs a
accessType: "client"request; ifAuth.fastSignUp()doesn’t guarantee an active project context, this can become order-dependent/flaky. Consider addingawait Project.createAndSwitch()here (or document that fastSignUp implicitly selects a project).
60-63: Good speedup path; verifycreateAndAddCurrentUserWithoutMemberPermission()still targets the intended “current” user
Project.createAndSwitch()+Auth.fastSignUp()should makeUser.getCurrent()deterministic for the helper; this looks aligned with the PR goal.
76-79: Recipient fast-signup looks right; ensure context isolation across sign-upsSwitching to
Auth.fastSignUp({ primary_email, primary_email_verified: true })is consistent with the suite-wide migration. Just ensurebackendContext/session reset is intentional since the test signs up multiple users.
133-136: Nice cleanup of “no current server user” flow; watch forbackendContextleakageSetting
backendContext.set({ userAuth: null })earlier and then signing up here is fine as long as the harness resets context per test; otherwise, add a reset at the end.
146-149:Auth.fastSignUp()swap is fine; consider explicit project setup if required by your auth helper
211-214: MultiplefastSignUp()calls: ensure the “acting user” matches theaccessType: "client"requestThis test intentionally ends with the “teamAdmin” user as the current session before the client GET—good. Just verify
Team.addMember(teamId, teamAdmin)is truly server-privileged (i.e., not relying on whichever user is currently signed in).Also applies to: 223-225
319-332: Good migration tofastSignUp(); keep tests deterministic re: current project
368-381: Good: inviter/admin setup is much faster; verify team membership mutations don’t depend on current session
427-441: Good coverage retained after migration; same “acting user” verification for revoke permission paths
467-471: Looks correct withInternalProjectKeys; confirmfastSignUp()respects the set project keysapps/e2e/tests/backend/endpoints/api/v1/internal/api-keys.test.ts (1)
59-59: Approved. Authentication method updated for faster test execution.The replacement of
Auth.Otp.signUp()withAuth.fastSignUp()aligns with the PR's goal to speed up tests. Both tests verify admin operations usingaccessType: "admin"in subsequent fetch calls, which combine the user authentication context established byfastSignUp()with admin credentials from the internal project keys.⛔ Skipped due to learnings
Learnt from: CR Repo: stack-auth/stack-auth PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-12-04T18:03:49.984Z Learning: Applies to apps/e2e/**/*.{ts,tsx} : Always add new E2E tests when changing API or SDK interface; err on the side of creating too many tests due to the critical nature of the industryLearnt from: CR Repo: stack-auth/stack-auth PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-12-04T18:03:49.984Z Learning: Applies to **/*.{ts,tsx} : Always add new E2E tests when changing the API or SDK interfaceapps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth-providers.test.ts (1)
6-6: LGTM! Auth.fastSignUp() provides equivalent authentication context for these tests.The migration from
Auth.Otp.signIn()toAuth.fastSignUp()is clean and consistent across all test cases. Both methods create a user account and retrieve an admin token via the samegetAdminToken()call, producing functionally equivalent tokens. The OAuth provider tests don't depend on email verification state, so skipping the OTP flow has no impact on test validity. This change safely accelerates test execution while preserving test functionality.apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts (1)
154-154: LGTM! OAuth flow tests work correctly with fast signup.The auth method migration is safe for OAuth integration tests. Each test properly isolates the OAuth flow with independent project creation, and the authorization code exchanges validate correctly with proper token generation.
apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts (1)
173-199:Auth.fastSignUp()usage looks consistent with needing an authenticated client context.Capturing
{ userId }fromfastSignUp()and using it ascustomer_idis coherent and keeps the tests deterministic.Also applies to: 253-280, 282-365
apps/e2e/tests/backend/backend-helpers.ts (1)
1352-1367: ImprovedUser.create()assertion (status + structural body check).Checking
201plus{ id: string }is a good balance: stricter than status-only, while still tolerant of additional response fields.apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/transfer.test.ts (1)
29-41:Auth.fastSignUp()placement is consistent with requiringaccessType: "client"auth for confirm/check paths.Given these endpoints are called with
accessType: "client"and rely onme/current-user semantics, setting user auth viafastSignUp()here makes sense.Also applies to: 70-73, 126-138, 165-168, 247-255, 268-276
apps/e2e/tests/backend/endpoints/api/v1/notification-preferences.test.ts (1)
33-35:Auth.fastSignUp()beforemepreference endpoints is appropriate.This keeps the tests fast (no mailbox polling) and preserves behavior for authenticated “me” routes.
Also applies to: 55-57, 89-91
apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/api-keys.test.ts (1)
57-66: Auth.fastSignUp() swap looks fine for establishing authenticated context before admin calls.apps/e2e/tests/backend/endpoints/api/v1/team-member-profiles.test.ts (1)
3-3: ImportingUserfor token-based “current user” verification makes sense.apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts (1)
154-154: Auth.fastSignUp migration looks consistent with the test intent (and should speed up).Also applies to: 161-161, 193-193, 247-247
apps/e2e/tests/backend/endpoints/api/v1/team-permissions.test.ts (1)
4-7: Auth.fastSignUp + simplified project setup updates look correct for these permission tests.Also applies to: 21-24, 46-50, 197-200, 271-276, 316-321, 360-363
apps/e2e/tests/backend/endpoints/api/v1/users.test.ts (1)
206-246: Auth.fastSignUp swaps look consistent with the surrounding assertions.Also applies to: 336-368, 370-410, 533-745, 746-780, 873-956, 2097-2129
apps/e2e/tests/backend/endpoints/api/v1/teams.test.ts (1)
5-15: Auth.fastSignUp + simplified project setup changes look correct across these team endpoint tests.Also applies to: 17-28, 30-56, 58-85, 86-115, 117-136, 138-176, 178-237, 239-277, 279-319, 321-353, 355-387, 389-423, 425-468, 470-503, 505-558, 560-605, 606-632, 634-668, 669-698
apps/e2e/tests/backend/endpoints/api/v1/team-memberships.test.ts (1)
6-35: fastSignUp migration + updated snapshots look coherent for membership scenarios.Also applies to: 37-195, 197-367, 455-525, 527-580, 583-618, 621-663, 664-699, 701-837
apps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.ts (1)
112-119: Good: explicit user switching viabackendContext.set({ userAuth })keeps the intent clear.Also applies to: 183-184
| it("can store and retrieve values from data vault", async ({ expect }: { expect: any }) => { | ||
| await createDataVaultEnabledProject(); | ||
| await Auth.Otp.signIn(); | ||
| await Auth.fastSignUp(); | ||
|
|
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.
Likely unnecessary Auth.fastSignUp() for accessType: "server" data-vault tests (adds cost).
In this same file, the “requires authentication” test does not sign in yet still expects 200 for accessType: "server" calls—so adding fastSignUp() in other tests appears redundant and slows the suite.
Consider removing the added sign-ins:
await createDataVaultEnabledProject();
- await Auth.fastSignUp();Also applies to: 79-82, 134-137, 168-171, 281-284, 337-340
🤖 Prompt for AI Agents
In apps/e2e/tests/backend/endpoints/api/v1/data-vault.test.ts around lines 40-43
(and similarly at 79-82, 134-137, 168-171, 281-284, 337-340), the tests call
Auth.fastSignUp() unnecessarily for data-vault scenarios using accessType:
"server" (which do not require authentication and add test cost); remove the
Auth.fastSignUp() calls from those test setups and any redundant sign-in
assertions so the tests rely on server-access behavior only, keeping other
authentication-dependent tests intact.
| it("list domains", async ({ expect }) => { | ||
| await Auth.Otp.signIn(); | ||
| await Auth.fastSignUp(); | ||
| const { adminAccessToken } = await Project.createAndGetAdminToken(); |
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.
Avoid redundant Auth.fastSignUp() before Project.createAndGetAdminToken() (double signup).
Same pattern as other files: Project.createAndGetAdminToken() already signs up by default, so the added Auth.fastSignUp() likely slows tests.
Also applies to: 25-27, 47-49, 98-100, 129-131
🤖 Prompt for AI Agents
In apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/domain.test.ts
around lines 4-6 (and similarly at 25-27, 47-49, 98-100, 129-131), the test is
calling Auth.fastSignUp() before Project.createAndGetAdminToken(), causing a
redundant double signup; remove the initial Auth.fastSignUp() calls so each test
relies solely on Project.createAndGetAdminToken() (which performs signup by
default), leaving the subsequent lines that use the returned adminAccessToken
unchanged.
| it(`should redirect to the correct callback URL`, async ({}) => { | ||
| await Auth.Otp.signIn(); | ||
| await Auth.fastSignUp(); | ||
| const createdProject = await Project.create(); | ||
|
|
||
| await authorize(createdProject.projectId); | ||
| }); |
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.
Fix Biome lint error: remove the empty object pattern in it callbacks.
async ({}) => should be async () => (also applies to the earlier test at Line 153), otherwise CI will fail with lint/correctness/noEmptyPattern.
-it(`should redirect to the correct callback URL`, async ({}) => {
+it(`should redirect to the correct callback URL`, async () => {
await Auth.fastSignUp();
const createdProject = await Project.create();
await authorize(createdProject.projectId);
});
-it(`should not redirect to the incorrect callback URL`, async ({}) => {
+it(`should not redirect to the incorrect callback URL`, async () => {
await Auth.fastSignUp();
await Project.create();
const result = await authorizePart1("http://localhost:30000/api/v2/wrong-url/authorize");
expect(result).toMatchInlineSnapshot(`
{
"cookies": "",
"responses": [
NiceResponse {
"status": 307,
"headers": Headers {
"location": "http://localhost:<$NEXT_PUBLIC_STACK_PORT_PREFIX>02/api/v1/integrations/custom/oauth/idp/auth?response_type=code&client_id=custom-local&redirect_uri=%3Cstripped+query+param%3E&state=%3Cstripped+query+param%3E&code_challenge=%3Cstripped+query+param%3E&code_challenge_method=S256&scope=openid",
<some fields may have been hidden>,
},
},
NiceResponse {
"status": 400,
"body": {
"error": "invalid_redirect_uri",
"error_description": "redirect_uri did not match any of the client's registered redirect_uris",
"iss": "http://localhost:<$NEXT_PUBLIC_STACK_PORT_PREFIX>02/api/v1/integrations/custom/oauth/idp",
"state": "eyJkZXRhaWxzIjp7ImV4dGVybmFsX3Byb2plY3RfbmFtZSI6ImN1c3RvbS1wcm9qZWN0In19",
},
"headers": Headers { <some fields may have been hidden> },
},
undefined,
],
}
`);
});Also applies to: 160-190, 192-285
🧰 Tools
🪛 Biome (2.1.2)
[error] 153-153: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
🤖 Prompt for AI Agents
In apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts
around lines 153 to 158 (and also for the other occurrences in ranges 160-190
and 192-285), the test callbacks use an empty object pattern `async ({}) =>`
which triggers the Biome lint rule `lint/correctness/noEmptyPattern`; change
each occurrence to use an empty parameter list `async () =>` so the callbacks
are `async () =>` instead of `async ({}) =>`.
| it("list domains", async ({ expect }) => { | ||
| await Auth.Otp.signIn(); | ||
| await Auth.fastSignUp(); | ||
| const { adminAccessToken } = await Project.createAndGetAdminToken(); |
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.
Avoid redundant Auth.fastSignUp() before Project.createAndGetAdminToken() (double signup).
Project.createAndGetAdminToken() already calls Auth.fastSignUp() by default (unless useExistingUser is true), so these added calls likely slow tests and are unnecessary.
Options:
- Remove the standalone
Auth.fastSignUp()lines, or - If you intended to reuse an existing user session, pass
useExistingUser: truetoProject.createAndGetAdminToken(...)and ensurebackendContext.value.userAuthis set.
Also applies to: 25-27, 47-49, 98-100, 129-131, 194-196
🤖 Prompt for AI Agents
In apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/domain.test.ts
around lines 4-6 (and also at 25-27, 47-49, 98-100, 129-131, 194-196): tests
call Auth.fastSignUp() immediately before Project.createAndGetAdminToken(),
which itself calls Auth.fastSignUp() by default, causing redundant double
signups; remove the standalone Auth.fastSignUp() calls OR, if you really need to
reuse an existing user session, call Project.createAndGetAdminToken({
useExistingUser: true }) and ensure backendContext.value.userAuth is set prior
to that call so only one signup occurs.
| const { userId } = await Auth.fastSignUp(); | ||
|
|
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.
Avoid implicit auth state: make backendContext.userAuth explicit after Auth.fastSignUp() (prevents order-dependent flakes).
In these tests you call Auth.fastSignUp() but don’t set/clear backendContext.userAuth. If fastSignUp() ever stops mutating global context (or a prior test leaves userAuth set), subsequent accessType: "server" calls can become order-dependent.
Suggested tweak (apply similarly to both tests):
- const { userId } = await Auth.fastSignUp();
+ const { userId, accessToken, refreshToken } = await Auth.fastSignUp();
+ backendContext.set({ userAuth: { accessToken, refreshToken } });Also consider clearing at the start of each it right after projectKeys:
- backendContext.set({ projectKeys: InternalProjectKeys });
+ backendContext.set({ projectKeys: InternalProjectKeys, userAuth: null });Also applies to: 219-220
🤖 Prompt for AI Agents
In apps/e2e/tests/backend/endpoints/api/v1/internal/projects/transfer.test.ts
around lines 11-12 (and also apply to lines 219-220 and the sibling test),
Auth.fastSignUp() is called but backendContext.userAuth is left implicit which
makes tests order-dependent; after each Auth.fastSignUp() call explicitly set
backendContext.userAuth = { userId } (or the proper auth object returned) and/or
clear backendContext.userAuth at the start of each it block (right after
projectKeys) to ensure tests don't rely on global mutated state; apply the same
explicit set/clear pattern to both tests mentioned.
| }); | ||
|
|
||
| it("should grant inline product without needing configuration", async ({ expect }) => { | ||
| await Project.createAndSwitch({ config: { magic_link_enabled: true } }); |
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.
Remove unnecessary magic_link_enabled config.
This project configuration appears inconsistent with the PR's refactoring pattern. According to the AI summary, this PR systematically removes magic_link_enabled configurations while transitioning to Auth.fastSignUp(). No other test in this file uses this config, and the test logic doesn't rely on magic link functionality.
Apply this diff:
- await Project.createAndSwitch({ config: { magic_link_enabled: true } });
+ await Project.createAndSwitch();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| await Project.createAndSwitch({ config: { magic_link_enabled: true } }); | |
| await Project.createAndSwitch(); |
🤖 Prompt for AI Agents
In apps/e2e/tests/backend/endpoints/api/v1/payments/products.test.ts around line
365, remove the unnecessary magic_link_enabled configuration from the
Project.createAndSwitch call; update the call to create/switch the project
without passing { config: { magic_link_enabled: true } } so it matches the
refactor pattern and other tests (i.e., call Project.createAndSwitch() or pass
only required config values).
| it("creates and updates the basic project information of a project", async ({ expect }) => { | ||
| await Auth.Otp.signIn(); | ||
| await Auth.fastSignUp(); | ||
| const { adminAccessToken } = await Project.createAndGetAdminToken(); | ||
| const { updateProjectResponse: response } = await Project.updateCurrent(adminAccessToken, { |
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.
Avoid redundant Auth.fastSignUp() before Project.createAndGetAdminToken() (double signup).
These tests now do fastSignUp() and then call Project.createAndGetAdminToken(), which (by default) signs up again. That’s likely extra work per test and counter to “Speed up tests”.
Concrete fix (example pattern):
- await Auth.fastSignUp();
const { adminAccessToken } = await Project.createAndGetAdminToken();Also applies to: 114-117, 166-169, 286-289, 343-346, 378-381, 702-705, 779-782, 1184-1187, 1206-1209, 1238-1241, 1569-1572
| it.runIf(!!process.env.CI)("completes successfully", async ({ expect }) => { | ||
| throw new Error("Not implemented"); |
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.
Critical: This test will fail in CI.
The test is gated to run only in CI (runIf(!!process.env.CI)), but immediately throws "Not implemented", which will cause CI pipeline failures.
If the test is being temporarily disabled for performance reasons (aligning with the PR's "Speed up tests" objective), use it.skip(...) instead. If it's genuinely not implemented yet, use it.todo(...).
Apply this diff to skip the test:
- // note that we run this only in CI environments
- it.runIf(!!process.env.CI)("completes successfully", async ({ expect }) => {
- throw new Error("Not implemented");
+ // Temporarily skipped to speed up test suite
+ it.skip("completes successfully", async ({ expect }) => {Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In apps/e2e/tests/general/setup-wizard.test.ts around lines 7-8, the test is
currently gated to run only in CI with it.runIf(!!process.env.CI) but
immediately throws "Not implemented", which will fail CI; replace the CI-gated
test with a skipped or todo test so CI won't run it (for example change to
it.skip("completes successfully", async () => { /* temporarily skipped */ }) or
it.todo("completes successfully")), removing the throw and the CI runIf guard.
| it("completes successfully", async ({ expect }) => { | ||
| // note that we run this only in CI environments | ||
| it.runIf(!!process.env.CI)("completes successfully", async ({ expect }) => { | ||
| throw new Error("Not implemented"); |
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.
| throw new Error("Not implemented"); |
The test immediately throws an error with the message "Not implemented", which will cause the test to always fail and make all subsequent test code unreachable.
View Details
Analysis
Removed accidentally added "Not implemented" error in setup-wizard test
What fails: The setup wizard test (setupWizard.test.ts) throws an error with message "Not implemented" immediately when executed, preventing the actual test logic from running.
How to reproduce:
# Run the setup wizard test
pnpm -C apps/e2e test -- setup-wizard.test.ts
# When CI environment variable is set, the test will fail with:
# Error: Not implementedResult: Test always throws Error("Not implemented") and never executes the actual test code that runs pnpm init-stack tests.
Expected: Test should execute the pnpm -C packages/init-stack run test-run command without throwing.
Root cause: The throw new Error("Not implemented"); statement was accidentally added in commit ff77394 ("Speed up tests", Dec 12 2025 14:54 UTC) during a refactoring that added it.runIf(!!process.env.CI) to conditionally run the test only in CI environments. This throw statement blocks the actual test implementation from ever executing.
Fix: Removed the erroneous throw statement to allow the test implementation to proceed normally.
Greptile OverviewGreptile SummaryThis PR optimizes E2E test execution time by replacing the slow
Confidence Score: 3/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Test as E2E Test
participant Helper as Auth.fastSignUp()
participant UserAPI as /api/v1/users
participant SessionAPI as /api/v1/auth/sessions
participant Context as backendContext
Note over Test,Context: Before (Auth.Otp.signIn)
Test->>Helper: Auth.Otp.signIn()
Helper->>UserAPI: Send OTP email
Helper->>Helper: Wait for email delivery
Helper->>Helper: Parse email for code
Helper->>SessionAPI: Sign in with code
SessionAPI-->>Helper: access_token, refresh_token
Helper->>Context: Set userAuth
Helper-->>Test: Return userId
Note over Test,Context: After (Auth.fastSignUp)
Test->>Helper: Auth.fastSignUp()
Helper->>UserAPI: POST /api/v1/users (server access)
UserAPI-->>Helper: userId
Helper->>SessionAPI: POST /api/v1/auth/sessions
SessionAPI-->>Helper: access_token, refresh_token
Helper->>Context: Set userAuth
Helper-->>Test: Return userId, tokens
|
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.
33 files reviewed, 1 comment
| it("completes successfully", async ({ expect }) => { | ||
| // note that we run this only in CI environments | ||
| it.runIf(!!process.env.CI)("completes successfully", async ({ expect }) => { | ||
| throw new Error("Not implemented"); |
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.
logic: This throw new Error("Not implemented") will cause the test to always fail when running in CI environments. The code below this line is unreachable. Either remove this line to enable the test, or remove the entire test body if the test isn't ready yet.
| throw new Error("Not implemented"); | |
| // throw new Error("Not implemented"); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/e2e/tests/general/setup-wizard.test.ts
Line: 8:8
Comment:
**logic:** This `throw new Error("Not implemented")` will cause the test to always fail when running in CI environments. The code below this line is unreachable. Either remove this line to enable the test, or remove the entire test body if the test isn't ready yet.
```suggestion
// throw new Error("Not implemented");
```
How can I resolve this? If you propose a fix, please make it concise.
Note
Switches E2E tests from OTP sign-in to fastSignUp for faster setup, updates backend helpers and expectations, adjusts test logic/snapshots, and limits setup wizard test to CI.
Auth.Otp.signIn()withAuth.fastSignUp()across backend tests (integrations, internal APIs, teams, users, payments, projects, data-vault, etc.).fastSignUpuser state (e.g., auth flags, emails, IDs, responses).apps/e2e/tests/backend/backend-helpers.ts):Auth.fastSignUp()(creates user + session) and related token validation utilities.User.createresponse assertions (checkstatusand returnedid).it.runIf(!!process.env.CI)); placeholder not implemented.Written by Cursor Bugbot for commit ff77394. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.