Skip to content

[CLEAN] Synthetic Benchmark PR #26449 - feat(api): add team event-types webhooks controller#375

Open
tomerqodo wants to merge 1 commit intobase_pr_26449_20260114_1506from
clean_pr_26449_20260114_1506
Open

[CLEAN] Synthetic Benchmark PR #26449 - feat(api): add team event-types webhooks controller#375
tomerqodo wants to merge 1 commit intobase_pr_26449_20260114_1506from
clean_pr_26449_20260114_1506

Conversation

@tomerqodo
Copy link

Benchmark PR calcom#26449

Type: Clean (correct implementation)

Original PR Title: feat(api): add team event-types webhooks controller
Original PR Description: ## What does this PR do?

Adds a new API v2 controller for managing webhooks on team event types, following the existing pattern from event-types-webhooks.controller.ts.

New endpoints at /v2/teams/:teamId/event-types/:eventTypeId/webhooks:

  • POST / - Create a webhook for a team event type
  • PATCH /:webhookId - Update a webhook
  • GET /:webhookId - Get a specific webhook
  • GET / - List all webhooks (paginated)
  • DELETE /:webhookId - Delete a specific webhook
  • DELETE / - Delete all webhooks for the event type

New files:

  • TeamsEventTypesWebhooksController - Main controller with CRUD endpoints
  • IsTeamEventTypeWebhookGuard - Authorization guard validating team admin/owner membership and event type ownership
  • TeamEventTypeWebhooksService - Business logic layer for webhook operations
  • teams-event-types-webhooks.controller.e2e-spec.ts - E2E tests covering all endpoints

Configuration change:

  • Added unsafeParameterDecoratorsEnabled: true to biome.json to support NestJS parameter decorators

Updates since last revision

  • Updated IsTeamEventTypeWebhookGuard to only allow team admins or owners to manage webhooks (not regular team members). The guard now uses getUserAdminOrOwnerTeamMembership instead of findMembershipByTeamId.
  • Fixed import type statements in controller, service, and guard files per cubic-dev-ai feedback. Changed to regular imports for services, repositories, and DTOs that require runtime availability for NestJS dependency injection and class-validator/class-transformer.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - API endpoints are auto-documented via OpenAPI decorators.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create a team with an event type
  2. Use API v2 with a team admin's API key
  3. Test CRUD operations on /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks
  4. Verify non-admin team members cannot access the endpoints (should get 403)
  5. Verify non-team-members cannot access the endpoints
  6. Verify webhooks are correctly associated with the team event type

E2E tests can be run with:

TZ=UTC yarn test:e2e --testPathPattern="teams-event-types-webhooks.controller.e2e-spec.ts"

Human Review Checklist

  • Verify the guard correctly restricts access to team admins/owners only (uses getUserAdminOrOwnerTeamMembership)
  • Verify the guard correctly validates event type belongs to the team before allowing access
  • Review the biome.json global configuration change for NestJS decorator support
  • Verify E2E tests adequately cover authorization edge cases (non-team-member access, webhook not belonging to event type, etc.)

Link to Devin run: https://app.devin.ai/sessions/3afb0c9b900f43f8a86ace48c190c5a0
Requested by: morgan@cal.com (@ThyMinimalDev)
Original PR URL: calcom#26449

@github-actions
Copy link

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "[CLEAN] Synthetic Benchmark PR #26449 - feat(api): add team event-types webhooks controller". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions
Copy link

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions bot added the Stale label Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant