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

remove innovation flow from template #4746

Merged
merged 2 commits into from
Dec 3, 2024
Merged

remove innovation flow from template #4746

merged 2 commits into from
Dec 3, 2024

Conversation

techsmyth
Copy link
Member

@techsmyth techsmyth commented Dec 2, 2024

code is updated

migration created but not tested on real data

Summary by CodeRabbit

  • New Features

    • Introduced a database migration to remove the InnovationFlow related structures from the system.
  • Bug Fixes

    • Streamlined error handling in URL generation services by removing unnecessary checks for associated templates.
  • Refactor

    • Removed references to InnovationFlow across various services and resolvers, simplifying the overall structure and functionality.
  • Chores

    • Updated service and resolver methods to reflect the removal of InnovationFlow related functionality.

Copy link
Contributor

coderabbitai bot commented Dec 2, 2024

Walkthrough

The changes in this pull request involve the removal of the INNOVATION_FLOW value from the TemplateType enum and the associated innovationFlow property from various classes and interfaces. This includes the Template, ITemplate, and related resolver and service classes. Additionally, a new migration file has been introduced to handle the database schema changes, including the deletion of related records. The overall structure of the affected classes is simplified as a result of these removals.

Changes

File Path Change Summary
src/common/enums/template.type.ts Removed enum value: INNOVATION_FLOW from TemplateType.
src/domain/template/template/template.entity.ts Removed property: innovationFlow from Template class.
src/domain/template/template/template.interface.ts Removed property: innovationFlow from ITemplate interface.
src/domain/template/template/template.module.ts Updated imports array in TemplateModule: removed InnovationFlowModule.
src/domain/template/template/template.resolver.fields.ts Removed method: innovationFlow field resolver; updated description for profile field resolver.
src/domain/template/template/template.service.authorization.ts Removed constructor parameter: innovationFlowAuthorizationService; removed related logic.
src/domain/template/template/template.service.ts Removed method: getInnovationFlow; removed variable: innovationFlowService.
src/domain/template/templates-set/templates.set.resolver.fields.ts Removed methods: innovationFlowTemplates and innovationFlowTemplatesCount.
src/domain/template/templates-set/templates.set.service.ts Removed method: addTemplates; renamed variable: innovationFlowsCount to collaborationTemplatesCount; updated template type in getTemplatesCount.
src/migrations/1733155972372-innovationFlowTemplate.ts Added migration class to handle deletion of innovationFlow related records from the database.
src/services/infrastructure/url-generator/url.generator.service.ts Removed logic for retrieving Template associated with InnovationFlow in relevant methods.

Possibly related PRs

Suggested reviewers

  • ccanos: Suggested as a reviewer for this pull request.

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@techsmyth techsmyth requested a review from bobbykolev December 2, 2024 16:43
@techsmyth
Copy link
Member Author

@bobbykolev to go with your client code removal...can you please esp migration test with real data?

Copy link
Contributor

@bobbykolev bobbykolev left a comment

Choose a reason for hiding this comment

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

Looking good with ACC data. However, the migration seems a bit slow ~1m.

@bobbykolev bobbykolev marked this pull request as ready for review December 3, 2024 12:48
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: 2

🧹 Outside diff range and nitpick comments (1)
src/migrations/1733155972372-innovationFlowTemplate.ts (1)

1-1: Remove unused import of 'of' from 'rxjs'.

The of import from 'rxjs' is not used in this migration file. Removing unused imports helps keep the code clean and maintainable.

Apply this diff to remove the unused import:

-import { of } from 'rxjs';
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e6d34ce and 9d21a9b.

📒 Files selected for processing (11)
  • src/common/enums/template.type.ts (0 hunks)
  • src/domain/template/template/template.entity.ts (0 hunks)
  • src/domain/template/template/template.interface.ts (0 hunks)
  • src/domain/template/template/template.module.ts (0 hunks)
  • src/domain/template/template/template.resolver.fields.ts (1 hunks)
  • src/domain/template/template/template.service.authorization.ts (1 hunks)
  • src/domain/template/template/template.service.ts (0 hunks)
  • src/domain/template/templates-set/templates.set.resolver.fields.ts (0 hunks)
  • src/domain/template/templates-set/templates.set.service.ts (2 hunks)
  • src/migrations/1733155972372-innovationFlowTemplate.ts (1 hunks)
  • src/services/infrastructure/url-generator/url.generator.service.ts (0 hunks)
💤 Files with no reviewable changes (7)
  • src/common/enums/template.type.ts
  • src/domain/template/template/template.entity.ts
  • src/domain/template/template/template.interface.ts
  • src/domain/template/template/template.module.ts
  • src/services/infrastructure/url-generator/url.generator.service.ts
  • src/domain/template/template/template.service.ts
  • src/domain/template/templates-set/templates.set.resolver.fields.ts
🧰 Additional context used
📓 Path-based instructions (4)
src/domain/template/template/template.service.authorization.ts (1)

Pattern src/**/*.{ts,js}: Review the TypeScript/JavaScript code for NestJS best practices, dependency injection, module structure, and potential bugs.

Context Files (Do Not Review):

  • docs/Design.md - Design overview of the project
  • docs/Pagination.md - Pagination design overview
  • docs/Developing.md - Development setup overview
  • docs/graphql-typeorm-usage.md - overview of GraphQL and TypeORM usage and how they are used together with NestJS in the project
  • docs/database-definitions.md - guidelines for creating TypeORM entity defnitions
  • src/core/error-handling/graphql.exception.filter.ts - GraphQL error handling
  • src/core/error-handling/http.exception.filter.ts - HTTP error handling
  • src/core/error-handling/rest.error.response.ts - REST error response
  • src/core/error-handling/unhandled.exception.filter.ts - Global exception handler

