-
Notifications
You must be signed in to change notification settings - Fork 1
Update prod #497
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
Merged
Update prod #497
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Improve quota notification and blocking logic Refactored the quota check to ensure workspaces are blocked and notified only when appropriate. Added logging for both blocking and approaching quota limits, and clarified notification task handling. * Suppress magic number lint warning in logger Added an ESLint directive to ignore the magic number warning for the percentage calculation in the workspace events limit log message.
* pull new hawk types * Track blocked date for workspaces in LimiterWorker Adds a 'blockedDate' property to workspaces when blocking and unblocking them. This allows tracking when a workspace was blocked or cleared, improving auditability and state management. * Add and populate blockedDate for blocked workspaces Introduces the blockedDate field to workspace updates in dbHelper and ensures it is set for all blocked workspaces, including a temporary fix for existing records missing this field. This change supports better tracking of when a workspace was blocked and prepares for future removal of the migration code. * Add tests for blockedDate handling in workspaces Extended tests to cover setting and clearing the blockedDate field when blocking and unblocking workspaces. Added scenarios for updating blockedDate when missing and verifying correct behavior during workspace state transitions. * Update index.ts * Refactor blocked workspace reminder to use days after block Renamed variables and template placeholders from 'daysAfterPayday' to 'daysAfterBlock' to more accurately reflect the time since a workspace was blocked. Updated related logic, types, and templates to use the new naming and calculation. Added a utility function to compute days after block in payday.ts. * Update yarn.lock to deduplicate and reorder entries This commit cleans up the yarn.lock file by removing duplicate entries, consolidating package references, and reordering dependencies for consistency. No package versions were changed; this improves maintainability and reduces lockfile bloat. * Rename daysAfterPayday to daysAfterBlock in payload Updated variable and property names from daysAfterPayday to daysAfterBlock in SenderWorker to reflect the correct payload structure and improve clarity. * Handle undefined daysAfterBlock in reminders logic Updated countDaysAfterBlock to return undefined instead of null when blockedDate is missing. Adjusted paymaster worker logic to check for undefined, ensuring reminders are sent only when daysAfterBlock is valid. * Adjust blockedDate calculation in PaymasterWorker test Updates the blockedDate assignment to subtract days based on expectedDaysAfterBlock in the PaymasterWorker test, improving test accuracy for blocked subscriptions. * Update workers/paymaster/tests/index.test.ts Co-authored-by: Copilot <[email protected]> * Update workers/paymaster/src/index.ts Co-authored-by: Copilot <[email protected]> * Update lib/utils/payday.ts Co-authored-by: Copilot <[email protected]> * Update dbHelper.test.ts * Remove obsolete test and update blocked workspace logic Deleted a test for setting blockedDate on already blocked workspaces in limiter tests, as the scenario is no longer relevant. Updated workspace mock to include blockedDate as undefined. Simplified reminder logic in PaymasterWorker by removing unnecessary undefined check for daysAfterBlock. * Refactor blockedDate handling in workspace mocks Removed redundant logic for setting blockedDate when workspace is already blocked in LimiterWorker. Standardized blockedDate type to Date (not Date | null/undefined) in test mocks and updated test cases to use null instead of undefined where appropriate. * Update index.test.ts * Update dbHelper.test.ts * Update index.test.ts * Update index.test.ts * Update workers/paymaster/tests/index.test.ts Co-authored-by: Copilot <[email protected]> * Update index.test.ts * Update workers/paymaster/src/index.ts Co-authored-by: Copilot <[email protected]> * Update lib/utils/payday.ts Co-authored-by: Copilot <[email protected]> * Update workers/paymaster/src/index.ts Co-authored-by: Copilot <[email protected]> * Update emailOverview.ts * Update workers/limiter/src/index.ts Co-authored-by: Copilot <[email protected]> * Update lib/utils/payday.ts Co-authored-by: Peter <[email protected]> * Update index.test.ts * Update index.test.ts * Update index.ts --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Peter <[email protected]>
…orks (#492) * feat(): arrange babel plugins respectfully to vue and svetle frameworks * chore(): add context to hawk errors and cover utils with tests * chore(): clean up * Update workers/javascript/src/utils.ts Co-authored-by: Copilot <[email protected]> * chore(): fix tests description * imp(): move getFunctionContext to utils * chore(): lint fix * chore(): improve jsdoc --------- Co-authored-by: Copilot <[email protected]>
* Refetch plans if workspace tariff is missing from cache Introduces logic to refetch tariff plans from the database if a workspace references a plan not present in the cached list. Adds tests to verify that plans are refetched when needed and that an error is thrown if the plan is still missing after refetching. * Refactor plan fetching and lookup methods Moved helper methods below the public ones to satisfy @typescript-eslint/member-ordering. Lint should now pass for those ordering errors. * Update workspace block status in database Added database updates to set the isBlocked flag and blockedDate when blocking a workspace, and to unset isBlocked when unblocking. This ensures the workspace's block status is accurately reflected in the database. * Remove unused plan lookup methods Deleted the private methods findPlanById and getWorkspacePlan from PaymasterWorker as they are no longer used in the codebase. * Update index.ts * Update index.ts
* Refactor payday calculation logic for clarity Reorganized the logic in countDaysBeforePayday and countDaysAfterPayday to consistently handle the paidUntil and isDebug parameters. Added a @todo note to remove the isDebug feature in the future as it complicates the logic. * Update payday.ts * Refactor payday calculation logic Extracted payday date calculation into a new getPayday function and updated countDaysBeforePayday and countDaysAfterPayday to use it. This improves code reuse and clarity. * try to add tests * Update payday.test.ts * Rename 'date' param to 'lastChargeDate' in payday utils Updated function parameter names and related references from 'date' to 'lastChargeDate' in payday utility functions for improved clarity and consistency. * Remove 0 from DAYS_LEFT_ALERT notifications Admins will now only be notified 3, 2, and 1 days before payment, not on the due day itself. This reduces redundant notifications. * Remove integration scenario tests from payday utility Deleted the 'Integration scenarios' test suite from payday.test.ts to reduce test coverage to unit-level only. This streamlines the test file and focuses on isolated function testing. * Add comment for prepaid workspace recharge logic Added a clarifying comment explaining the recharge process for prepaid workspaces, noting that limits should be reset even if no payment is due. This improves code readability and understanding of billing logic. * Update test to check addTask call for unblocking Modified the PaymasterWorker test to assert that the 'addTask' method is called with the correct parameters for unblocking a workspace, instead of checking workspace fields directly.
* Localize email templates to Russian Translated all user-facing text in email templates from English to Russian, including subjects, button labels, and message bodies. Updated pluralization and formatting to use Russian language rules and improved consistency across all notification types. * Update workers/email/src/templates/emails/assignee/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/sign-up/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/payment-failed/html.twig Co-authored-by: Peter <[email protected]> * Update workers/email/src/templates/emails/payment-success/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/events-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Update wording in events limit notification emails Refined the message in both HTML and text templates for the 'events limit almost reached' email to clarify staying informed about all incidents. * Update assignee email templates wording Revised the message in both HTML and text email templates to clarify that the recipient is assigned as responsible for fixing a bug in the project, instead of just processing an event. * Update subject.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Refine event email templates formatting Improved the formatting of the unsubscribe text in the HTML template by consolidating it into a single line. Updated the text template to conditionally display the event type with a colon only if it exists, enhancing clarity in event listings. * Update event-info.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/subject.twig Co-authored-by: Peter <[email protected]> * Update workers/email/src/templates/emails/event/text.twig Co-authored-by: Peter <[email protected]> * Improve event type and title display in email templates Updated both HTML and text email templates to conditionally display the event type followed by the event title only if the type exists, improving clarity and formatting. * Update workers/email/src/templates/emails/events-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update event email templates button and link text Changed the button label and link text from 'Просмотреть событие' to 'Просмотреть детали' in both HTML and text event email templates for improved clarity. * Update Russian email templates for events limit notice Improved the wording in both HTML and text versions of the 'events limit almost reached' email templates in Russian for better clarity and tone. * Update days-limit email templates with renewal info Added conditional messaging in both HTML and text email templates to inform users if their subscription will be auto-renewed or if they need to attach a card or pay manually, based on the presence of a subscription ID. * Update email templates branding and footer text Replaces 'Российский трекер ошибок' and 'Сделан в CodeX' with 'Мониторинг ошибок' in all email templates and layout. This unifies and simplifies the branding across all notification emails. * Fix placement of plan suspension notice in email templates Moved the warning about error monitoring suspension to appear only when appropriate in both HTML and text versions of the days-limit-almost-reached email. This ensures the message is shown in the correct context for users without an active subscription. * Unify unsubscribe text in email templates Standardized the wording of unsubscribe and notification preference instructions across all email templates for consistency and clarity. * Update Russian email templates wording and formatting Changed button labels from 'Просмотреть' to 'Смотреть' for consistency across assignee, event, and several-events templates. Improved formatting in events-limit-almost-reached and sign-up HTML templates by adding line breaks for better readability. * Prefill email in login link for sign-up email Updated the login button in the sign-up email template to include the email as a query parameter, allowing the login form to be prefilled for the user. * Update workers/email/src/templates/emails/assignee/html.twig Co-authored-by: Peter <[email protected]> * Prefill email in sign-up email login link Updated the login link in the sign-up email template to include the email as a query parameter, allowing the login form to be prefilled for new users. * Simplify days-limit-almost-reached email templates Removed conditional logic for subscription status in both HTML and text email templates. Now always informs the user that the subscription will be renewed in the specified number of days. * Update days-limit email templates with clearer renewal info Revised both HTML and text email templates to clarify the need to link a card for automatic renewal or pay for the next month manually. Added a warning that error monitoring will be suspended if the plan is not renewed. * Fix event type display when type is undefined in email templates Updated event email templates to use the default filter for event type, preventing display issues when the type is undefined or missing. This ensures consistent formatting in both HTML and text versions of event notification emails. * Refactor event type display in email templates Replaced inline ternary logic with Twig if statements for displaying event types in event email templates. This improves readability and consistency across HTML and text versions. * Update workspace invite subject variable name Changed the variable in the workspace invite email subject from 'name' to 'workspaceName' for improved clarity and consistency. * Remove duplicate event title block in email template Deleted a redundant table row displaying the event title and icon above the main event title block in the event email template to avoid duplicate information. * Update html.twig * fix some styles * Update backtrace.twig * Update event-info.twig * few more fixes * Update backtrace.twig * Update subject.twig * Add environment prefix to email sender name Non-production environments now include the environment name in the email sender name to help distinguish emails sent from staging or development. * Revert "Add environment prefix to email sender name" This reverts commit 29adaa6. * Add user email to sign-up email template variables Introduces an 'email' field to the sign-up template variables and updates the email template to use this value for the login button link. This ensures the correct email is prefilled in the login URL. * Update backtrace.twig * move nobr outside or pre * fix typo * remove nobr --------- Co-authored-by: Peter <[email protected]>
* Localize email templates to Russian Translated all user-facing text in email templates from English to Russian, including subjects, button labels, and message bodies. Updated pluralization and formatting to use Russian language rules and improved consistency across all notification types. * Update workers/email/src/templates/emails/assignee/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/sign-up/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/payment-failed/html.twig Co-authored-by: Peter <[email protected]> * Update workers/email/src/templates/emails/payment-success/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/events-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Update wording in events limit notification emails Refined the message in both HTML and text templates for the 'events limit almost reached' email to clarify staying informed about all incidents. * Update assignee email templates wording Revised the message in both HTML and text email templates to clarify that the recipient is assigned as responsible for fixing a bug in the project, instead of just processing an event. * Update subject.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Refine event email templates formatting Improved the formatting of the unsubscribe text in the HTML template by consolidating it into a single line. Updated the text template to conditionally display the event type with a colon only if it exists, enhancing clarity in event listings. * Update event-info.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/subject.twig Co-authored-by: Peter <[email protected]> * Update workers/email/src/templates/emails/event/text.twig Co-authored-by: Peter <[email protected]> * Improve event type and title display in email templates Updated both HTML and text email templates to conditionally display the event type followed by the event title only if the type exists, improving clarity and formatting. * Update workers/email/src/templates/emails/events-limit-almost-reached/html.twig Co-authored-by: Peter <[email protected]> * Update text.twig * Update event email templates button and link text Changed the button label and link text from 'Просмотреть событие' to 'Просмотреть детали' in both HTML and text event email templates for improved clarity. * Update Russian email templates for events limit notice Improved the wording in both HTML and text versions of the 'events limit almost reached' email templates in Russian for better clarity and tone. * Update days-limit email templates with renewal info Added conditional messaging in both HTML and text email templates to inform users if their subscription will be auto-renewed or if they need to attach a card or pay manually, based on the presence of a subscription ID. * Update email templates branding and footer text Replaces 'Российский трекер ошибок' and 'Сделан в CodeX' with 'Мониторинг ошибок' in all email templates and layout. This unifies and simplifies the branding across all notification emails. * Fix placement of plan suspension notice in email templates Moved the warning about error monitoring suspension to appear only when appropriate in both HTML and text versions of the days-limit-almost-reached email. This ensures the message is shown in the correct context for users without an active subscription. * Unify unsubscribe text in email templates Standardized the wording of unsubscribe and notification preference instructions across all email templates for consistency and clarity. * Update Russian email templates wording and formatting Changed button labels from 'Просмотреть' to 'Смотреть' for consistency across assignee, event, and several-events templates. Improved formatting in events-limit-almost-reached and sign-up HTML templates by adding line breaks for better readability. * Prefill email in login link for sign-up email Updated the login button in the sign-up email template to include the email as a query parameter, allowing the login form to be prefilled for the user. * Update workers/email/src/templates/emails/assignee/html.twig Co-authored-by: Peter <[email protected]> * Prefill email in sign-up email login link Updated the login link in the sign-up email template to include the email as a query parameter, allowing the login form to be prefilled for new users. * Simplify days-limit-almost-reached email templates Removed conditional logic for subscription status in both HTML and text email templates. Now always informs the user that the subscription will be renewed in the specified number of days. * Update days-limit email templates with clearer renewal info Revised both HTML and text email templates to clarify the need to link a card for automatic renewal or pay for the next month manually. Added a warning that error monitoring will be suspended if the plan is not renewed. * Fix event type display when type is undefined in email templates Updated event email templates to use the default filter for event type, preventing display issues when the type is undefined or missing. This ensures consistent formatting in both HTML and text versions of event notification emails. * Refactor event type display in email templates Replaced inline ternary logic with Twig if statements for displaying event types in event email templates. This improves readability and consistency across HTML and text versions. * Update workspace invite subject variable name Changed the variable in the workspace invite email subject from 'name' to 'workspaceName' for improved clarity and consistency. * Remove duplicate event title block in email template Deleted a redundant table row displaying the event title and icon above the main event title block in the event email template to avoid duplicate information. * Update html.twig * fix some styles * Update backtrace.twig * Update event-info.twig * few more fixes * Update backtrace.twig * Update subject.twig * Add environment prefix to email sender name Non-production environments now include the environment name in the email sender name to help distinguish emails sent from staging or development. * Revert "Add environment prefix to email sender name" This reverts commit 29adaa6. * Add user email to sign-up email template variables Introduces an 'email' field to the sign-up template variables and updates the email template to use this value for the login button link. This ensures the correct email is prefilled in the login URL. * Add UTM parameters to email template links Appends UTM parameters to all actionable links in email templates for better tracking of user engagement from transactional emails. Each template now sets a relevant utm_campaign value, and links are updated accordingly in both HTML and text versions. * Fix typos and update payment instructions in email templates Corrected a typo in the renewal message and updated the payment settings instruction in both HTML and text versions of the days-limit-almost-reached email templates. --------- Co-authored-by: Peter <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Auto-generated prod update suggestion