-
Notifications
You must be signed in to change notification settings - Fork 67
Feat/cleanup #392
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
base: main
Are you sure you want to change the base?
Feat/cleanup #392
Conversation
remove unused use cases clean up modules
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Changes related to environment variables were detected in |
|
The pull request body is empty. It should include a reference to the issue it addresses, such as 'Closes #123' or 'Fixes #456', to ensure proper issue tracking. Kody Rule violation: Ensure PR closes referenced issues |
src/core/infrastructure/adapters/repositories/typeorm/schema/automationExecution.model.ts
Show resolved
Hide resolved
src/core/infrastructure/http/controllers/integrations/integration.controller.ts
Show resolved
Hide resolved
| constructor( | ||
| private readonly createTeamUseCase: CreateTeamUseCase, | ||
| private readonly updateTeamUseCase: UpdateTeamUseCase, | ||
| private readonly listTeamsUseCase: ListTeamsUseCase, | ||
| private readonly findFirstCreatedTeamUseCase: FindFirstCreatedTeamUseCase, | ||
| private readonly getByIdUseCase: GetByIdUseCase, | ||
| private readonly deleteTeamUseCase: DeleteTeamUseCase, | ||
| private readonly listTeamsWithIntegrationsUseCase: ListTeamsWithIntegrationsUseCase, | ||
| ) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor(
@Inject(LIST_TEAMS_USE_CASE_TOKEN)
private readonly listTeamsUseCase: ListTeamsUseCase,
@Inject(LIST_TEAMS_WITH_INTEGRATIONS_USE_CASE_TOKEN)
private readonly listTeamsWithIntegrationsUseCase: ListTeamsWithIntegrationsUseCase,
) {}The ListTeamsUseCase and ListTeamsWithIntegrationsUseCase services are injected directly by their class names. According to our Kody Rules, services should be injected using symbolic tokens and the @Inject decorator to reduce coupling.
Please update the constructor to use injection tokens. You will also need to import Inject from @nestjs/common and ensure the tokens are defined and provided in the relevant module.
Kody Rule violation: Injeção de dependências via tokens
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| ...UseCases, | ||
| ...OrganizationAutomationUseCases, | ||
| ...SaveCodeReviewFeedbackUseCase, | ||
| PromptService, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
provide: PROMPT_SERVICE_TOKEN, // This token needs to be created and exported
useClass: PromptService,
},The PromptService is provided directly by its class. According to our dependency injection standards, services should be provided using symbolic tokens to improve decoupling and maintain consistency. Please define a token for PromptService and use the { provide: YOUR_TOKEN, useClass: PromptService } syntax.
Kody Rule violation: Injeção de dependências via tokens
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| ...OrganizationAutomationUseCases, | ||
| ...SaveCodeReviewFeedbackUseCase, | ||
| PromptService, | ||
| RunCodeReviewAutomationUseCase, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
provide: RUN_CODE_REVIEW_AUTOMATION_USE_CASE_TOKEN, // This token needs to be created and exported
useClass: RunCodeReviewAutomationUseCase,
},The RunCodeReviewAutomationUseCase is provided directly by its class. According to our dependency injection standards, use cases and services must be provided using symbolic tokens to improve decoupling and maintain consistency. Please define a token for this use case and use the { provide: YOUR_TOKEN, useClass: RunCodeReviewAutomationUseCase } syntax.
Kody Rule violation: Injeção de dependências via tokens
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| GetCodeReviewFeedbackByOrganizationUseCase, | ||
| SaveCodeReviewFeedbackUseCase, | ||
| ] as const; | ||
| const UseCases = [GetReactionsUseCase, SaveCodeReviewFeedbackUseCase] as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { CodeReviewFeedbackController } from '@/core/infrastructure/http/controllers/codeReviewFeedback.controller';
import { GetCodeReviewFeedbackByOrganizationUseCase } from '@/core/application/use-cases/codeReviewFeedback/get-feedback-by-organization.use-case';
const UseCases = [
GetReactionsUseCase,
GetCodeReviewFeedbackByOrganizationUseCase,
SaveCodeReviewFeedbackUseCase,
] as const;
@Module({
imports: [
MongooseModule.forFeature([CodeReviewFeedbackModelInstance]),
forwardRef(() => TeamsModule),
forwardRef(() => OrganizationModule),
forwardRef(() => UsersModule),
forwardRef(() => PlatformIntegrationModule),
forwardRef(() => IntegrationModule),
forwardRef(() => IntegrationConfigModule),
forwardRef(() => ParametersModule),
forwardRef(() => GithubModule),
forwardRef(() => GitlabModule),
forwardRef(() => PullRequestsModule),
],
providers: [
...UseCases,
PromptService,
{
provide: CODE_REVIEW_FEEDBACK_REPOSITORY_TOKEN,
useClass: CodeReviewFeedbackRepository,
},
{
provide: CODE_REVIEW_FEEDBACK_SERVICE_TOKEN,
useClass: CodeReviewFeedbackService,
},
],
exports: [
CODE_REVIEW_FEEDBACK_REPOSITORY_TOKEN,
CODE_REVIEW_FEEDBACK_SERVICE_TOKEN,
...UseCases,
],
controllers: [CodeReviewFeedbackController],
})The CodeReviewFeedbackController has been removed from the module's controllers array, and its corresponding GetCodeReviewFeedbackByOrganizationUseCase has been removed from the UseCases provider list. This is a critical bug as it de-registers the module's entire HTTP API surface from the application.
Execution Analysis:
- At application startup, NestJS processes the
CodeReviewFeedbackModule. - It inspects the
controllersarray, which is now empty ([]). - Consequently, no routes from
CodeReviewFeedbackControllerare mapped. - Any API call from a client (e.g., a frontend application) to endpoints previously handled by this controller will now fail with a
404 Not Founderror.
This change effectively disables all features of this module that were exposed via HTTP, which will break any dependent services. To fix this, the controller and use case must be restored to the module definition, and their corresponding imports must be added back to the file.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| import { UseCases } from '@/core/application/use-cases/teamAutomation'; | ||
| import { Module, forwardRef } from '@nestjs/common'; | ||
| import { TypeOrmModule } from '@nestjs/typeorm'; | ||
| import { ActiveCodeManagementTeamAutomationsUseCase } from '@/core/application/use-cases/teamAutomation/active-code-manegement-automations.use-case'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { ActiveCodeManagementTeamAutomationsUseCase } from '@/core/application/use-cases/teamAutomation/active-code-management-automations.use-case';The import path for ActiveCodeManagementTeamAutomationsUseCase contains a typo: 'manegement' should be 'management'. This will cause the module resolution to fail during the build process, resulting in a 'Module not found' error and preventing the application from starting. The build will break because it cannot locate the file specified in the import statement, assuming the actual filename uses the correct spelling.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|


closes #376
This pull request focuses on a significant cleanup and refactoring of the application's architecture, primarily impacting database management, automation features, and API structure.
Key changes include:
1763402134271-baseline.ts) that defines the current complete schema. A separate migration (1763403030146-indexes.ts) was added to explicitly create critical database indexes concurrently, improving performance and simplifying future schema management.docker-composeconfigurations (docker-compose.dev.yml,docker-compose.dev.small.yml) to include a dedicatedmigratorservice. This service ensures all database migrations and seeding are successfully completed before the main application service starts, making the development environment more robust.ModelTestControllerand several one-time migration use cases (e.g., for code review parameters and pull request messages).forwardRef, to resolve circular dependencies and improve the overall modularity and maintainability of the codebase.API_PG_DB_HOSTenvironment variable across all environments.