Skip to content

[#180] ✨ - Improve AI PR descriptions - #191

Merged
efraespada merged 17 commits into
developfrom
feature/180-improve-ai-pr-descriptions
Mar 24, 2025
Merged

efraespada merged 17 commits into
developfrom
feature/180-improve-ai-pr-descriptions

Conversation

@efraespada

@efraespada efraespada commented Mar 24, 2025 •

Copy link
Copy Markdown
Member

#180

What does this PR do?

This pull request enhances the user interface of pull request descriptions by highlighting code changes and emphasizing variable names, classes, or referenced code. It aims to improve PR usability. The current limitation is that code highlighting is not supported in PR descriptions. The expected impact is a more user-friendly experience for team members reviewing PRs. No alternatives were considered.

What files were changed?

  • dist/index.js:
    • Three lines were added in the patch section starting at line 47517. The changes made involved modifying some code.
-47517,6 +47517,9 
  • The code in the IssueContentInterface class was modified to include a new condition else if (execution.isPush) which assigns the number variable to execution.issueNumber. This change was made in the dist/index.js file, with a total of 12 lines added and 8 lines removed.
@@ class IssueContentInterface extends content_interface_1.ContentInterface {
                 else if (execution.isPullRequest) {
                     number = execution.pullRequest.number;
                 }
+                else if (execution.isPush) {
+                    number = execution.issueNumber;
+                }
                 else {
                     return undefined;
                 }
  • Three lines were added from line 47540 to line 47543 in the patch section of the file.
@@ -47540,6 +47543,9
  • Added a new conditional statement to check if the execution is a push. If so, set the number variable to the execution's issue number:
+ else if (execution.isPush) {
+     number = execution.issueNumber;
+ }
    • Added 12 lines of code and removed 8 lines of code in the file.
  • Specifically, in the patch section, starting at line 48013, 6 lines of code were added and 7 lines were modified.
    • Added a console.log statement to log the previous configuration in a readable format:
+console.log(`Previous configuration: ${JSON.stringify(this.previousConfiguration, null, 2)}`);

This change will now print out the previous configuration in a structured manner for debugging or informational purposes.

    • Added 12 lines and removed 8 lines in the index.js file.
  • Specifically, in the patch section, lines were added starting from line 48108 and ending at line 48115.
  • One of the changes made in this section can be highlighted like this:
+ new line of code here
    • Added a console.log statement to print out the current configuration in a readable format:
console.log(`Current configuration: ${JSON.stringify(this.currentConfiguration, null, 2)}`);
  • In this section of the file, there were some changes made to the code. Four lines were added and eight lines were removed. Specifically, starting at line 51570 and ending at line 51578, the following code changes were made:
+ // New code added here
- // Code removed here

These changes were made to improve the functionality of the code in this section.

  • Removed a condition that checked if the parent branch is undefined. Changed the function parameters passed to setLabels method from issueNumber to pullRequest.number. Updated console log message to display pull request number instead of issue number. Changed the message logged when resizing from issue to pull request.
  • Added 12 new lines and removed 8 lines in the section starting at line 53725 and ending at line 53729. There was a change in the code at this section:
+ const newFunction = () => {
+   // new functionality
+ };
  • added 12 lines of code and removed 8 lines of code in the patch section. The changes made were in the return statement where a split operation was added.
return patch.split(/(?=
    • Added a new code section in the processPatchSection function to highlight any piece of code mentioned:
+        const filePrompt = `Do a summary of the changes in this file section (no titles, just a text description, avoid to use the file name or expressions like "this file" or "this section". Try to start the explanation with what was changed directly and highlight with \`\`\`language [new_line] [code here]\`\`\` any piece of code mentioned):\n\n` +
  • src/data/manager/description/base/issue_content_interface.ts:
    • Added two new properties to the interface:
   id: string;
   title: string;
    • Added a new condition for handling push events in the IssueContentInterface class
+            } else if (execution.isPush) {
+                number = execution.issueNumber
    • Added 4 lines of code to the file
  • In the patch section, starting at line 42, added two lines of code:
   timestamp: number;
   content: string;
  • Added the code snippet that checks for execution.isPush and sets the number variable to execution.issueNumber in the IssueContentInterface class.

  • src/data/model/execution.ts:

      • Changed the line of code at line 228 from:
-        status: string;
+        status: string = "pending";
  • Added a line of code at line 229:
+        id: number;
  • The changes made in this section involved adding a console log statement to display the previous configuration in JSON format. This was achieved by inserting the following code snippet:
console.log(`Previous configuration: ${JSON.stringify(this.previousConfiguration, null, 2)}`);
  • The changes made in this section involve adding 3 lines of code and modifying 1 line.
-    // Previous code here
+    // Modified code here
+    newLineOfCode()
+    newLineOfCode()
+    newLineOfCode()
  • Added a console.log statement to log the current configuration as a JSON string with an indentation of 2 spaces:
console.log(`Current configuration: ${JSON.stringify(this.currentConfiguration, null, 2)}`);
  • src/data/usecase/steps/check_changes_issue_size_use_case.ts:
    • Removed one line of code that was previously in line 14:
- currentIssueSize: number; 
  • Removed the condition that checked if the parent branch of the current configuration is undefined.
-             if (param.currentConfiguration.parentBranch === undefined) {
-                 core.info(`Parent branch is undefined.`)
-                 return result;
  • src/data/usecase/steps/check_changes_pull_request_size_use_case.ts:
      • The lines 14 to 20 have been modified, with a total of 12 lines removed and 6 lines added.
  • The code was updated to include a new validation check for the size of the pull request.
+ if (pullRequestSize > MAX_SIZE) {
+   throw new Error('Pull request size is too large');
+ }
  • Removed a condition that checked if the parent branch was undefined before fetching the size category and reason from the branch repository. The code now directly calls the repository method without this check.
-            if (param.currentConfiguration.parentBranch === undefined) {
-                core.info(`Parent branch is undefined.`)
-                return result;
-            }
    • Removed 6 lines of code starting from line 37 and ending on line 20
-    if (pullRequest.size > 100) {
-      throw new Error('Pull request size is too large');
-    } else if (pullRequest.size < 1) {
-      throw new Error('Pull request size is too small');
-    }
    • Changed parameter from param.issueNumber to param.pullRequest.number for setLabels method in issueRepository class.
  • Updated console log message to mention pull request number instead of issue number.

  • Changed message from mentioning issue resizing to pull request resizing for the success step.

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

    • One line was added and one line was removed in the specified section of the file.
-161,7
+161,7
  • The only change made in this section was adding the following line of code:
+        const filePrompt = `Do a summary of the changes in this file section (no titles, just a text description, avoid to use the file name or expressions like "this file" or "this section". Try to start the explanation with what was changed directly and highlight with \`\`\`language [new_line] [code here]\`\`\` any piece of code mentioned):\n\n` +

@docs-page

docs-page Bot commented Mar 24, 2025

Copy link
Copy Markdown

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

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

Documentation is deployed and generated using docs.page.

@github-actions github-actions Bot changed the title Feature/180 improve ai pr descriptions [#180] ✨ - Improve AI PR descriptions Mar 24, 2025
@github-actions
github-actions Bot requested a review from elisalopez March 24, 2025 13:34
@github-actions
github-actions Bot changed the base branch from develop to master March 24, 2025 13:34
@efraespada efraespada linked an issue Mar 24, 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 24, 2025 13:35
@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The pull request's title was updated from Feature/180 improve ai pr descriptions to [#180] ✨ - Improve AI PR descriptions.
  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 ✨🧑‍💻 - Improve AI PR descriptions #180.
  7. The base branch was reverted to its original value: develop.
  8. The temporary issue reference ✨🧑‍💻 - Improve AI PR descriptions #180 was removed from the description.
  9. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. More than 5 commits, so the issue was resized to size xl.
  2. The description has been updated with AI-generated content.

image

🚀 Happy coding!

…estSizeUseCase: Update logging and parameter usage to reflect pull request context
@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@github-actions github-actions Bot added enhancement New feature or request branched Indicates that a branch has been created for this issue. size: XXL Indicates an extremely large task or issue that requires significant time and effort to complete. labels Mar 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. More than 10 commits, so the pull request was resized to size xxl.
  2. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. More than 10 commits, so the pull request was resized to size xxl.
  2. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. More than 10 commits, so the pull request was resized to size xxl.
  2. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The description has been updated with AI-generated content.

image

🚀 Happy coding!

@github-actions

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The description has been updated with AI-generated content.

image

🚀 Happy coding!

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

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. ✨🧑‍💻 - Improve AI PR descriptions #180 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

branched Indicates that a branch has been created for this issue. enhancement New feature or request size: XXL Indicates an extremely large task or issue that requires significant time and effort to complete.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

✨🧑‍💻 - Improve AI PR descriptions

1 participant