Skip to content

Conversation

skwowet
Copy link
Member

@skwowet skwowet commented Oct 6, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at bb6cce0

Added plan limit checks for automations in automationRepository.ts. This prevents tenants from creating or updating more active automations than their plan allows.

🤖 Generated by Copilot at bb6cce0

Sing, O Muse, of the skillful coder who devised
A cunning limit for the automations of the tenants,
Those FeatureFlag-bearing workers of the cloud,
Who strive to harness the power of AutomationState.

Why

How

🤖 Generated by Copilot at bb6cce0

  • Import AutomationState enum to use for automation state checks and updates (link)
  • Import FeatureFlag and PLAN_LIMITS constants to use for enforcing plan limits on active automations (link)
  • Count existing active automations in the current tenant using findAndCountAll method and store in existingActiveAutomations variable (link)
  • Set state property of new automation to AutomationState.DISABLED if plan limit is reached (link)
  • Throw error if updating automation to AutomationState.ACTIVE would exceed plan limit (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@skwowet skwowet added the Improvement Created by Linear-GitHub Sync label Oct 6, 2023
@skwowet skwowet requested a review from themarolt October 6, 2023 17:37
@skwowet skwowet merged commit a06d391 into main Oct 9, 2023
@skwowet skwowet deleted the automation-limit branch October 9, 2023 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants