Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Aug 10, 2025

Summary by CodeRabbit

  • Refactor

    • Removed the legacy partners-enabled gating across the app so partner features and options are shown and usable without that flag.
    • Simplified UI flows and CTAs to rely on plan/capability checks instead of the removed flag.
    • Removed the partnersEnabled field from schemas and data models.
  • Chores

    • Deleted an obsolete invoice-backfill script and removed related unused imports/conditional guards.
    • Minor test/resource ID updated.

@vercel
Copy link
Contributor

vercel bot commented Aug 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Updated (UTC)
dub Ready Preview Aug 12, 2025 3:23pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 10, 2025

Walkthrough

This change removes the partnersEnabled flag and all related conditional logic, validations, imports, and UI gating across the codebase, updates the workspace schema and Prisma model to drop the field, deletes a backfill script tied to that flag, and updates one test constant value.

Changes

Cohort / File(s) Change Summary
API & Routes
apps/web/app/(ee)/api/programs/rewardful/campaigns/route.ts, apps/web/app/api/slack/callback/route.ts, apps/web/app/api/webhooks/[webhookId]/route.ts, apps/web/app/api/webhooks/route.ts
Removed type/field references and runtime checks that enforced or validated partnersEnabled in request handlers and route logic; removed unused imports tied to those checks.
UI Components & Layout
apps/web/app/(ee)/app.dub.co/(new-program)/sidebar-context.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/notifications/page-client.tsx, apps/web/ui/layout/sidebar/dub-partners-popup.tsx, apps/web/ui/webhooks/add-edit-webhook-form.tsx
Removed destructuring of partnersEnabled, removed conditional UI branches and filters that depended on partnersEnabled, removed related imports and UI elements (e.g., badge), and simplified logic to include partner-related items unconditionally.
Actions & Integrations
apps/web/lib/actions/partners/onboard-program.ts, apps/web/lib/actions/partners/set-partnerstack-token.ts, apps/web/lib/actions/partners/set-rewardful-token.ts, apps/web/lib/actions/partners/set-tolt-token.ts, apps/web/lib/webhook/create-webhook.ts
Removed guards that prevented operations when partnersEnabled was false; deleted partner-trigger filtering and related early-return validations; updated function/workspace parameter types where applicable.
Schema & DB
apps/web/lib/zod/schemas/workspaces.ts, packages/prisma/schema/workspace.prisma
Removed partnersEnabled property from Zod workspace schema and removed partnersEnabled Boolean field from Prisma Project model.
Scripts & Test Data
apps/web/scripts/backfill-invoice-numbers.ts, apps/web/tests/utils/resource.ts
Deleted backfill script that targeted workspaces with partnersEnabled; updated exported test constant E2E_DISCOUNT.id value in test resources.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant Server
    participant DB

    User->>UI: Trigger action (create webhook / set token / view UI)
    UI->>Server: Send request (no partnersEnabled check)
    Server->>DB: Query / update (no partnersEnabled filter)
    DB-->>Server: Return result
    Server-->>UI: Respond
    UI-->>User: Render result (partner-related items no longer gated)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • devkiran
  • TWilson023

Poem

🐇 I hopped through flags and tiny guards,
Removed the gates, unbolted yards.
No more checks to slow the run,
Simpler paths beneath the sun.
The code hops light — new day begun!

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch partners-ga

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🔭 Outside diff range comments (2)
apps/web/lib/webhook/create-webhook.ts (1)

72-102: Fix: handle optional linkIds and clean up Promise aggregation

findMany uses id: { in: linkIds } without guarding; when linkIds is undefined, Prisma will error. Also, Promise.all([... , []]) mixes an array value into promises list.

Suggested diff:

-  waitUntil(
-    (async () => {
-      const links = await prisma.link.findMany({
-        where: {
-          id: { in: linkIds },
-          projectId: workspace.id,
-        },
-        include: {
-          webhooks: {
-            select: {
-              webhookId: true,
-            },
-          },
-        },
-      });
-
-      const formatedLinks = links.map((link) => {
-        return {
-          ...link,
-          webhookIds: link.webhooks.map((webhook) => webhook.webhookId),
-        };
-      });
-
-      Promise.all([
-        ...(links && links.length > 0
-          ? [linkCache.mset(formatedLinks), []]
-          : []),
-
-        ...(isLinkLevelWebhook(webhook) ? [webhookCache.set(webhook)] : []),
-      ]);
-    })(),
-  );
+  waitUntil(
+    (async () => {
+      const tasks: Promise<unknown>[] = [];
+
+      if (linkIds && linkIds.length > 0) {
+        const links = await prisma.link.findMany({
+          where: {
+            id: { in: linkIds },
+            projectId: workspace.id,
+          },
+          include: {
+            webhooks: {
+              select: { webhookId: true },
+            },
+          },
+        });
+
+        const formattedLinks = links.map((link) => ({
+          ...link,
+          webhookIds: link.webhooks.map((w) => w.webhookId),
+        }));
+
+        if (links.length > 0) {
+          tasks.push(linkCache.mset(formattedLinks));
+        }
+      }
+
+      if (isLinkLevelWebhook(webhook)) {
+        tasks.push(webhookCache.set(webhook));
+      }
+
+      if (tasks.length > 0) {
+        await Promise.all(tasks);
+      }
+    })(),
+  );
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx (1)

30-41: Harden managePaymentMethods: handle errors, set headers, and reset loading state

Currently, failures (non-2xx or network errors) can leave isLoading stuck true and may throw on missing url. Recommend try/catch/finally, response.ok check, and Content-Type header.

Apply this diff:

-  const managePaymentMethods = async () => {
-    setIsLoading(true);
-    const { url } = await fetch(
-      `/api/workspaces/${slug}/billing/payment-methods`,
-      {
-        method: "POST",
-        body: JSON.stringify({}),
-      },
-    ).then((res) => res.json());
-
-    router.push(url);
-  };
+  const managePaymentMethods = async () => {
+    setIsLoading(true);
+    try {
+      const res = await fetch(`/api/workspaces/${slug}/billing/payment-methods`, {
+        method: "POST",
+        headers: { "Content-Type": "application/json" },
+        body: JSON.stringify({}),
+      });
+      const json = await res.json().catch(() => ({}));
+      if (!res.ok || !json?.url) {
+        // Optionally surface a toast here for better UX
+        console.error("Failed to open billing portal:", json);
+        return;
+      }
+      router.push(json.url);
+    } finally {
+      setIsLoading(false);
+    }
+  };
🧹 Nitpick comments (1)
apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/notifications/page-client.tsx (1)

19-46: LGTM: partner notifications are now always available

Static list reflects removal of partner gating. Optional: hoist notifications to a module-level constant to avoid re-allocation per render.

Example:

-export default function NotificationsSettingsPageClient() {
-  const { id: workspaceId } = useWorkspace();
-  const { executeAsync } = useAction(updateNotificationPreference);
-
-  const notifications = [
+const NOTIFICATIONS = [
     // ...
   ];
+
+export default function NotificationsSettingsPageClient() {
+  const { id: workspaceId } = useWorkspace();
+  const { executeAsync } = useAction(updateNotificationPreference);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5aa8f1 and 3666972.

📒 Files selected for processing (20)
  • apps/web/app/(ee)/api/programs/rewardful/campaigns/route.ts (0 hunks)
  • apps/web/app/(ee)/app.dub.co/(new-program)/sidebar-context.tsx (0 hunks)
  • apps/web/app/api/slack/callback/route.ts (1 hunks)
  • apps/web/app/api/webhooks/[webhookId]/route.ts (0 hunks)
  • apps/web/app/api/webhooks/route.ts (0 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx (1 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx (1 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/notifications/page-client.tsx (1 hunks)
  • apps/web/lib/actions/partners/onboard-program.ts (0 hunks)
  • apps/web/lib/actions/partners/set-partnerstack-token.ts (0 hunks)
  • apps/web/lib/actions/partners/set-rewardful-token.ts (0 hunks)
  • apps/web/lib/actions/partners/set-tolt-token.ts (0 hunks)
  • apps/web/lib/webhook/create-webhook.ts (2 hunks)
  • apps/web/lib/zod/schemas/workspaces.ts (0 hunks)
  • apps/web/scripts/backfill-invoice-numbers.ts (0 hunks)
  • apps/web/ui/layout/sidebar/dub-partners-popup.tsx (0 hunks)
  • apps/web/ui/webhooks/add-edit-webhook-form.tsx (2 hunks)
  • packages/prisma/schema/workspace.prisma (0 hunks)
💤 Files with no reviewable changes (12)
  • packages/prisma/schema/workspace.prisma
  • apps/web/lib/zod/schemas/workspaces.ts
  • apps/web/ui/layout/sidebar/dub-partners-popup.tsx
  • apps/web/lib/actions/partners/set-tolt-token.ts
  • apps/web/lib/actions/partners/onboard-program.ts
  • apps/web/app/api/webhooks/route.ts
  • apps/web/lib/actions/partners/set-rewardful-token.ts
  • apps/web/app/(ee)/app.dub.co/(new-program)/sidebar-context.tsx
  • apps/web/lib/actions/partners/set-partnerstack-token.ts
  • apps/web/app/api/webhooks/[webhookId]/route.ts
  • apps/web/app/(ee)/api/programs/rewardful/campaigns/route.ts
  • apps/web/scripts/backfill-invoice-numbers.ts
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: TWilson023
PR: dubinc/dub#2673
File: apps/web/ui/partners/rewards/rewards-logic.tsx:268-275
Timestamp: 2025-07-30T15:29:54.131Z
Learning: In apps/web/ui/partners/rewards/rewards-logic.tsx, when setting the entity field in a reward condition, dependent fields (attribute, operator, value) should be reset rather than preserved because different entities (customer vs sale) have different available attributes. Maintaining existing fields when the entity changes would create invalid state combinations and confusing UX.
📚 Learning: 2025-07-30T15:29:54.131Z
Learnt from: TWilson023
PR: dubinc/dub#2673
File: apps/web/ui/partners/rewards/rewards-logic.tsx:268-275
Timestamp: 2025-07-30T15:29:54.131Z
Learning: In apps/web/ui/partners/rewards/rewards-logic.tsx, when setting the entity field in a reward condition, dependent fields (attribute, operator, value) should be reset rather than preserved because different entities (customer vs sale) have different available attributes. Maintaining existing fields when the entity changes would create invalid state combinations and confusing UX.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/notifications/page-client.tsx
  • apps/web/ui/webhooks/add-edit-webhook-form.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx
📚 Learning: 2025-05-29T04:45:18.504Z
Learnt from: devkiran
PR: dubinc/dub#2448
File: packages/email/src/templates/partner-program-summary.tsx:0-0
Timestamp: 2025-05-29T04:45:18.504Z
Learning: In the PartnerProgramSummary email template (packages/email/src/templates/partner-program-summary.tsx), the stat titles are hardcoded constants ("Clicks", "Leads", "Sales", "Earnings") that will always match the ICONS object keys after toLowerCase() conversion, so icon lookup failures are not possible.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/notifications/page-client.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx
📚 Learning: 2025-06-18T20:26:25.177Z
Learnt from: TWilson023
PR: dubinc/dub#2538
File: apps/web/ui/partners/overview/blocks/commissions-block.tsx:16-27
Timestamp: 2025-06-18T20:26:25.177Z
Learning: In the Dub codebase, components that use workspace data (workspaceId, defaultProgramId) are wrapped in `WorkspaceAuth` which ensures these values are always available, making non-null assertions safe. This is acknowledged as a common pattern in their codebase, though not ideal.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx
  • apps/web/ui/webhooks/add-edit-webhook-form.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx
📚 Learning: 2025-05-29T09:49:19.604Z
Learnt from: devkiran
PR: dubinc/dub#2433
File: apps/web/ui/modals/add-payment-method-modal.tsx:60-62
Timestamp: 2025-05-29T09:49:19.604Z
Learning: The `/api/workspaces/${slug}/billing/payment-methods` POST endpoint in the billing API returns either an error (handled by response.ok check) or a response object containing a `url` property for successful requests.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx
📚 Learning: 2025-07-30T15:25:13.936Z
Learnt from: TWilson023
PR: dubinc/dub#2673
File: apps/web/ui/partners/rewards/add-edit-reward-sheet.tsx:56-66
Timestamp: 2025-07-30T15:25:13.936Z
Learning: In apps/web/ui/partners/rewards/add-edit-reward-sheet.tsx, the form schema uses partial condition objects to allow users to add empty/unconfigured condition fields without type errors, while submission validation uses strict schemas to ensure data integrity. This two-stage validation pattern improves UX by allowing progressive completion of complex forms.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx
  • apps/web/ui/webhooks/add-edit-webhook-form.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx
📚 Learning: 2025-06-16T19:21:23.506Z
Learnt from: TWilson023
PR: dubinc/dub#2519
File: apps/web/ui/analytics/utils.ts:35-37
Timestamp: 2025-06-16T19:21:23.506Z
Learning: In the `useAnalyticsFilterOption` function in `apps/web/ui/analytics/utils.ts`, the pattern `options?.context ?? useContext(AnalyticsContext)` is intentionally designed as a complete replacement strategy, not a merge. When `options.context` is provided, it should contain all required fields (`baseApiPath`, `queryString`, `selectedTab`, `requiresUpgrade`) and completely replace the React context, not be merged with it. This is used for dependency injection or testing scenarios.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/notifications/page-client.tsx
📚 Learning: 2025-06-06T07:59:03.120Z
Learnt from: devkiran
PR: dubinc/dub#2177
File: apps/web/lib/api/links/bulk-create-links.ts:66-84
Timestamp: 2025-06-06T07:59:03.120Z
Learning: In apps/web/lib/api/links/bulk-create-links.ts, the team accepts the risk of potential undefined results from links.find() operations when building invalidLinks arrays, because existing links are fetched from the database based on the input links, so matches are expected to always exist.

Applied to files:

  • apps/web/lib/webhook/create-webhook.ts
📚 Learning: 2025-07-09T20:52:56.592Z
Learnt from: TWilson023
PR: dubinc/dub#2614
File: apps/web/ui/partners/design/previews/lander-preview.tsx:181-181
Timestamp: 2025-07-09T20:52:56.592Z
Learning: In apps/web/ui/partners/design/previews/lander-preview.tsx, the ellipsis wave animation delay calculation `3 - i * -0.15` is intentionally designed to create negative delays that offset each dot's animation cycle. This pattern works correctly for the intended ellipsis effect and should not be changed to positive incremental delays.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx
📚 Learning: 2025-06-25T18:08:53.931Z
Learnt from: TWilson023
PR: dubinc/dub#2484
File: apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/usage/get-recommended-plan.ts:11-12
Timestamp: 2025-06-25T18:08:53.931Z
Learning: In the Dub codebase, prefer keeping semantically different functions separate even if they currently have identical implementations. This maintains readability and allows for easy future divergence when business logic changes. For example, `hasConversions` and `hasPartners` functions should remain separate despite having the same current logic, as they serve different conceptual purposes and may need different feature checks in the future.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx
📚 Learning: 2025-07-17T06:41:45.620Z
Learnt from: devkiran
PR: dubinc/dub#2637
File: apps/web/app/(ee)/api/singular/webhook/route.ts:0-0
Timestamp: 2025-07-17T06:41:45.620Z
Learning: In the Singular integration (apps/web/app/(ee)/api/singular/webhook/route.ts), the event names in the singularToDubEvent object have intentionally different casing: "Copy GAID" and "copy IDFA". This casing difference is valid and should not be changed, as these are the correct event names expected from Singular.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (12)
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx (1)

202-226: LGTM: correct removal of partnersEnabled gating

Condition now depends only on defaultProgramId, matching the flag removal. usePartnersCount is already guarded by defaultProgramId and the UI gracefully handles loading via UsageCategory.

apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx (1)

31-31: LGTM: simplified auth gating aligns with flag removal

Showing the upgrade CTA when plan lacks capability or there’s no defaultProgramId is consistent and removes obsolete flag checks.

apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/notifications/page-client.tsx (2)

16-16: LGTM: narrowed workspace destructure

Only id is used here; dropping other fields is correct.


19-46: Partner notification types already included in schema

Confirmed that notificationTypes in apps/web/lib/zod/schemas/workspaces.ts (lines 152–156) lists both "newPartnerSale" and "newPartnerApplication". No further changes required.

apps/web/lib/webhook/create-webhook.ts (2)

4-4: LGTM: removed partner-specific import

PARTNERS_WEBHOOK_TRIGGERS removal is consistent with deleting the flag and associated gating.


23-23: LGTM: workspace type now excludes partnersEnabled

Matches schema/type removals. Structural typing still allows callers to pass extra fields (e.g., slug).

apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx (2)

20-20: Removal of partnersEnabled from workspace destructure — LGTM

Matches PR objective; no downstream usage in this component.


93-108: Partner payment methods unguarded by feature flag — LGTM

Rendering now depends solely on partnerPaymentMethods presence/length. This aligns with removing the flag.

apps/web/ui/webhooks/add-edit-webhook-form.tsx (2)

36-36: Removal of partnersEnabled from workspace destructure — LGTM

Consistent with feature flag deletion.


194-217: Show all workspace-level triggers without partner filtering — LGTM

Directly mapping WORKSPACE_LEVEL_WEBHOOK_TRIGGERS is correct after removing partner gating.

apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx (2)

5-5: Import change to buttonVariants — LGTM

No issues.


17-17: Removal of partnersEnabled from workspace destructure — LGTM

Matches PR objective and simplifies state.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/web/tests/utils/resource.ts (1)

69-69: Make the discount ID configurable to avoid future brittle updates

Hard-coding a changing external ID causes recurring churn. Consider making it configurable via env with a safe fallback.

Apply this diff:

-  id: "disc_1K2E253814K7TA6YRKA86XMX5",
+  id: process.env.E2E_DISCOUNT_ID ?? "disc_1K2E253814K7TA6YRKA86XMX5",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3666972 and a8aa1e3.

📒 Files selected for processing (1)
  • apps/web/tests/utils/resource.ts (1 hunks)
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (1)
apps/web/tests/utils/resource.ts (1)

69-77: All discount references updated—please confirm E2E seeding

Everything in the codebase has been updated to use the new ID and there are no leftover references to the old one. Before merging, please ensure that your E2E environment is seeded with a discount record matching the new ID (disc_1K2E253814K7TA6YRKA86XMX5), or update your seed/fixture scripts accordingly.

Key findings:

  • No occurrences of the old ID (disc_1JY5V6W88X71C7T5DMXPNWTCD) remain.
  • The new ID appears only in apps/web/tests/utils/resource.ts (exported as E2E_DISCOUNT) and is imported across your discount tests.
  • No other tests or fixtures contain hardcoded discount IDs.
  • No seed/fixture files include either the old or new ID—verify that your test setup creates this discount before running E2E tests.

@steven-tey steven-tey merged commit 3193ab2 into main Aug 12, 2025
8 checks passed
@steven-tey steven-tey deleted the partners-ga branch August 12, 2025 15:34
@steven-tey steven-tey restored the partners-ga branch August 12, 2025 19:27
@steven-tey steven-tey deleted the partners-ga branch August 12, 2025 19:27
@coderabbitai coderabbitai bot mentioned this pull request Aug 25, 2025
This was referenced Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants