Skip to content
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

feat: Round robin reassignment via round robin algorithm [CAL-3138] #14308

Merged
merged 111 commits into from
Aug 6, 2024

Conversation

joeauyeung
Copy link
Contributor

@joeauyeung joeauyeung commented Apr 3, 2024

What does this PR do?

This PR allows teams to reassign round robin hosts via the round robin algorithm.

Fixes # (issue)

https://www.loom.com/share/3baf73e0a4754719871c6def104dabad

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is a UI/UX design document, please, share it here.

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Create a round robin event with no fixed hosts
  • Create a booking
  • Go to the bookings page and under edit choose the reassign action
    • The booking should now have a new round robin host
    • The calendar events should reflect this
  • Do this again with fixed hosts
    • The calendar event should still belong to the fixed host but the attendees would have changed

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Copy link
Contributor

github-actions bot commented Apr 3, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@keithwillcode keithwillcode added consumer core area: core, team members only labels Apr 3, 2024
@keithwillcode keithwillcode added this to the v4.1 milestone Apr 16, 2024
Copy link
Contributor

github-actions bot commented May 1, 2024

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label May 1, 2024
@keithwillcode keithwillcode modified the milestones: v4.1, v4.2 May 15, 2024
@github-actions github-actions bot removed the Stale label May 16, 2024
Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label May 30, 2024
Copy link

vercel bot commented Jun 5, 2024

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2024 5:07pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 5:07pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jul 30, 2024 5:07pm

@graphite-app graphite-app bot requested a review from a team July 29, 2024 20:58
Comment on lines +414 to +416
where: {
deleted: null,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When changing organizers, we delete the previous organizer's 3rd party events. If we're rescheduling multiple times, we don't have to include already deleted references.

packages/lib/server/repository/user.ts Outdated Show resolved Hide resolved
include: {
workflowStep: {
include: {
workflow: true,
Copy link
Member

Choose a reason for hiding this comment

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

would workflowSelect from getAllWorkflows.ts work here instead of using include?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The workflowSelect nesting is workflow -> steps. This query is step -> workflow. I just selected the fields that would be relevant.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry missed that. Can we define all fields we need in a select instead of an include? Never use Includes - use select

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this one to select. The other include statements are needed.

packages/features/ee/round-robin/roundRobinReassignment.ts Outdated Show resolved Hide resolved
packages/features/ee/round-robin/roundRobinReassignment.ts Outdated Show resolved Hide resolved
references: true,
};

export const roundRobinReassignment = async ({ bookingId }: { bookingId: number }) => {
Copy link
Member

Choose a reason for hiding this comment

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

This function is really big and does a lot of things, I think we can improve that to make it better readable and easier to understand. This can be done later on though, I think we should focus on getting this merged now 🙏

Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

Nice work! I tested everything including calendar events and emails and looks good now 🙏

@PeerRich PeerRich merged commit 8fa39f2 into main Aug 6, 2024
38 checks passed
@PeerRich PeerRich deleted the rr-reassign branch August 6, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only ✨ feature New feature or request ready-for-e2e teams area: teams, round robin, collective, managed event-types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants