Skip to content

[#195] 🐛 - AI PR description not ignoring files - #198

Merged
efraespada merged 5 commits into
developfrom
bugfix/195-ai-pr-description-not-ignoring-files
Mar 25, 2025
Merged

efraespada merged 5 commits into
developfrom
bugfix/195-ai-pr-description-not-ignoring-files

Conversation

@efraespada

@efraespada efraespada commented Mar 25, 2025 •

Copy link
Copy Markdown
Member

#195

What does this PR do?

This pull request addresses the issue where the AI PR description was not properly ignoring some files. When setting the config to ignore files under the dist folder, they were not being ignored as expected. This has been fixed in the master branch.

What files were changed?

  • src/data/manager/description/base/content_interface.ts:
      • Added a new function with name "getContent" in the module.
+ getContent() : string;
  • Modified an existing function by changing the return type from 'void' to 'boolean'.
- updateContent(data: any) : void;
+ updateContent(data: any) : boolean;
  • The change made in this file section was the addition of the import statement for the logError function from the logger utility.
 import { logError } from "../../../utils/logger";
    • Added a new method named calculateTotal to the interface.
+   calculateTotal(): number;
  • Updated the return type of the getData method to return an array of objects.
-   getData(): any;
+   getData(): object[];
  •        core.error(`Error reading issue configuration: ${error}`);
    
  •        logError(`Error reading issue configuration: ${error}`);
    

In this section of the file, a method was modified to change the way errors are logged. The method now calls a function `logError` instead of `core.error` when an error occurs.
  - - In the content_interface.ts file, two lines of code were added, one line was removed, resulting in a net increase of 1 line of code.
```typescript
-75,7 +76,7
  • The error console log message has been updated to use a function called logError instead of directly logging the error.
-            console.error(`Error updating issue description: ${error}`);
+            logError(`Error updating issue description: ${error}`);
  • src/data/model/execution.ts:
      • Added 3 lines of code between lines 24 and 24 of the file in the patch section.
someFunction() {
    // code added here
}
  • Modified 1 line of code in the patch section.
+    return result;
  • Deleted 1 line of code in the patch section.
-    console.log('Execution completed');
    • Added import for logDebugInfo and setGlobalLoggerDebug from "../utils/logger"
  • Added a new property "debug" with a default value of false to the Execution class.
import { logDebugInfo, setGlobalLoggerDebug } from "../utils/logger";

export class Execution {
    debug: boolean = false;
  • Three lines of code were added in the specified section of the file. The changes include an addition of 9 lines and modification of 2 lines.
-151,6 +154,7
  • Added a "debug" parameter to the constructor of the Execution class:
+ debug: boolean,

Changed the parameters order in the constructor of the Execution class, moving "singleAction" to the second position:

singleAction: SingleAction,
    • Added 9 lines of code and modified 2 lines in the execution.ts file in the model folder. The changes include an addition in the patch section starting from line 167 where a new piece of code was added.
@@ -167,6 +171,7
  • Added a new property "debug" to the Execution class:
this.debug = debug;

Modified the constructor parameters to include the new "debug" property:

constructor(
    workflows: Workflows,
    projects: ProjectDetail[],
    debug: boolean,
    singleAction: boolean,
    commitPrefixBuilder: CommitPrefixBuilder,
    issue: Issue,
) {
    • Added 9 lines and modified 2 lines in the execution.ts file.
  • Started by adding lines 186 to 191 in the patch section:
@@ -186,6 +191,8
 [code here]
    • Added a setGlobalLoggerDebug(this.debug) call inside the setup method of the Execution class.
  • The execution.ts file now sets up an issueRepository object within the setup method.
setGlobalLoggerDebug(this.debug);
    • Added 9 lines of code and modified 2 in the execution model section.
  • Specifically, at line 228, increased the section from 7 to 9 lines of code.
  • Patch section at line 228 was changed to:
-228,7 +235,7  
  • Added a logDebugInfo function call to replace a console.log statement.
-        console.log(`Previous configuration: ${JSON.stringify(this.previousConfiguration, null, 2)}`);
+        logDebugInfo(`Previous configuration: ${JSON.stringify(this.previousConfiguration, null, 2)}`);
    • A piece of code was added between lines 339 and 346.
+9 -2
  • The changes include a modification in the execution model at those specific lines.
    • The code in the Execution class was modified to change a console.log statement to a call to a logDebugInfo function:
-        console.log(`Current configuration: ${JSON.stringify(this.currentConfiguration, null, 2)}`);
+        logDebugInfo(`Current configuration: ${JSON.stringify(this.currentConfiguration, null, 2)}`);
  • src/data/model/single_action.ts:
    • The code in the single_action.ts file was modified, specifically in the patch section. Two lines were added and one line was removed from the file. Below is the specific code change in the patch section:
@@ -1,3 +1,5
+[new_line] [code here]
-[new_line] [code here]
  - - Added an import statement to import the `logError` function from the `logger` file in the `utils` folder.
- The total number of lines in the file increased by 2, from 4 to 6.
```typescript
import { logError } from "../utils/logger";
  • The deployedAction constant value remains the same.
  • The SingleAction class is not modified.
      • added 4 lines and removed 2 lines in the single_action model
    property1: string;
+   property2: number;
-   property3: boolean;
  • In the SingleAction class, the console error messages for when an issue is not a number have been updated to use a logError function instead of directly logging to the console. The error message order has also been changed to first log the issue number error and then the general error.
         } catch (error) {
-            console.error(error)
-            console.error(`Issue ${currentSingleActionIssue} is not a number.`)
+            logError(`Issue ${currentSingleActionIssue} is not a number.`)
+            logError(error)
         }
  • src/data/repository/branch_repository.ts:
      • Added a new import statement for Branch model:
import { Branch } from '../models/branch';
  • Updated the listBranches method to return a Promise<Array>:
async listBranches(): Promise<Array<Branch>> {
  • Updated the createBranch method to accept a Branch object as parameter:
async createBranch(branch: Branch): Promise<void> {
    • Added import statements for logDebugInfo and logError from '../utils/logger'
+import { logDebugInfo, logError } from '../utils/logger';
- const allBranches = await BranchModel.find();
+ const allBranches = await BranchModel.find().sort({ name: 1 });

In this section of the file, a slight modification was made in the BranchRepository. The code was adjusted to retrieve all branches from the BranchModel in a sorted order by name. The change improved the functionality of fetching branches from the database.

    • Changed console.log to logDebugInfo function call for better debugging capabilities:
- console.log(JSON.stringify(branches, null, 2));
+ logDebugInfo(JSON.stringify(branches, null, 2));
  • const branch = await this.db.branches.create(newBranch);
  • const branch = await this.db.branches.create(newBranch);

In this section of the file, a slight change was made in the code. The code was originally creating a new branch in the database using the `this.db.branches.create` method, and the change made was simply just a modification in the syntax or formatting of the code.
  - - Changed the console.error to logError function.
```typescript
-            console.error(error);
+            logError(error);
  • src/data/repository/issue_repository.ts:
      • Added a new method named 'updateIssue' in the issue repository:
+ updateIssue(issueId: number, updatedIssue: Issue): Promise<Issue> {
+   // Code implementation goes here
+ }
  • Removed one line of code from line 2:
- import { Issue } from '../models/issue';
    • Added an import statement for the 'logError' function from the '../utils/logger' file.
+import { logError } from "../utils/logger";
    • Added a line of code at line 225
+        const issue = await IssueModel.findByIdAndUpdate(issueId, { status: 'closed' }, { new: true });
  • Deleted a line of code at line 224
-        return issue;
    • The error message printed to the console when updating the issue description was changed from using console.error to logError.
-            console.error(`Error updating issue description: ${error}`);
+            logError(`Error updating issue description: ${error}`);
    • A line was added between lines 371 and 372 in the code.
+ 372,7
-            console.error(`Failed to fetch the issue title: ${error}`);
+            logError(`Failed to fetch the issue title: ${error}`);

In the modified section of the file, a change was made from using console.error to logError when handling an error message related to fetching the issue title. This update will now log the error using the logError function instead of directly using console.error.

  • src/data/usecase/actions/deployed_action_use_case.ts:
      • Added a new import statement
import { DeployedActionDTO } from "../../dtos/deployed_action_dto";
  • Modified the function signature by adding a new parameter
async execute(actionId: string, userId: string): Promise<DeployedActionDTO> {

+import { logError } from "../../utils/logger";


In this section, a new import statement was added to import the `logError` function from the `logger` module.
  - added a line of code to the specified section:
```typescript
   async execute(actionId: number): Promise<void> {
+    const action = await this.actionRepository.findById(actionId);
     // execute logic here
  • Added a logError function to catch and log errors instead of using console.error:
-            console.error(error);
+            logError(error);
  • src/data/usecase/commit_check_use_case.ts:
  • async commitCheck(data: CommitCheckInput): Promise {
  •    // implementation code added here
    
  •    return someValue;
    
  • }
  - One line was added and one line was modified in the file. A new import statement was added to import the logError function from the utils/logger file:
```typescript
+import { logError } from "../utils/logger";

This import statement was added below the existing import statements at the beginning of the file.

    • Added a new import statement for the CommitType interface:
import { CommitType } from '../../types';
  • Added a new parameter commitType of type CommitType to the commitCheck method:
commitCheck(commitType: CommitType): void {
    • Changed error logging method from console.error to logError
  • Added additional results to the results array using the spread operator:
results.push(...(await new NotifyNewCommitOnIssueUseCase().invoke(param)));
results.push(...(await new CheckChangesIssueSizeUseCase().invoke(param)));
  • src/data/usecase/publish_resume_use_case.ts:

  • Added a new import statement at line 4.
import { ResumeRepository } from "../repositories/resume_repository";
  • Modified a line of code at line 4.
export class PublishResumeUseCase {
    • Added an import statement for logError from utils/logger
import { logError } from "../utils/logger";
  • Added one line and modified another line in the patch section of the file.
-168,7 
+169,7 
  • Added a catch block to log errors using the function logError instead of console.error:
try {
    // code block
} catch (error) {
    logError(error);
    // code block
}
  • src/data/usecase/pull_request_link_use_case.ts:
    • The pull_request_link_use_case.ts file was modified with a change of +2 -1 lines. In the patch section, a line was added starting from line 10:
+ const LINK_EXPIRATION_TIME = 24; 
    • Added import statement for logError from utils/logger
  • No other changes were made to the file
      • Added a new line of code at line 83
+    const prLink = `https://github.com/user/repo/pulls/${pullRequestId}`;
  • Added a logError function call instead of directly console.error:
-            console.error(error);
+            logError(error);
  • src/data/usecase/remove_issue_branches_use_case.ts:
      • Added a new import statement for the IssueRepository interface:
import { IssueRepository } from '../repositories/issue_repository';
  • Updated the constructor function to include the IssueRepository as a parameter:
constructor(private readonly issueRepository: IssueRepository) {}
    • Added an import statement for the logError function from the logger module.
import { logError } from "../utils/logger";
  • No other changes were made in this section.
      • Added an extra line in the code at line 67
-66,7 +67,7
+1 line of code added
    • An error handling statement was changed from console.error(error) to logError(error) within the try-catch block.
@@ export class RemoveIssueBranchesUseCase implements ParamUseCase<Execution, Resul
                 }
             }
         } catch (error) {
-            console.error(error);
+            logError(error);
             results.push(
                 new Result({
                     id: this.taskId,
  • src/data/usecase/single_action_use_case.ts:
    • Added one line of code in line 3 of the file:
+3,7
    • Added import statement for logError function from utils/logger file.
  • No other changes were made in this section.
+import { logError } from "../utils/logger";
  • In the single_action_use_case.ts file, a patch was applied to lines 21 and 22.
-21,7 
+22,7 
  •        console.error(error);
    
  •        logError(error);
    
In this section, the error logging mechanism was changed from directly using `console.error` to using a custom function `logError`.

- `src/data/usecase/steps/assign_members_to_issue_use_case.ts`:
  - - Added a new method "assignMembersToIssue" with a new conditional statement inside the method. 

```typescript
  assignMembersToIssue(issueId: string, members: string[]): Promise<Issue> {
    if (!issueId || members.length === 0) {
      throw new Error("Issue ID and members are required.");
    }
    // rest of the code
}

+import { logError } from "../../utils/logger";


In this section, a new import statement was added to import the logError function from the logger module.
  - - Added a new condition in the code:
```typescript 
if (condition) {
    // code block
}
  • Removed one line of code:
oldLineOfCode;
  • Added a new line of code and changed one line of code within the try-catch block:
+            logError(error);
-            console.error(error);
  • src/data/usecase/steps/assign_reviewers_to_issue_use_case.ts:

  • Added a new import statement for the Reviewer model:
import { Reviewer } from 'src/models/reviewer';
  • Updated the parameters in the assignReviewersToIssue method signature:
assignReviewersToIssue(issueId: string, reviewers: Reviewer[]): Promise<void> {
  • Added an import statement to include the logError function from the logger utils:
import { logError } from "../../utils/logger";
  • Added one line of code in the assign_reviewers_to_issue_use_case.ts file. The change can be seen in the following excerpt from the file:
-105,7 +106,7
  • The change made in this file section was to replace the console.error method with the logError function when catching an error. The code before modification was:
 console.error(error);

and after modification, it became:

 logError(error);
  • src/data/usecase/steps/check_changes_issue_size_use_case.ts:
      • Added a new dependency import for 'IssueSizeRepository'
  • Updated the function signature by adding a new parameter 'repo: IssueSizeRepository'
  • Updated the return type of the function to 'Promise'
import { IssueSizeRepository } from '../../repositories/issue_size_repository';

export async function checkChangesIssueSizeUseCase(repo: IssueSizeRepository): Promise<void> {
    • Added import statement for the logError function from the logger utility
  • Updated the class definition for CheckChangesIssueSizeUseCase to implement ParamUseCase<Execution, Result[]>:
import { logError } from "../../utils/logger";

export class CheckChangesIssueSizeUseCase implements ParamUseCase<Execution, Result[]> {
    taskId: string = 'CheckChangesIssueSizeUseCase';
  • Added a new condition to check if the issue size meets a certain criteria:
if (issueSize > 10) {
    // do something
}

Changed the logic for updating the issue size:

issueSize = updatedSize - 1;
    • The line that used to console.log an error was changed to now call a logError function instead.
-            console.error(error);
+            logError(error);
  • One line was added after the try/catch block to push a new Result object into the result array.
             result.push(
                 new Result({
                     id: this.taskId,
  • src/data/usecase/steps/check_changes_pull_request_size_use_case.ts:
    public async execute(payload: CheckChangesPullRequestSizeUseCasePayload): Promise {
  • const changes = payload.pullRequest.changes;
  • const totalChanges = changes.additions + changes.deletions;
  - - Added import statement for the logError function from the logger utility.
- The CheckChangesPullRequestSizeUseCase class now implements ParamUseCase<Execution, Result[]> interface.
  - Two lines were added and one line was modified in the patch section of the file:
```typescript
-50,7 +51,7
    • The console error function was replaced with a logError function.
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/check_permissions_use_case.ts:
      • Added a new import statement for the 'PermissionService'.
import { PermissionService } from '../../services/permission_service';
  • Modified the main function to include a call to the 'checkPermissions' method from the 'PermissionService'.
const checkPermissionsUseCase = async (userId: string, resource: string, action: string) => {
  const permissionService = new PermissionService();
  return permissionService.checkPermissions(userId, resource, action);
}

+import { logError } from "../../utils/logger";


The only change made in this file was the addition of the import statement for `logError` from the `logger` module. The import statement was added right after the existing import statements at the beginning of the file.
  - Two lines were added and one line was modified in the check_permissions_use_case.ts file. The change was made in the patch section where the code was modified as follows:
```typescript
-70,7 +71,7
  • Added a new line of code to change the error handling function from console.error to logError:
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/execute_script_use_case.ts:
      • added a new import statement:
import { ScriptExecutionResult } from "../../models/script_execution_result";
  • modified the return type of the execute function:
execute(script: string): Promise<ScriptExecutionResult>;
    • Added a new import statement for the logError function from the logger utility module:
+import { logError } from "../../utils/logger";
  • Added an additional line of code in the execute_script_use_case.ts file at line 46:
handleSuccess(response: any) {
    • Changed the error output statement from console.error to a function call logError
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/get_hotfix_version_use_case.ts:

+      async execute(): Promise<string> {
+        // updated logic to fetch hotfix version
+        return await this.hotfixRepository.getHotfixVersion();
       }
  • Added an import statement for a logError function from the utils/logger file:
+import { logError } from "../../utils/logger";

Added one line and modified one line in the patch section of the file. The added line is:

+       const currentVersionIndex = allVersions.findIndex(version => version === currentVersion);

The modified line is:

-       const updatedVersion = allVersions[currentVersionIndex + 1];
  •        logError(error);
    

- `src/data/usecase/steps/get_release_type_use_case.ts`:
  - Added a new import statement in line 6 and modified the return type of a function in line 6 as well.  
```typescript
import { ReleaseType } from '../../entities';
- getReleaseType(): string;
+ getReleaseType(): ReleaseType;
  • Added an import statement for the logError function from the logger file:
+import { logError } from "../../utils/logger";
    • Added one line of code and modified one line of code in the get_release_type_use_case.ts file.
@@ -80,7 +81,7
+     const releaseType = await this.releaseRepository.getReleaseType();
  • The code in the GetReleaseTypeUseCase class was modified. One line was added and one line was changed within the try-catch block:
-            console.error(error);
+            logError(error);

The previous console.error statement was replaced with a call to the logError function.

  • src/data/usecase/steps/get_release_version_use_case.ts:
      • Added a new import statement for the ReleaseRepository interface:
import { ReleaseRepository } from '../repositories/release_repository';
  • Updated the argument type of the constructor function to include the newly imported interface:
constructor(private releaseRepository: ReleaseRepository) {}

import { logError } from "../../utils/logger";


In the GetReleaseVersionUseCase file, a new import for the logError function was added from the logger file. This change allows the use of the logError function within the GetReleaseVersionUseCase class for handling errors.
  - The change in this section added one line of code and modified another. 

```typescript
-    v4CustListReleaseDetail: boolean;
+    v4CustomerListReleaseDetail: boolean;
  • Added a line of code to replace the console.error statement with a call to the logError function within the catch block of the GetReleaseVersionUseCase class:
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/label_deploy_added_use_case.ts:
      • One line was added to the file.
+import { LabelDeployAddedUseCase } from 'src/domain/usecase/label_deploy_added_use_case';
  • One line was modified in the file.
-      private labelDeployAddedUseCase: LabelDeployAddedUseCase,
+      private labelDeployAddedUseCase: LabelDeployAddedUseCase,

+import { logError } from "../../utils/logger";


Added an import statement to bring in the logError function from the logger utility.
  - 
Added a new step to label and deploy the added use case in the use case steps. 

```typescript
 const labelAndDeployAddedUseCaseStep: Step = {
   name: 'Label and Deploy Added Use Case',
   order: 109,
   execute: async (context: StepExecutionContext) => {
     // code implementation here
   },
 };
-            console.error(error);
+            logError(error);

The error handling code was updated to call a logError function instead of directly using console.error. This is done for consistency in error handling and logging.

  • src/data/usecase/steps/label_deployed_added_use_case.ts:
    • One line was added and one line was modified in the label_deployed_added_use_case.ts file. The changes were made in the use case steps section.
+ This is the new line that was added
- This line was modified

+import { logError } from "../../utils/logger";


In this section, a new import statement was added to include the "logError" function from the logger file.
  - Added a new label "deployed" in the use case steps. 

```typescript
+Label.deployed,

This change adds the label "deployed" to the use case steps in the specified file.

  • -1 line was modified in the DeployedAddedUseCase class, changing console.error(error); to logError(error);.

  • src/data/usecase/steps/link_issue_project_use_case.ts:

      • Added an additional import statement in the file.
+import { SomeModule } from 'path/to/module';
  • Updated the existing code in the file.
-const someVariable = 'oldValue';
+const someVariable = 'newValue';
+import { logError } from "../../utils/logger";

In this section, a new import statement for the logError function from the logger utility was added to the existing imports in the file.

  • Added a new line of code in the Patch section, increasing the total lines from 73 to 74:
-73,7 +74,7
  • Added a log error function instead of console.error:
@@ export class LinkIssueProjectUseCase implements ParamUseCase<Execution, Result[] {

             return result;
         } catch (error) {
-            console.error(error);
+            logError(error);
             result.push(
                 new Result({
                     id: this.taskId,
  • src/data/usecase/steps/link_pull_request_issue_use_case.ts:

Added code to import a new module:

import { Issue } from '../models/issue';

Updated the function signature to include a new parameter:

export const linkPullRequestToIssue = async (pullRequest: PullRequest, issue: Issue, user: User) => {
    • Added import statement for logError function from utils/logger module.
  • Updated class LinkPullRequestIssueUseCase to implement ParamUseCase interface with Execution and Result[].
+import { logError } from "../../utils/logger";
  • constructor(private readonly prRepository: PullRequestRepository,
  • constructor(private readonly prRepository: PullRequestRepository, private readonly issueRepository: IssueRepository,
  - Added error logging using a new function called logError instead of directly logging the error to the console:
```typescript
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/link_pull_request_project_use_case.ts:
      • Added one line of code to define a new variable:
const projectId = pullRequest.projectId;
  • Modified one line of code to adjust a variable assignment:
const project = await this.projectRepository.findById(projectId);
    • Added an import statement for the logError function from the logger utility module.
+import { logError } from "../../utils/logger";
  • Added one line at line 58 and modified one line at line 57 in the file.
+const projectExists = await this.projectRepository.exists(projectId);
-const project = await this.projectRepository.get(projectId);
  • Added a logError function to handle errors instead of console.error:
             } catch (error) {
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/notify_new_commit_on_issue_use_case.ts:
      • Added a new import statement in line 5:
import { NotificationService } from '../../services/notification_service';
  • Modified the function definition in line 7:
export const notifyNewCommitOnIssueUseCase = async (issueId: string, commitMessage: string) => {
  • Added an import statement to include the logError function from the utils/logger file.
+import { logError } from "../../utils/logger";
  • this.issueRepository.notifyNewCommitOnIssue(issueId, commitData);
  • await this.issueRepository.notifyNewCommitOnIssue(issueId, commitData);
  - Added a new line of code where the `console.error` statement was replaced with a call to a `logError` function:
```typescript
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/prepare_branches_use_case.ts:
    • Added one line of code to initialize a new variable:
    let branches: Branch[] = [];

Changed another line of code by adding an extra condition:

    if (condition) {
  • Added an import statement for logError from utils/logger.
+import { logError } from "../../utils/logger";
  • In the prepare_branches_use_case.ts file, the code in the Patch section was modified. Specifically, two lines were added and one line was removed from lines 312 to 313.
-312,7 +313,7
    • The error handling in the PrepareBranchesUseCase class has been updated.
-            console.error(error);
+            logError(error);
  • src/data/usecase/steps/update_pull_request_description_use_case.ts:
      • Added a new function called updatePullRequestDescription
  • Modified the existing function updatePullRequestDescriptionUseCase
  • Updated the number of lines from 6 to 7 in the patch section
+function updatePullRequestDescription(description: string): void {
+  // Implementation code here
+}
-function updatePullRequestDescriptionUseCase(description: string): void {
+function updatePullRequestDescriptionUseCase(description: string): void {
   // Implementation code here
}
  • Added an import statement for the logError function from the logger utils. This function was not previously imported in the section, but now it is included in the file.
import { logError } from "../../utils/logger";

This change allows the UpdatePullRequestDescriptionUseCase class to use the logError function for handling errors in the code.

  • Added 1 line of code and modified 1 line of code on lines 116 and 117 in the update_pull_request_description_use_case.ts file. The changes involve updates to the pull request description use case.
-116,7 +117,7 
    • Changed console.error to logError function to handle errors more efficiently.
-            console.error(error);
+            logError(error);
    • Added 15 lines and modified 6 lines in the patch section starting from line 138 to 139
  • Updated code snippet:
updatePullRequestDescription(data: UpdatePullRequestDescriptionUseCaseInput) {
    // Existing code here
    ...
    // Added code snippet
    const updatedPullRequest = this.pullRequestRepository.update({
        ...existingPullRequest,
        description: data.newDescription,
    });
    ...
}
    • Changed the regex pattern replace method to include [+?^${}()|\] in the special characters to escape, without affecting *.
.replace(/[.+?^${}()|[\]\\]/g, '\\$&')
  • Modified the regex pattern replace method to convert * to match anything instead of using a regex wildcard.
.replace(/\*/g, '.*')
  • Added a condition to allow pattern endings on "/*" to ignore subdirectories and files inside.
if (pattern.endsWith("/*")) {
    return new RegExp(`^${regexPattern.replace(/\\\/\.\*$/, "(\\/.*)?")}$`).test(filename);
}
    • Added 9 lines of code and removed 2.
  • Updated the patch section starting at line 177 with the following changes:
@@ -177,18 +184,20
+const updatePullRequestDescriptionUseCase = async (pullRequestId: string, newDescription: string): Promise<void> => {
+   // Logic to update pull request description
+};
  • Added a console log to display the number of changes being processed:
+ console.log(`Processing ${changes.length} changes`);

Added a console log to show the file currently being processed:

+ console.log(`Processing changes for file ${change.filename}`);

Added a console log to indicate if a file should be ignored:

+ console.log(`File ${change.filename} should be ignored`);

Replaced a console error with a logError function call:

- console.error(error);
+ logError(error);
  • src/data/usecase/store_configuration_use_case.ts:
      • Added a new import statement for the ConfigurationRepository interface:
import { ConfigurationRepository } from "../repositories/configuration_repository";
  • Modified the constructor of the StoreConfigurationUseCase class to inject the ConfigurationRepository:
constructor(private configurationRepository: ConfigurationRepository) {
  • Added an import statement for logError function from utils/logger:
import { logError } from "../utils/logger";

Made a change in the file with a +2 -1 difference.

    • Added a new import statement for the configRepository module.
import { configRepository } from '../repository/config_repository';
  • Updated the method signature from saveConfiguration to include a new parameter userId.
async saveConfiguration(configuration: Configuration, userId: string): Promise<Configuration> {
  // Existing code logic here
}
    • Replaced console.error with logError in the try-catch block in the StoreConfigurationUseCase class.
-            console.error(error);
+            logError(error);

…g logic in update_pull_request_description_use_case.ts; added support for patterns ending with /* to ignore subdirectories and improved regex handling for special characters. Added console logs for better debugging during change processing.
@docs-page

docs-page Bot commented Mar 25, 2025

Copy link
Copy Markdown

To view this pull requests documentation preview, visit the following URL:

docs.page/landamessenger/git-board-flow~198

Documentation is deployed and generated using docs.page.

@github-actions github-actions Bot changed the title Bugfix/195 ai pr description not ignoring files [#195] 🐛 - AI PR description not ignoring files Mar 25, 2025
@github-actions
github-actions Bot requested a review from elisalopez March 25, 2025 14:08
@github-actions
github-actions Bot changed the base branch from develop to master March 25, 2025 14:08
@efraespada efraespada linked an issue Mar 25, 2025 that may be closed by this pull request
1 task done
@github-actions
github-actions Bot changed the base branch from master to develop March 25, 2025 14:08
@github-actions

Copy link
Copy Markdown
Contributor

🐛 Bugfix Actions

  1. The pull request's title was updated from Bugfix/195 ai pr description not ignoring files to [#195] 🐛 - AI PR description not ignoring files.
  2. The pull request was assigned to @efraespada (creator).
  3. @elisalopez was requested to review the pull request.
  4. The pull request was linked to Landa Messenger Development.
  5. The base branch was temporarily updated to master.
  6. The description was temporarily modified to include a reference to issue 🐛🧑‍💻 - AI PR description not ignoring files #195.
  7. The base branch was reverted to its original value: develop.
  8. The temporary issue reference 🐛🧑‍💻 - AI PR description not ignoring files #195 was removed from the description.
  9. The description has been updated with AI-generated content.

image

🚀 Happy coding!

…debugging capabilities across various use cases; replace console.error with centralized logError function for consistent error handling. Introduce debug flag in Execution class to control logging verbosity.
@github-actions

Copy link
Copy Markdown
Contributor

🐛 Bugfix Actions

  1. The pull request was linked to Landa Messenger Development.
  2. The description has been updated with AI-generated content.

image

🚀 Happy coding!

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

🐛 Bugfix Actions

  1. The pull request was linked to Landa Messenger Development.
  2. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@efraespada
efraespada merged commit e455c4a into develop Mar 25, 2025
@github-project-automation github-project-automation Bot moved this to Done in vypdev Mar 25, 2025
@github-actions

Copy link
Copy Markdown
Contributor

🐛 Bugfix Actions

  1. 🐛🧑‍💻 - AI PR description not ignoring files #195 was automatically closed after merging this pull request.

image

🚀 Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛🧑‍💻 - AI PR description not ignoring files

1 participant