Skip to content

Implement CI/CD foundation and optimize components for Vercel#193

Merged
hassanidris merged 13 commits into
mainfrom
dev
Jul 14, 2026
Merged

Implement CI/CD foundation and optimize components for Vercel#193
hassanidris merged 13 commits into
mainfrom
dev

Conversation

@hassanidris

@hassanidris hassanidris commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added automated monitoring for application errors, performance, and usage analytics.
    • Added end-to-end coverage for key pages, including Home, About, Events, and Become a DJ.
    • Improved image delivery for event posters, media thumbnails, and other visual content.
  • Bug Fixes

    • Improved booking modal initialization and venue city loading.
    • Enhanced navigation behavior for sign-in and organizer actions.
  • Tests

    • Added unit testing and continuous validation for linting, type checks, and test suites.

hassanidris and others added 11 commits July 13, 2026 23:24
…ze images

- Replace <a> tags with <Link> in global-error.tsx and BookingPackages.tsx
- Add key props to VenueModal and PackageModal to force remount on open/close
- Replace <img> with Next.js Image component in DjAnalyticsDashboard
- Fix HTML entity encoding for apostrophes and quotes (use &apos; and &quot;)
- Optimize PackageModal and VenueModal state initialization with lazy initial state
- Remove unnecessary useEffect in Pack
Implement CI/CD foundation and optimize components for Vercel
feat: Phase 5 CI/CD monitoring with Sentry
- Replace <img> tag with Next.js Image component for event poster
- Add fill prop and responsive sizes attribute for optimized loading
- Remove eslint disable comment for @next/next/no-img-element
refactor: replace img with Next.js Image component in EventCard
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
djscovery Ready Ready Preview, Comment Jul 14, 2026 1:23am

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@hassanidris, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 259ab32e-2e4c-48d5-90f2-fde7c9552054

📥 Commits

Reviewing files that changed from the base of the PR and between 842ef6b and 18c5002.

📒 Files selected for processing (5)
  • __tests__/setup.ts
  • e2e/about.spec.ts
  • e2e/become-dj.spec.ts
  • sentry.client.config.ts
  • src/instrumentation.ts
📝 Walkthrough

Walkthrough

The PR adds CI validation and Playwright coverage, configures Vitest, integrates Sentry and Vercel monitoring, updates selected navigation and image rendering, and revises profile modal state initialization and city preloading.

Changes

Platform and UI updates

Layer / File(s) Summary
CI and test foundation
.github/workflows/ci.yml, package.json, playwright.config.ts, vitest.config.ts, __tests__/*, e2e/*, .gitignore
Adds lint, type-check, unit-test, and Playwright commands; configures Vitest and Playwright; adds unit and page-load tests; and runs validation through GitHub Actions.
Sentry and Vercel integration
next.config.mjs, package.json, sentry.*.config.ts, src/proxy.ts, src/app/layout.tsx, .gitignore
Configures Sentry across Next.js runtimes, wraps the Next.js config, permits Sentry connections, and renders Vercel Analytics and Speed Insights.
UI navigation and image rendering
src/app/global-error.tsx, src/components/dj-profile/BookingPackages.tsx, src/components/dj/DjAnalyticsDashboard.tsx, src/components/events/EventCard.tsx, src/components/dj-profile/WhereIvePlayed.tsx
Replaces selected anchors with Link, replaces poster and thumbnail images with Image, and escapes an apostrophe in a heading.
Profile modal state initialization
src/components/dj-profile/DjProfilePremium.tsx, PackageModal.tsx, VenueModal.tsx
Initializes modal collections through state initializers, remounts modals on open-state changes, and limits country city preloading to once per country.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main changes: CI/test automation plus Vercel/Sentry-related app updates and component optimizations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (4)
src/components/dj-profile/VenueModal.tsx (1)

64-74: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Handle potential promise rejections in the async effect.

The getCitiesByCountry server action is called without a .catch() block. If the network drops or the server action throws an error, it will result in an unhandled promise rejection. Consider adding an error handler to fail gracefully.

♻️ Proposed fix
   useEffect(() => {
     // Pre-load cities for venues that already have a country selected
     initialVenues.forEach((venue) => {
       if (venue.countryId && !loadedCountryIds.current.has(venue.countryId)) {
         loadedCountryIds.current.add(venue.countryId);
-        getCitiesByCountry(venue.countryId).then((result) => {
-          setVenueCities((prev) => ({ ...prev, [venue.countryId]: result }));
-        });
+        getCitiesByCountry(venue.countryId)
+          .then((result) => {
+            setVenueCities((prev) => ({ ...prev, [venue.countryId]: result }));
+          })
+          .catch((error) => {
+            console.error("Failed to load cities for country", venue.countryId, error);
+          });
       }
     });
   }, [initialVenues]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/dj-profile/VenueModal.tsx` around lines 64 - 74, Update the
preloading logic in the useEffect for initialVenues to handle rejected
getCitiesByCountry promises with a catch handler, failing gracefully without
unhandled rejections while preserving the existing successful result update.
package.json (1)

7-17: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider removing redundant validation in the build script.

next build automatically performs type-checking and linting by default. Adding npm run validate (which runs tsc --noEmit and eslint .) before next build will run these checks twice, unnecessarily increasing your build times.

Unless you have disabled these checks in next.config.js (e.g., ignoreDuringBuilds), consider reverting the build script to avoid the redundant work.

♻️ Proposed refactor
-    "build": "npm run validate && prisma generate && next build",
+    "build": "prisma generate && next build",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 7 - 17, Update the package.json build script to
remove the leading npm run validate step and invoke prisma generate followed by
next build directly. Keep the separate validate script unchanged, and retain the
existing build command order for Prisma generation and Next.js.
.github/workflows/ci.yml (2)

9-9: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Enforce least-privilege permissions for the workflow.

By default, GitHub Actions workflows have broad permissions. To follow security best practices, explicitly set the default permissions to read at the top level or job level.

🛡️ Proposed fix to restrict permissions
 on:
   push:
     branches: ["main", "dev", "feature/**"]
   pull_request:
     branches: ["main", "dev"]
+
+permissions:
+  contents: read

 jobs:
   test:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 9, Update the workflow permissions
configuration around the top-level jobs definition to explicitly set the default
GitHub Actions token permissions to read-only, using the workflow-level or
applicable job-level permissions setting while preserving existing job behavior.

Source: Linters/SAST tools


15-16: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Disable credential persistence in checkout action.

The actions/checkout action persists the GitHub auth token in the local git config by default. Since this workflow only runs tests and does not push code, set persist-credentials: false across all checkout steps to prevent potential token leakage in the CI environment.

  • .github/workflows/ci.yml#L15-L16: add with: persist-credentials: false to the checkout step in the test job.
  • .github/workflows/ci.yml#L42-L43: add with: persist-credentials: false to the checkout step in the e2e job.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 15 - 16, Disable credential
persistence for both actions/checkout steps in .github/workflows/ci.yml at lines
15-16 (test job) and 42-43 (e2e job) by adding the persist-credentials: false
option under each checkout step.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@__tests__/setup.ts`:
- Line 1: Update the setup import in __tests__/setup.ts to use the
Vitest-specific `@testing-library/jest-dom/vitest` entrypoint instead of the
generic `@testing-library/jest-dom` import.

In `@e2e/about.spec.ts`:
- Around line 5-6: Strengthen the smoke tests by capturing the response from
page.goto and asserting it is successful, then replace the generic body
visibility checks with route-specific heading assertions: use “About DJcovery”
in e2e/about.spec.ts and “Set Up Your DJ Profile” in e2e/become-dj.spec.ts.

In `@sentry.client.config.ts`:
- Around line 15-18: Remove the console.log call from the beforeSend hook in the
Sentry configuration, or remove the hook entirely if it serves no other purpose;
preserve returning the event and avoid emitting raw Sentry event data in
production.

In `@sentry.server.config.ts`:
- Around line 1-7: Add an instrumentation.ts module with a register() function
that imports both Sentry configuration modules, ensuring server and Edge
runtimes initialize Sentry. Update sentry.server.config.ts lines 1-7 and
sentry.edge.config.ts lines 1-7 only as needed for these imports, with no direct
behavioral changes to their Sentry.init configuration.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 9: Update the workflow permissions configuration around the top-level
jobs definition to explicitly set the default GitHub Actions token permissions
to read-only, using the workflow-level or applicable job-level permissions
setting while preserving existing job behavior.
- Around line 15-16: Disable credential persistence for both actions/checkout
steps in .github/workflows/ci.yml at lines 15-16 (test job) and 42-43 (e2e job)
by adding the persist-credentials: false option under each checkout step.

In `@package.json`:
- Around line 7-17: Update the package.json build script to remove the leading
npm run validate step and invoke prisma generate followed by next build
directly. Keep the separate validate script unchanged, and retain the existing
build command order for Prisma generation and Next.js.

In `@src/components/dj-profile/VenueModal.tsx`:
- Around line 64-74: Update the preloading logic in the useEffect for
initialVenues to handle rejected getCitiesByCountry promises with a catch
handler, failing gracefully without unhandled rejections while preserving the
existing successful result update.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b339823-0cdf-4656-ad17-193110252289

📥 Commits

Reviewing files that changed from the base of the PR and between f8ffd05 and 842ef6b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (29)
  • .github/workflows/ci.yml
  • .gitignore
  • __tests__/integration/api/.gitkeep
  • __tests__/setup.ts
  • __tests__/unit/actions/.gitkeep
  • __tests__/unit/components/.gitkeep
  • __tests__/unit/lib/.gitkeep
  • __tests__/unit/lib/utils.test.ts
  • e2e/about.spec.ts
  • e2e/become-dj.spec.ts
  • e2e/events.spec.ts
  • e2e/home.spec.ts
  • next.config.mjs
  • package.json
  • playwright.config.ts
  • sentry.client.config.ts
  • sentry.edge.config.ts
  • sentry.server.config.ts
  • src/app/global-error.tsx
  • src/app/layout.tsx
  • src/components/dj-profile/BookingPackages.tsx
  • src/components/dj-profile/DjProfilePremium.tsx
  • src/components/dj-profile/PackageModal.tsx
  • src/components/dj-profile/VenueModal.tsx
  • src/components/dj-profile/WhereIvePlayed.tsx
  • src/components/dj/DjAnalyticsDashboard.tsx
  • src/components/events/EventCard.tsx
  • src/proxy.ts
  • vitest.config.ts

Comment thread __tests__/setup.ts Outdated
Comment thread e2e/about.spec.ts Outdated
Comment thread sentry.client.config.ts Outdated
Comment thread sentry.server.config.ts
- Update jest-dom import path to vitest-specific version in test setup
- Replace generic body visibility checks with specific heading assertions
- Add HTTP status code verification in about page test
- Verify sign-in redirect behavior in become-dj page test
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.

1 participant