Skip to content

Code Review Bench PR #26774 - feat: CalendarCache - filter generic calendars from subscription batch#7

Closed
ketkarameya wants to merge 2 commits intobase_pr_26774_20260125_4728from
corrupted_pr_26774_20260125_4728
Closed

Code Review Bench PR #26774 - feat: CalendarCache - filter generic calendars from subscription batch#7
ketkarameya wants to merge 2 commits intobase_pr_26774_20260125_4728from
corrupted_pr_26774_20260125_4728

Conversation

@ketkarameya
Copy link

@ketkarameya ketkarameya commented Feb 10, 2026

Benchmark PR for Gitar evaluation

Original PR: agentic-review-benchmarks#7

feat: CalendarCache - filter generic calendars from subscription batch


Summary by Gitar

  • Architecture: Implements Factory + Service + Repository pattern with provider-aware filtering in AdapterFactory, CalendarSubscriptionService, and PrismaSelectedCalendarRepository
  • Filtering Logic: Excludes generic calendars (holidays, groups, imported, resources) using provider-specific suffix patterns (@group.v.calendar.google.com, @import.calendar.google.com, etc.) via Prisma query-level AND/NOT conditions
  • Extensibility: Centralized GENERIC_CALENDAR_SUFFIXES configuration supports multiple providers (Google Calendar, Office365) with optional parameters ensuring backward compatibility

devin-ai-integration bot and others added 2 commits January 25, 2026 12:02
Add filtering to SelectedCalendarRepository.findNextSubscriptionBatch to
exclude generic calendars (holidays, contacts, shared, imported, resources)
based on their externalId suffixes.

Changes:
- Add GENERIC_CALENDAR_SUFFIXES constant mapping providers to their
  generic calendar suffixes in AdaptersFactory
- Add getGenericCalendarSuffixes method to AdapterFactory interface
- Update findNextSubscriptionBatch to accept and use genericCalendarSuffixes
  parameter to filter out calendars with matching externalId suffixes
- Update CalendarSubscriptionService.checkForNewSubscriptions to pass
  generic calendar suffixes from the adapter factory
- Update tests to cover the new filtering logic

Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
import type { Prisma } from "@calcom/prisma/client";

export class SelectedCalendarRepository implements ISelectedCalendarRepository {
export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository {

Choose a reason for hiding this comment

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

🚨 Bug: Class rename breaks 3 consumers that import the old name

The class was renamed from SelectedCalendarRepository to PrismaSelectedCalendarRepository in SelectedCalendarRepository.ts, but three files still import and instantiate the old name SelectedCalendarRepository:

  1. apps/web/app/api/webhooks/calendar-subscription/[provider]/route.ts — line 14 imports it, line 61 instantiates it
  2. apps/web/app/api/cron/calendar-subscriptions/route.ts — line 11 imports it, line 41 instantiates it
  3. packages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts — line 2 imports it, lines 50 and 53 use it

There is no barrel file or re-export that aliases the old name. This will cause a build failure (import resolution error) for the webhook route, the cron route, and the repository's own test file.

Fix: Either revert the rename (if it wasn't intentional), or update all three consumer files to import PrismaSelectedCalendarRepository instead. A common pattern is to also add a re-export for backward compatibility:

export { PrismaSelectedCalendarRepository as SelectedCalendarRepository };

Was this helpful? React with 👍 / 👎

Suggested change
export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository {
export { PrismaSelectedCalendarRepository as SelectedCalendarRepository };
export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository {
  • Apply suggested fix

Copy link

@gitar-bot-staging gitar-bot-staging bot left a comment

Choose a reason for hiding this comment

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

⚠️ This PR is blocked due to unresolved code review findings.

Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.

@gitar-bot-staging
Copy link

gitar-bot-staging bot commented Feb 10, 2026

Code Review 🚫 Blocked 0 resolved / 1 findings

The filtering feature is well-designed but the class rename from SelectedCalendarRepository to PrismaSelectedCalendarRepository breaks 3 consumer files (2 route handlers and the test file) that still import the old name — this is a build-breaking change.

🚨 Bug: Class rename breaks 3 consumers that import the old name

📄 packages/features/selectedCalendar/repositories/SelectedCalendarRepository.ts:5

The class was renamed from SelectedCalendarRepository to PrismaSelectedCalendarRepository in SelectedCalendarRepository.ts, but three files still import and instantiate the old name SelectedCalendarRepository:

  1. apps/web/app/api/webhooks/calendar-subscription/[provider]/route.ts — line 14 imports it, line 61 instantiates it
  2. apps/web/app/api/cron/calendar-subscriptions/route.ts — line 11 imports it, line 41 instantiates it
  3. packages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts — line 2 imports it, lines 50 and 53 use it

There is no barrel file or re-export that aliases the old name. This will cause a build failure (import resolution error) for the webhook route, the cron route, and the repository's own test file.

Fix: Either revert the rename (if it wasn't intentional), or update all three consumer files to import PrismaSelectedCalendarRepository instead. A common pattern is to also add a re-export for backward compatibility:

export { PrismaSelectedCalendarRepository as SelectedCalendarRepository };
Suggested fix
export { PrismaSelectedCalendarRepository as SelectedCalendarRepository };

export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository {
Rules 🎸 1 action taken

Gitar Rules

🎸 Summary Enhancement: Appended 'Summary by Gitar' section with 3 technical bullets covering architecture (Factory + Service + Repository pattern), filtering logic (provider-specific suffix patterns with Prisma AND/NOT conditions), and extensibility (centralized configuration with backward compatibility)

5 rules not applicable. Show all rules by commenting gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@kayagokalp
Copy link

Benchmark Evaluation Results

Ground Truth Bugs (Recall: 1/2 = 50.0%)

ID Severity Title Found?
GT-7-001 Important Interface-implementation mismatch: integrations parameter op No
GT-7-002 Critical Class renamed from SelectedCalendarRepository to PrismaSelec Yes

Extra Gitar Findings

File Line Valid Bug? Notes
(none) - - -

Summary

  • Recall: 50.0% (1/2)
  • Precision: 100.0% (1/1)
  • Precision counts ground truth matches + valid extra findings as true positives

@kayagokalp kayagokalp closed this Feb 25, 2026
@kayagokalp kayagokalp deleted the corrupted_pr_26774_20260125_4728 branch February 25, 2026 02:05
@kayagokalp kayagokalp restored the corrupted_pr_26774_20260125_4728 branch February 25, 2026 02:17
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