This commit extracts code from the `CopilotActionBase.ts` file into separate functions for better code organization and readability. The extracted code includes the logic for ordering SSL certificates, checking the order status, and handling domain removal. This refactoring improves the maintainability and modularity of the codebase.
This commit adds a blank line at the end of the Copilot README.md file. This change ensures consistency in the file structure and improves readability.
This commit updates the `CopilotActionsBase.ts` file to include a message about PR generation in the warning section. The message informs users that the PR is generated by OneUptime Copilot and advises them to review the changes before merging. This enhancement improves the clarity and transparency of the generated PRs.
This commit modifies the `Copilot/Init.ts` file to execute the `CopilotActionService.execute` method for each event that needs fixing. It also updates the `currentFixCount` variable to keep track of the number of fixes performed. This refactor improves the functionality of the Copilot service by ensuring that all necessary actions are executed and the fix count is accurately maintained.
refactor: Add FixGrammarAndSpelling action to CopilotActionType and CopilotActions
This commit adds the `FixGrammarAndSpelling` action to the `CopilotActionType` enum and the `CopilotActions` dictionary. The action is now available for execution in the Copilot service. This enhancement improves the codebase by providing a new action that can be used to fix grammar and spelling errors in the application.
This commit removes the unused `CopilotActionType` enum value from the `CopilotActionType.ts` file. The value was commented out and had no impact on the functionality of the application. Removing it helps to improve code clarity and maintainability.
This commit removes the unused `PromptsUtil` class from the codebase. The class was no longer being used and had no impact on the functionality of the application. Removing it helps to reduce code complexity and improve maintainability.
The code changes in this commit refactor the comments in the `CopilotActionType` and `CopilotActionsBase` files. The comments have been improved to provide clearer instructions and guidelines for code commenting. This enhancement ensures that the codebase is well-documented and easier to understand for future developers.
The branch name generation in CopilotActionsBase.ts has been fixed to replace double hyphens with a single hyphen. This ensures that the branch name is correctly formatted and avoids any potential issues with branch creation and management.
The branch name generation in CopilotActionsBase.ts has been fixed to replace double hyphens with a single hyphen. This ensures that the branch name is correctly formatted and avoids any potential issues with branch creation and management.
This commit updates the import paths for the LlmType module in the following files:
- Copilot/Config.ts
- Copilot/Service/LLM/Llama.ts
- Copilot/Service/LLM/LLM.ts
The import paths are corrected to match the actual file structure, ensuring that the LlmType module is properly imported and used throughout the codebase. This change improves the maintainability and readability of the code.
This commit removes the unused CopilotEvent enum and CopilotEventService class. These files are no longer needed in the codebase and can be safely deleted. Removing unused code improves the maintainability and reduces the complexity of the project.
This commit refactors the code by improving the comments in the code and updating the job function in app.py. The comments are now focused on code that is hard to understand, and unnecessary comments are removed. The job function is converted to an async function to support asynchronous processing, which improves the performance and responsiveness of the application. These changes enhance the readability and efficiency of the codebase.
The file path in the CodeRepositoryUtil.getFileContent() method is now sanitized using the LocalFile.sanitizeFilePath() function before executing the command. This change ensures that the file path is properly formatted and prevents any potential security vulnerabilities or errors caused by invalid file paths.
This commit adds the FixNumberOfCodeEventsInEachRun constant to the Config.ts file. The constant is set to 5 and is used to determine the number of code events to fix in each run. This change improves the flexibility and configurability of the code events handling in the application.
This commit updates the branch name in Copilot/Index.ts from 'test-branch-3' to 'test-branch-4'. Additionally, it adds the GITHUB_USERNAME variable to the .env.example file. These changes improve the accuracy and functionality of the code.
This commit modifies the CodeRepositoryUtil class in CodeRepository.ts to include a new parameter, serviceRepository, in the createBranch and createOrCheckoutBranch methods. This change allows for better integration with the ServiceRepository class and improves the flexibility and maintainability of the code.
The HostedCodeRepository class in HostedCodeRepository.ts has been updated to include a new method, createPullRequest. This method allows for the creation of pull requests in the code repository. This change enhances the functionality and flexibility of the HostedCodeRepository class.
The ServiceFileTypesUtil class in ServiceFileTypes.ts has been updated to include two new methods: getCommonDirectoriesToIgnore and getCommonFilesToIgnore. These methods return arrays of common directories and files that should be ignored in code repositories. This change improves the functionality and maintainability of the code by providing a centralized way to define and retrieve the directories and files to ignore.
The ServiceRepository class in ServiceRepository.ts has been updated to include a new field, serviceLanguage. This field is of type ServiceLanguage and is required. This change allows for better organization and identification of code repositories based on their programming language.
This commit refactors the CodeRepositoryUtil and LocalFile classes to include a new method, sanitizeFilePath, which removes double slashes from file paths. This change ensures that file paths are properly formatted and improves the reliability and maintainability of the code.
The ServiceRepository class in ServiceRepository.ts has been updated to use the number type for the limitNumberOfOpenPullRequestsCount property instead of the string type. This change ensures that the property is correctly typed and improves the accuracy and reliability of the code.
The CodeRepositoryType.ts file has been refactored to remove commented out code and unused imports. This change improves code cleanliness and reduces unnecessary clutter in the file.
The Config.ts file has been updated to handle the GitHub token more efficiently. The GetGitHubToken function now checks the repository type and throws an exception if a GitHub token is required but not provided. This change improves the security and reliability of the application by ensuring that the correct token is used for GitHub repositories.
The jest.config.json files in the Model, Probe, Common, Copilot, CommonUI, Ingestor, IsolatedVM, TestServer, and CommonServer directories have been updated. The "testPathIgnorePatterns" property has been added to each file, excluding the "node_modules" and "dist" directories from test path matching. This change improves test performance and ensures that unnecessary files are not included in the test coverage.
The CodeRepositoryUtil methods getGitCommitHashForFile and getFilesInDirectory have been updated to accept a repoPath parameter. This change allows for specifying the repository path when retrieving the git commit hash for a file or getting the files in a directory. It improves the flexibility and reusability of the CodeRepositoryUtil class.
This code change updates the CodeRepositoryAPI endpoint in the CodeRepositoryAPI.ts file to use the POST method instead of the GET method for getting the code repository. The route has also been modified to "/get-code-repository/:secretkey" to align with the API design. This change ensures that the code repository is retrieved securely and follows the recommended RESTful API practices.
This code change adds the CodeRepositoryAPI endpoint to the BaseAPIFeatureSet in the App/FeatureSet/BaseAPI/Index.ts file. It imports the CodeRepository model and service, and includes the necessary routing and configuration for the endpoint. This change allows for the CRUD operations on CodeRepository data through the API.
Update CodeRepository.getRepository() to return a Promise<CodeRepositoryModel> instead of a string. This change improves the functionality and flexibility of the CodeRepository class.
The CodeRepository.getRepository() method has been updated to return a Promise<CodeRepositoryModel> instead of a string. This change ensures that the method is asynchronous and can handle asynchronous operations, improving the overall functionality and flexibility of the CodeRepository class.
The startup message in the Copilot/Index.ts file has been updated to provide a clearer description of the application. This change improves the readability and understanding of the log output during the startup process.
This code change updates the Dockerfile and build steps for the Copilot service. It adds a new workflow job, `docker-build-copilot`, which builds the Docker image for the Copilot service. The job includes steps to checkout the code, preinstall dependencies, and build the Docker image using the specified Dockerfile. This change ensures that the Copilot service is built and deployed correctly in the CI/CD pipeline.
This code change updates the logger class to use the configured log level from the environment configuration. The getLogLevel method is added to retrieve the log level, and the info, error, warn, and debug methods are updated to check the log level before logging the message. This change ensures that the logger behaves according to the configured log level, improving the consistency and control of log output.