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: org-wide workflows #15083

Draft
wants to merge 152 commits into
base: main
Choose a base branch
from
Draft

feat: org-wide workflows #15083

wants to merge 152 commits into from

Conversation

CarinaWolli
Copy link
Member

@CarinaWolli CarinaWolli commented May 16, 2024

What does this PR do?

  • Org-workflow can be set active on teams and will trigger for all the team event types + all the user event types of the team members.
    • if a user is member of several active teams, the workflow only triggers once
  • Add 'apply to all, including future teams/event-types'
  • workflows/update.handler is refactored into smaller functions that can be reused and tested.
  • Also fixes some small existing bugs that I found when refactoring the code

Todo:

  • When member is removed from team and workflow has 'active on all, including future' set then reminders aren't deleted (reminders should be deleted if user isn't member of any other team)
  • should org workflow be triggered if user is not part of any team?
  • write unit test for deleteWorkfowRemindersOfRemovedMember

Follow ups:

Fixes #14638
Fixes CAL-3489

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected)
  • I have added a Docs issue here if this PR makes changes that would require a documentation change --> Created an issue for that: Org-wide workflows docs#93
  • I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

How should this be tested?

Basic test:

  • Create an org workflow
  • Set active on a team (or all teams)
  • Book a team event type --> see if workflow triggers
  • Book a user event type of a team member --> see if workflow triggers

Test other cases, for example:

  • test with several teams when some team members are part of several teams --> a workflow should always just trigger once
  • Test updating a 'before event' workflow and see if WorkflowReminders are correctly adjusted
  • Test removing team workflow and see if reminders are deleted (if user is still part of another team that is active, the reminder should stay)
  • delete/add reminders for deleted/added steps
  • Add reminders for new active teams
  • Test if 'active on all teams/even-types, including future ones' works with new event types/teams

Copy link
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

Amazing work @CarinaWolli 🎉 It is a complex addition to workflows affecting a lot of places.

It was great reviewing this with your speed of iteration as well !!

I am not sure if we should merge this now or wait till after the retreat as it is a big PR.

@hariombalhara
Copy link
Member

Amazing work @CarinaWolli 🎉 It is a complex addition to workflows affecting a lot of places.

It was great reviewing this with your speed of iteration as well !!

I am not sure if we should merge this now or wait till after the retreat as it is a big PR.

Also, someone else who has more experience with workflows should also review this to ensure the entire functionality is working

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

@CarinaWolli can i disable global org workflow on any event type?

I see the message "Locked by team admin" even on my personal event types
Screenshot 2024-06-25 at 3 13 42 PM

@CarinaWolli
Copy link
Member Author

@CarinaWolli can i disable global org workflow on any event type?

I see the message "Locked by team admin" even on my personal event types

org workflows can't be disabled on any event type, that's by design

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

LGTM. Great work.

tested org, team and user workflows.
The only thing we can improve is to divide the large functions ( like scheduleBookingReminders) into smaller, more manageable functions.

@keithwillcode
Copy link
Contributor

@emrysal @zomars Just spoke with @CarinaWolli and we are going to wait until post-retreat to merge this. Moving back to draft for that reason.

@keithwillcode keithwillcode marked this pull request as draft June 26, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking consumer core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ✨ feature New feature or request High priority Created by Linear-GitHub Sync ❗️ migrations contains migration files organizations area: organizations, orgs ready-for-e2e teams area: teams, round robin, collective, managed event-types workflows area: workflows, automations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3489] org-wide workflows
5 participants