Open
Conversation
|
✅ ESLint check passed! |
|
✅ ESLint check passed! |
|
✅ ESLint check passed! |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a CloudService abstraction to support both OVH (Kubernetes) and AWS (ECS) for bot task execution, refactors existing services to use the new abstraction, and introduces OVH-specific configuration and Kubernetes integration.
- Introduced
CloudService,ICloudService, andCloudModuleto dynamically select OVH or AWS implementations. - Added OVH-specific
OvhService,OVHTaskProcessor, and related modules; updated configuration and.env.example. - Refactored
BotService,CronJobService, andECSClientServiceto use the newCloudServicemethods.
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cloud/cloud.service.ts | New abstraction selecting OVH vs AWS; methods for run/stop |
| src/ovh/ovh.service.ts | OVH Kubernetes implementation of ICloudService |
| src/ovh/processors/ovh-task.processor.ts | Processor for rescheduling failed OVH tasks |
| src/cron-job/cron-job.service.ts | Refactored cron jobs to use CloudService and Logger |
| src/aws/ecs.service.ts | ECS implementation updated to conform to ICloudService |
Comments suppressed due to low confidence (2)
api-backend/src/cloud/cloud.service.ts:55
- The method name 'runTeemsBotTask' has a typo ('Teems' vs 'Teams'). Rename it to 'runTeamsBotTask' for clarity and consistency.
async runTeemsBotTask(command: string[]): Promise<string> {
api-backend/src/cloud/cloud.service.ts:57
- The config key 'ovh.imageTeems' is misspelled; it should be 'ovh.imageTeams' to match the configuration and environment variable naming.
const image = this.configService.get('ovh.imageTeems');
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
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.
This pull request introduces significant changes to the backend to support multiple cloud providers (OVH and AWS) for bot task execution. It includes the addition of a new
CloudServiceabstraction, updates to existing services to integrate with the new cloud provider logic, and configuration enhancements to support OVH-specific settings. Below is a summary of the most important changes grouped by theme.Cloud Provider Integration
CloudServiceabstraction: Created a new service (api-backend/src/cloud/cloud.service.ts) that dynamically selects the appropriate cloud provider (OVH or AWS) based on configuration and delegates bot task operations like running and stopping tasks.CloudModule: Added a new module (api-backend/src/cloud/cloud.module.ts) to encapsulate the cloud-related logic and export theCloudService.ICloudServiceinterface: Added an interface (api-backend/src/cloud/cloud-service.interface.ts) to standardize cloud operations likerunTask,stopTask, andsyncTaskStatus.OVH-Specific Configuration and Support
OVH_IMAGE_GOOGLE,OVH_IMAGE_TEAMS, andOVH_IMAGE_ZOOMto the.env.examplefile for cloud configuration.configuration.tsfile to include OVH-specific settings likeimageGoogle,imageTeams, andimageZoom, as well as general cloud provider settings (CLOUD_PROVIDER).Refactoring for CloudService Integration
BotService: UpdatedBotService(api-backend/src/bot/bot.service.ts) to use theCloudServicefor bot task operations instead of directly interacting withECSClientService. Removed AWS-specific logic for task definitions and container names. [1] [2] [3] [4] [5]ECSClientService: ModifiedECSClientService(api-backend/src/aws/ecs.service.ts) to implement theICloudServiceinterface and adapt its methods to align with the new abstraction. [1] [2] [3]Dependency Updates
Dockerfile: Changed the base image in theDockerfilefrom Node.js 20 to Node.js 22 for compatibility and performance improvements.@kubernetes/client-nodepackage inpackage.jsonto support OVH Kubernetes operations.Miscellaneous Changes
AppModule: Integrated the newOvhModuleandCloudModuleinto the main application module (api-backend/src/app.module.ts) for dependency injection. [1] [2].gitignore: Addedkubeconfig.ymlto the.gitignorefile to prevent Kubernetes configuration files from being tracked.