Guidelines:

  • Our project uses global exception handlers (UnhandledExceptionFilter), so avoid suggesting additional try/catch blocks unless handling specific cases.
  • Use NestJS latest documentation from https://docs.nestjs.com/ for reference on NestJS best practices.
  • Use TypeORM latest documentation from https://typeorm.io/ for reference on TypeORM best practices.
  • Refer to the design overview in the context files for better understanding.
src/domain/template/template/template.resolver.fields.ts (1)

Pattern src/**/*.{ts,js}: Review the TypeScript/JavaScript code for NestJS best practices, dependency injection, module structure, and potential bugs.

Context Files (Do Not Review):

  • docs/Design.md - Design overview of the project
  • docs/Pagination.md - Pagination design overview
  • docs/Developing.md - Development setup overview
  • docs/graphql-typeorm-usage.md - overview of GraphQL and TypeORM usage and how they are used together with NestJS in the project
  • docs/database-definitions.md - guidelines for creating TypeORM entity defnitions
  • src/core/error-handling/graphql.exception.filter.ts - GraphQL error handling
  • src/core/error-handling/http.exception.filter.ts - HTTP error handling
  • src/core/error-handling/rest.error.response.ts - REST error response
  • src/core/error-handling/unhandled.exception.filter.ts - Global exception handler

Guidelines:

  • Our project uses global exception handlers (UnhandledExceptionFilter), so avoid suggesting additional try/catch blocks unless handling specific cases.
  • Use NestJS latest documentation from https://docs.nestjs.com/ for reference on NestJS best practices.
  • Use TypeORM latest documentation from https://typeorm.io/ for reference on TypeORM best practices.
  • Refer to the design overview in the context files for better understanding.
src/migrations/1733155972372-innovationFlowTemplate.ts (1)

Pattern src/**/*.{ts,js}: Review the TypeScript/JavaScript code for NestJS best practices, dependency injection, module structure, and potential bugs.

Context Files (Do Not Review):

  • docs/Design.md - Design overview of the project
  • docs/Pagination.md - Pagination design overview
  • docs/Developing.md - Development setup overview
  • docs/graphql-typeorm-usage.md - overview of GraphQL and TypeORM usage and how they are used together with NestJS in the project
  • docs/database-definitions.md - guidelines for creating TypeORM entity defnitions
  • src/core/error-handling/graphql.exception.filter.ts - GraphQL error handling
  • src/core/error-handling/http.exception.filter.ts - HTTP error handling
  • src/core/error-handling/rest.error.response.ts - REST error response
  • src/core/error-handling/unhandled.exception.filter.ts - Global exception handler

Guidelines:

  • Our project uses global exception handlers (UnhandledExceptionFilter), so avoid suggesting additional try/catch blocks unless handling specific cases.
  • Use NestJS latest documentation from https://docs.nestjs.com/ for reference on NestJS best practices.
  • Use TypeORM latest documentation from https://typeorm.io/ for reference on TypeORM best practices.
  • Refer to the design overview in the context files for better understanding.
src/domain/template/templates-set/templates.set.service.ts (1)

Pattern src/**/*.{ts,js}: Review the TypeScript/JavaScript code for NestJS best practices, dependency injection, module structure, and potential bugs.

Context Files (Do Not Review):

  • docs/Design.md - Design overview of the project
  • docs/Pagination.md - Pagination design overview
  • docs/Developing.md - Development setup overview
  • docs/graphql-typeorm-usage.md - overview of GraphQL and TypeORM usage and how they are used together with NestJS in the project
  • docs/database-definitions.md - guidelines for creating TypeORM entity defnitions
  • src/core/error-handling/graphql.exception.filter.ts - GraphQL error handling
  • src/core/error-handling/http.exception.filter.ts - HTTP error handling
  • src/core/error-handling/rest.error.response.ts - REST error response
  • src/core/error-handling/unhandled.exception.filter.ts - Global exception handler

Guidelines:

  • Our project uses global exception handlers (UnhandledExceptionFilter), so avoid suggesting additional try/catch blocks unless handling specific cases.
  • Use NestJS latest documentation from https://docs.nestjs.com/ for reference on NestJS best practices.
  • Use TypeORM latest documentation from https://typeorm.io/ for reference on TypeORM best practices.
  • Refer to the design overview in the context files for better understanding.
🔇 Additional comments (4)
src/domain/template/template/template.resolver.fields.ts (1)

24-24: LGTM!

The description update is appropriate and accurately reflects the 'profile' field.

src/domain/template/template/template.service.authorization.ts (1)

25-25: LGTM!

The dependency injection of CollaborationAuthorizationService is correctly implemented.

src/domain/template/templates-set/templates.set.service.ts (2)

198-201: LGTM!

Updating the variable name to collaborationTemplatesCount and changing the template type to TemplateType.COLLABORATION is appropriate and ensures consistency following the removal of INNOVATION_FLOW.


219-219: LGTM!

Including collaborationTemplatesCount in the total templates count calculation is correct.

@techsmyth
Copy link
Member Author

Expect faster on prod as very innovation flow templates there...

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.

2 participants