Skip to content

feat: Multiple Round Robin Host Selection #20796

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

romitg2
Copy link
Contributor

@romitg2 romitg2 commented Apr 21, 2025

What does this PR do?

This PR Implements a feature where we can have more than 1 hosts selected in round robin manner for an booking.
eg. when someone books an event and we want 2 team members to get assigned to this booking in round robin manner then we can have do that now.

Feature Walkthrough:

https://www.loom.com/share/67200414fd6c4a50a09cd66bc57f1a1b?sid=fb9ad177-a984-431a-8d40-3a3e34f45899

Code Changes:

https://www.loom.com/share/6bda787c70ba41b9a4036c0e25a6ed06?sid=362a9814-5834-4f80-b131-10611aa29f73

  • i've added e2e tests.
    (other than that i've self-tested and it's working fine in edge cases.)

how to test this?

  • check feature walkthrough video.

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. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Summary by mrge

Added support for assigning multiple hosts in round robin events, allowing more than one team member to be selected per booking.

  • New Features
    • Users can set the number of hosts to assign in round robin events.
    • UI updated to configure multiple hosts and show relevant errors if not enough hosts are available.
    • Backend and database updated to store and enforce the host count.
    • Added end-to-end tests for multiple host assignment.

@romitg2 romitg2 requested review from a team as code owners April 21, 2025 13:43
Copy link

vercel bot commented Apr 21, 2025

@romitg2 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Apr 21, 2025
@graphite-app graphite-app bot requested a review from a team April 21, 2025 13:44
@github-actions github-actions bot added $500 Low priority Created by Linear-GitHub Sync Stale ✨ feature New feature or request 💎 Bounty A bounty on Algora.io and removed ✨ feature New feature or request Low priority Created by Linear-GitHub Sync 💎 Bounty A bounty on Algora.io Stale $500 labels Apr 21, 2025
@github-actions github-actions bot added the ❗️ migrations contains migration files label Apr 21, 2025
@dosubot dosubot bot added automated-tests area: unit tests, e2e tests, playwright teams area: teams, round robin, collective, managed event-types ✨ feature New feature or request labels Apr 21, 2025
Copy link

graphite-app bot commented Apr 21, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (04/21/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (04/21/25)

1 label was added to this PR based on Keith Williams's automation.

Copy link

@mrge-io mrge-io bot left a comment

Choose a reason for hiding this comment

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

mrge found 8 issues across 17 files. View them in mrge.io


*/
-- AlterTable
ALTER TABLE "EventType" ALTER COLUMN "roundRobinHostsCount" SET NOT NULL;
Copy link

Choose a reason for hiding this comment

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

Migration will fail if any NULL values exist in the roundRobinHostsCount column despite the initial default value.

@@ -148,6 +148,7 @@ export type FormValues = {
forwardParamsSuccessRedirect: boolean | null;
secondaryEmailId?: number;
isRRWeightsEnabled: boolean;
roundRobinHostsCount: number;
Copy link

Choose a reason for hiding this comment

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

The type should be 'number & { min: 1 }' or similar to indicate that this field only accepts positive integers. Currently, it accepts any number which could lead to bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doesn't really require, as we're having that check in other part of code.

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "EventType" ADD COLUMN "roundRobinHostsCount" INTEGER DEFAULT 1;
Copy link

Choose a reason for hiding this comment

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

Column should be defined as NOT NULL since it has a default value and validation in code ensures it's always >= 1.

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "EventType" ADD COLUMN "roundRobinHostsCount" INTEGER DEFAULT 1;
Copy link

Choose a reason for hiding this comment

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

Consider adding a CHECK constraint to enforce roundRobinHostsCount >= 1 at the database level.

await users.deleteAll();
});

test("success booking with multiple hosts", async ({ page, users }) => {
Copy link

Choose a reason for hiding this comment

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

Rule violated: E2E Tests Best Practices

  Missing URL assertions after navigation actions

await expect(page2.getByTestId("success-page")).toBeVisible();
});

test("show alert if multiple hosts count is more than available hosts", async ({ page, users }) => {
Copy link

Choose a reason for hiding this comment

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

Rule violated: E2E Tests Best Practices

  Missing URL assertions after navigation actions

@github-actions github-actions bot added $500 Low priority Created by Linear-GitHub Sync Stale 💎 Bounty A bounty on Algora.io labels Apr 21, 2025
@github-actions github-actions bot removed the Stale label Apr 22, 2025
@romitg2
Copy link
Contributor Author

romitg2 commented Apr 24, 2025

@TusharBhatt1 @retrogtx review 🙏

@romitg2
Copy link
Contributor Author

romitg2 commented Apr 27, 2025

@CarinaWolli @keithwillcode how would we like to have manual reassignment for multiple hosts?

  • should we allow replacement of only few selected hosts
  • or select all new hosts (may include some from previously assigned)?
  • any specific ui changes for this?

Screenshot 2025-04-27 at 5 55 38 PM

@github-actions github-actions bot added the Stale label Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated-tests area: unit tests, e2e tests, playwright 🙋 Bounty claim 💎 Bounty A bounty on Algora.io community Created by Linear-GitHub Sync ✨ feature New feature or request Low priority Created by Linear-GitHub Sync ❗️ migrations contains migration files Stale teams area: teams, round robin, collective, managed event-types $500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple Round Robin Hosts
1 participant