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

*could not replicate or test locally* Temporarily removing performance heavy query #2508

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

Omri-Levy
Copy link
Contributor

@Omri-Levy Omri-Levy commented Jul 9, 2024

read title

  • refactor(workflows-service): now fetching workflows via endusers instead of using repository
  • refactor(workflows-service): improved performance on profiles query
  • refactor(workflow-service): renamed iterable name
  • perf(workflows-service): removed query that is performance heavy

Summary by CodeRabbit

  • New Features

    • Added an index to the Counterparty table for faster querying by endUserId.
  • Refactor

    • Enhanced CaseManagementController to include new tag-to-status mappings and improved data processing logic.
    • Removed obsolete methods from WorkflowService and WorkflowRuntimeDataRepository.
  • Documentation

    • Updated type definitions and interfaces in astro:content module for improved type safety and clarity.

Copy link

vercel bot commented Jul 9, 2024

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

Name Status Preview Comments Updated (UTC)
ballerine-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2024 0:48am

Copy link

changeset-bot bot commented Jul 9, 2024

⚠️ No Changeset found

Latest commit: 47b0111

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jul 9, 2024

Walkthrough

This update enhances the workflows-service by adding a new index to the Counterparty table and adjusting how the CaseManagementController processes data. Also, it removes deprecated methods in the WorkflowService and WorkflowRuntimeDataRepository classes. Moreover, documentation site typing definitions have been updated for improved type safety and better functionality.

Changes

File or Directory Change Summary
services/.../prisma/data-migrations Updated subproject commit reference.
services/.../migrations/20240709090531_enduser_id_index/migration.sql Created an index on the endUserId column in the Counterparty table.
services/.../prisma/schema.prisma Added @@index directive for the endUserId field in Counterparty model.
services/.../case-management/controller/case-management.controller.ts Improved data processing, including new mappings and query adjustments.
services/.../workflow/workflow-runtime-data.repository.ts Removed findFirstByEntityId method from WorkflowRuntimeDataRepository.
services/.../workflow/workflow.service.ts Removed getByEntityId method from WorkflowService.
websites/docs/.astro/types.d.ts Updated various type declarations and signatures for .mdx/.md` handling, collection functions, and entry management.

Poem

In databases deep, an index we place,
Where endUserId finds its cozy space.
Controllers now deftly handle with care,
Mapping, querying, a harmonious affair.
Removed old methods, streamline with grace,
Enhancing our code, a better embrace.
🎩🐰


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 304062e and 6269bfc.

Files selected for processing (7)
  • services/workflows-service/prisma/data-migrations (1 hunks)
  • services/workflows-service/prisma/migrations/20240709090531_enduser_id_index/migration.sql (1 hunks)
  • services/workflows-service/prisma/schema.prisma (1 hunks)
  • services/workflows-service/src/case-management/controllers/case-management.controller.ts (3 hunks)
  • services/workflows-service/src/workflow/workflow-runtime-data.repository.ts (1 hunks)
  • services/workflows-service/src/workflow/workflow.service.ts (1 hunks)
  • websites/docs/.astro/types.d.ts (1 hunks)
Files skipped from review due to trivial changes (4)
  • services/workflows-service/prisma/data-migrations
  • services/workflows-service/prisma/migrations/20240709090531_enduser_id_index/migration.sql
  • services/workflows-service/src/workflow/workflow-runtime-data.repository.ts
  • services/workflows-service/src/workflow/workflow.service.ts
Additional comments not posted (6)
services/workflows-service/src/case-management/controllers/case-management.controller.ts (1)

83-94: LGTM! Ensure correctness of the mapping.

The tagToKyc object mapping state tags to KYC statuses is correctly typed and appears to be accurate.

However, please verify that the mapping aligns with all possible state tags and KYC statuses.

websites/docs/.astro/types.d.ts (4)

2-7: LGTM!

The updated Render interface for .mdx file types is consistent with the expected structure.


12-17: LGTM!

The updated Render interface for .md file types is consistent with the expected structure.


33-48: LGTM!

The updated ImageFunction type is consistent with the expected structure of image metadata.


26-27: LGTM!

The updated type signatures and entries for CollectionEntry and related functions ensure consistency and type safety.

Also applies to: 84-178

services/workflows-service/prisma/schema.prisma (1)

848-848: LGTM!

Adding an index on the endUserId field in the Counterparty model can improve query performance.

@Omri-Levy Omri-Levy changed the title Temporarily removing performance heavy query *could not replicate or test locally* Temporarily removing performance heavy query Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant